Author Topic: Custom graphics driver for FF7/FF8 [v.1-.7.6]  (Read 761245 times)

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #75 on: 2009-04-15 15:16:30 »
Going back to shaders and filters, what causes the glitches when you apply it to the whole scene ?  The fact that some layers show artifacts when rendered ?

If so, wouldn't it be possible to apply a filter/shader individually to each layer and skip the ones that show artifacts (the alpha layer comes to mind) ?  Pete's GPU drivers seem to use a similar principle for filtering and it works well for ff7 on epsxe.  I have to admit I don't recall if it improves the backgrounds at all though.

If it doesn't show, I don't know much about these things and I'm tossing (probably ridiculous!) ideas out there based on what little I do know but realistically, I think this is the closest somebody has ever been to improving the backgrounds as I doubt anybody is ever going to go through the 758 or so field files of the game to re-render them at a higher resolution!

Regardless, keep up the good work.

Its very possible to apply filters *after* the scene has been fully rendered (since it is essentially just a 2D image by then). But then you'll be filtering everything, not just the low-res field tiles.

myst6re

  • *
  • Posts: 642
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #76 on: 2009-04-15 15:33:44 »
Could you please upload your ff7.exe somewhere so I can compare it to the US english version?

Ok, FF7 1.02 french

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #77 on: 2009-04-15 17:09:37 »
Ah, that .exe IS incompatible with this driver, I should change the error message to include this possibility..

I can add support for other languages*, but its going to be alot more work than just disabling the version check. (And wont be in 0.2b)

* As long as you provide the .exe

Marc

  • *
  • Posts: 445
  • I hear Voices ... in my head
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #78 on: 2009-04-16 03:12:16 »
Going back to shaders and filters, what causes the glitches when you apply it to the whole scene ?  The fact that some layers show artifacts when rendered ?

If so, wouldn't it be possible to apply a filter/shader individually to each layer and skip the ones that show artifacts (the alpha layer comes to mind) ?  Pete's GPU drivers seem to use a similar principle for filtering and it works well for ff7 on epsxe.  I have to admit I don't recall if it improves the backgrounds at all though.

If it doesn't show, I don't know much about these things and I'm tossing (probably ridiculous!) ideas out there based on what little I do know but realistically, I think this is the closest somebody has ever been to improving the backgrounds as I doubt anybody is ever going to go through the 758 or so field files of the game to re-render them at a higher resolution!

Regardless, keep up the good work.

Its very possible to apply filters *after* the scene has been fully rendered (since it is essentially just a 2D image by then). But then you'll be filtering everything, not just the low-res field tiles.

Meaning only the 2d would be filtered ?  Or the whole scene ?  Would that help improve the backgrounds (and the whole scene while we're at it) ?

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #79 on: 2009-04-16 03:25:31 »
The whole scene. It would be far from ideal (since by that time, you've lost any information associated with the objects on screen) and the best you could do without completely killing framerate would not be much better than what we have now. The point of filtering field backgrounds before they're drawn is that you only have to do it once, so you can apply any kind of expensive filtering and even make manual edits to really make it look better.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #80 on: 2009-04-16 22:35:55 »
Going back to shaders and filters, what causes the glitches when you apply it to the whole scene ?  The fact that some layers show artifacts when rendered ?
Simply put they are aligned on integral points based on a screen that's 320x224.  So let's say you try to display those at 1024x768.  The layers do not exactly fit as integer multiples and although rational numbers do not allow for precise alignment of each layer on top of each other. The "jaggies" of weird color are the layers behind showing through in reality.

If so, wouldn't it be possible to apply a filter/shader individually to each layer and skip the ones that show artifacts (the alpha layer comes to mind) ?  Pete's GPU drivers seem to use a similar principle for filtering and it works well for ff7 on epsxe.  I have to admit I don't recall if it improves the backgrounds at all though.
If so ... what?  If you READ Pete's discussion of it when he posted about it you would understand WHY this happens.  In particular it is a combination of the fact the GPU in the PS1 is 2d (no 3d in that graphics processor) and the 2d polys are chosen using the GTE and software Z buffering the alignment of the polygons in 2d create the problem of the none integer multiple display and create the "EVIL JAGGIES" :D
If it doesn't show, I don't know much about these things and I'm tossing (probably ridiculous!) ideas out there based on what little I do know but realistically, I think this is the closest somebody has ever been to improving the backgrounds as I doubt anybody is ever going to go through the 758 or so field files of the game to re-render them at a higher resolution!
Hmmm the problem comes with how the engine renders them. And this was discussed in several other threads (and previously in this one).

Cyb

magixts

  • *
  • Posts: 52
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #81 on: 2009-04-17 13:54:40 »
http://epj.no-ip.org/upl/ff7_opengl-0.2b.zip
Tested and working on Vista x64 in 1920x1440 using preserve_aspect = true option. 2560x1600 however causes a crash in ff7_opengl.dll!0x6e51f767h.

Code: [Select]
ff7_opengl.dll!6e51f767()
  [Frames below may be incorrect and/or missing, no symbols loaded for ff7_opengl.dll]
  ntdll.dll!77022f1f()
> msvcr90.dll!free(void * pBlock=0x00000000)  Line 115 + 0x5 bytes C
  00002154()

Code: [Select]
...
6E44F720  push        ebp 
6E44F721  push        edi 
6E44F722  push        esi 
6E44F723  push        ebx 
6E44F724  sub         esp,0BCh
6E44F72A  mov         eax,dword ptr [esp+0D4h]
6E44F731  mov         ecx,dword ptr [esp+0D0h] //dword ptr [esp+0D0h] == 0x0h
6E44F738  mov         ebx,dword ptr [eax]
6E44F73A  mov         dword ptr [esp+90h],ebx
6E44F741  mov         edx,dword ptr [eax+4]
6E44F744  mov         dword ptr [esp+94h],edx
6E44F74B  mov         edi,dword ptr [eax+8]
6E44F74E  mov         dword ptr [esp+38h],edx
6E44F752  mov         ebp,dword ptr [esp+38h]
6E44F756  mov         dword ptr [esp+98h],edi
6E44F75D  mov         esi,dword ptr [eax+0Ch]
6E44F760  mov         dword ptr [esp+0A0h],ebx
6E44F767  mov         ebx,dword ptr [ecx+60h] //exception (ecx == 0x0h)

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #82 on: 2009-04-17 14:45:43 »
Tested and working on Vista x64 in 1920x1440 using preserve_aspect = true option. 2560x1600 however causes a crash in ff7_opengl.dll!0x6e51f767h.

Confirmed. That's a crash in libswscale though, so if you disable nice_movies it'll work :-)

magixts

  • *
  • Posts: 52
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #83 on: 2009-04-17 14:55:40 »
Tested and working on Vista x64 in 1920x1440 using preserve_aspect = true option. 2560x1600 however causes a crash in ff7_opengl.dll!0x6e51f767h.

Confirmed. That's a crash in libswscale though, so if you disable nice_movies it'll work :-)
Nice, looking forward to coming improvements. :)

Akimbo

  • Guest
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #84 on: 2009-04-17 16:11:39 »
Too tech for me, simple Q: Will this eventually fix these stupid fps issues?

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #85 on: 2009-04-18 03:29:29 »
Working for me.  Played for 5 minutes to try it out, here's what I noticed.

-Battle Swirl Missing
-Small framerate drops for fractions of a second.
-any way to enable Vsync?  I noticed horizontal tearing when moving around fields.

These are the only things I really noticed.  Goddamn nice work here man, for a 0.2 release, surprisingly complete.

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #86 on: 2009-04-18 11:18:22 »
Hmm, my system is waaay too fast to ever show the battle swirl, might be why I haven't noticed that :-)
Not sure whats up with the framerate drops, does it happen randomly or is there a pattern to it?
Vsync could be a problem if FF7 wants to use a framerate not compatible with your monitor, but I'll see what I can do.

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #87 on: 2009-04-18 15:54:38 »

Took a look with fraps to check the framerate.  Field, instead of running at 30 at all times, runs at 29/28.  The Vsync problem seems to be gone for some reason, who knows what happened with that..
« Last Edit: 2009-04-18 16:00:01 by Trenholm »

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #88 on: 2009-04-18 16:44:58 »
And that only happens in field? What are your system specs?

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #89 on: 2009-04-19 14:37:44 »
2.6 GHz AMD Anthlon64 x2
ATI Radeon X1950XT
2GB RAM (Don't remember the speed and don't feel like finding CPU-Z to check if you need it let me know)
Windows XP Pro SP3

Field runs at steady 29 FPS (rather than 30, but its really not a big deal since it isn't really noticeable)
World map is always changing anywhere from 30 to 28.  Never really hangs on a single FPS.
Battles run at steady 15 as they are supposed to

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #90 on: 2009-04-19 14:59:58 »
Yeah, that system is way too fast to run this game :-P

Seriously though, I have no idea what could be causing it, I can't reproduce it (smooth as silk here, 30fps all the time in both field and worldmap) and there's nothing that should block outside of the movie player (the only thing that does any kind of disk access on a regular basis)

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #91 on: 2009-04-19 22:04:23 »
Again, its not really noticeable so I really wouldn't worry about it too much.  Everything else seems to work great.

I have a question though, is it running in 32 bit color?

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #92 on: 2009-04-19 22:34:45 »
It is, and its fairly noticeable on any non-textured areas. Compare the following screenshots:

OpenGL driver, 32-bit:


D3D driver, 16-bit:
« Last Edit: 2009-05-21 14:21:08 by Aali »

koral

  • Guest
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #93 on: 2009-04-20 00:08:22 »
Totally awesome update Aali, I just cannot thank you enough for creating this new driver!!  :-D

The SaiNt

  • *
  • Posts: 1300
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #94 on: 2009-04-20 13:26:48 »
Nice job, Aali.

I just wonder that noone discovered the possibility of injecting a custom graphics driver into the engine before, especially since there have been several patches developed for the internal engine.

And we thought that we have already reached the limits of the original engine years ago...  :-P

 - Alhexx

If you look it up, I think Qhimm noted it quite some time ago.
I've looked at it before when I did the high res patch, but never got round to actually playing with it.

magixts

  • *
  • Posts: 52
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #95 on: 2009-04-20 22:30:28 »
Nice job, Aali.

I just wonder that noone discovered the possibility of injecting a custom graphics driver into the engine before, especially since there have been several patches developed for the internal engine.

And we thought that we have already reached the limits of the original engine years ago...  :-P

 - Alhexx

If you look it up, I think Qhimm noted it quite some time ago.
I've looked at it before when I did the high res patch, but never got round to actually playing with it.

\me rounds up mob :)

Hellbringer616

  • *
  • Posts: 1913
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #96 on: 2009-04-21 05:15:06 »
This is shaping up to be a very nice project, great work Aali!

Did we ever figure out if it was a no go on injecting 3d backgrounds? (sorry if this is off topic)

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #97 on: 2009-04-21 05:22:25 »
Correct me if I'm wrong, but won't this do absolute wonders for compatibility on newer systems?

ultima espio

  • *
  • Posts: 1357
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #98 on: 2009-04-22 19:29:49 »
How do you get it to run in a window and custom resolution :?I cant figure it out.

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #99 on: 2009-04-22 19:35:28 »
You have to change some variables in ff7_opengl.cfg, open it in notepad or any other text editor, every option is commented with an explanation of what it does.