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

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #25 on: 2009-03-28 16:29:51 »
Nevermind, the info was there all along, I was just looking in the wrong place, you don't know which palette to use until its time to render the texture :-)

I've also noticed that FF7 seems to work well even if you resize the viewport, which means you can use the hi-res patch at any resolution :-) (Higher resolutions wont improve quality, of course, but this makes it possible to run hi-res on widescreen 1280x800 displays etc)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #26 on: 2009-03-28 23:15:52 »
how does that effect the backgrounds that expect a 4x3 aspect ratio or the battle menus that span the bottom of the screen?

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #27 on: 2009-03-29 07:44:36 »
I believe you can achieve pretty much any effect you want by tweaking the viewport and projection matrix :-)

Simply stretching everything over the full screen area is possible, but it should also be possible to add black borders to preserve aspect ratio

Menus are not really any different from the other graphics, infact, they're drawn by the same routine that does the world map

No more screenshots for now, reorganizing the code to more closely mirror the d3d driver instead of the (broken) opengl driver, but I think I know how to get field backgrounds and menus working properly now. Battle is a completely different beast, have to decipher the relatively complex 3d object (PCs, NPCs, field entities, high-res models on the world map etc) routine to make that work.

MrAdults

  • Guest
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #28 on: 2009-03-29 10:45:08 »
I would partially expect them to do object frustum culling, at least for the battle scenes where there is a dynamic camera floating around, before the driver-level. Mainly to avoid having to do skeletal transforms for off-screen models. But perhaps since those scenes are rather constant-cost, they just didn't care. I don't think you could really manage proper wide-aspect on most of the static background scenes without having to blackbar the sides, though. Or risk having the background image stretched to a bad aspect ratio.

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #29 on: 2009-03-29 11:44:36 »
Oh I'm not saying the in-game viewport (visible area) should be made bigger, the "internal" resolution would still be 1280x960 (with high-res patch) but the final output can be scaled and/or stretched.

That said, you *can* make the visible area bigger aswell, but that would lead to more glitches as MrAdults pointed out. (The game was never meant to be widescreen, after all)

Cupcake

  • And then it dawned on me, that Satan is also an old fuck.
  • *
  • Posts: 906
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #30 on: 2009-03-31 04:00:42 »
Well done Aail, I'm highly impressed

Maybe you should also add the code to the Q-Gears SVN as well, because I would imagine this would help the project along a hell of a lot...not that it's really doing much... if anything at all

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #31 on: 2009-03-31 11:23:57 »
Finally made some progress with the palettes (still not quite right though)





I also implemented a very simple fragment shader that inverts colors, as a "proof of concept" :roll:



« Last Edit: 2009-05-21 14:19:00 by Aali »

Trenholm

  • *
  • Posts: 43
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #32 on: 2009-03-31 14:49:26 »
Good Stuff in this topic.  Good stuff.

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #33 on: 2009-03-31 15:21:53 »
4 main issues to take care of before I can make a proper, playable release :-)

1. even though I now have the palettes all sorted out, field files still look pretty crappy, things that should be transparent aren't and vice versa

2. battle models and other 3d objects

3. blend modes; this one is pretty tricky, getting the exact same (or atleast close enough) blending effects as dx5 _in the right places_ will require some serious digging into both FF7 and DX5 internals

4. in-game movies simply hang the game for now, for the first release I'll probably just skip them

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #34 on: 2009-03-31 16:19:05 »
Seems like we can cross #1 off that list :-D

« Last Edit: 2009-05-21 14:19:12 by Aali »

Hellbringer616

  • *
  • Posts: 1913
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #35 on: 2009-03-31 16:58:34 »
Wow this is amazing work, great job Aali, Keep it up! I'm pulling for a full working release soon  :-D

koral

  • Guest
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #36 on: 2009-03-31 17:10:02 »
Awesome!  :lol:
What's wrong with battle models? Is it something weird with the transforms?
(Correct) Blending will be a nightmare unfortunatly  :-(

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #37 on: 2009-03-31 17:44:39 »
The "problem" with battle models is simply that I haven't written that routine yet :-)
(As you can see, field models are missing, battles show menus and text, the rest is just black)

A lot of stuff happens in that routine that I don't fully understand yet but now that I have (pretty much) everything else sorted out, it should be easier.

Worst case scenario I'll just "borrow" most of it from the d3d driver :-) (I do that with some things already, for example, every transform goes through the original code to ensure its correct)

Marc

  • *
  • Posts: 445
  • I hear Voices ... in my head
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #38 on: 2009-03-31 21:18:43 »
I have to say I feel this is the most exciting new project to come out lately.

This project has the potential to dramatically improve the game if it pans out like planned.

Quick question though.  Wouldn't a fairly easy way to improve the background be to send them through a HQ4x shader à la pete's ogl2 fragment programs or something ?

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #39 on: 2009-03-31 23:11:49 »
If you modify the backgrounds, you have to do it properly (improve the picture as a whole, then re-cut it)

Otherwise you'll get all sorts of artifacts as the different layers bleed over into each other

Even linear filtering for textures (standard feature in opengl) has to be disabled for field to look good

Cyberman

  • *
  • Posts: 1572
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #40 on: 2009-04-01 02:20:23 »
If you modify the backgrounds, you have to do it properly (improve the picture as a whole, then re-cut it)

Otherwise you'll get all sorts of artifacts as the different layers bleed over into each other

Even linear filtering for textures (standard feature in opengl) has to be disabled for field to look good
It's the way Square constructed the scenes.  Basically they have some sort of software Z buffering technique and assign each layer a depth. This determines the ordering of what is drawn, 3d objects inclusive. The 2d objects are not drawn in 3d but 2d but are depth sorted as stated.  So things go something like "background" which I suppose has infinite depth in this case. Then sorted 3d objects (character people etc) with sprite objects and lastly foreground objects (IE infinitely close to the camera). 

Transparent objects (alpha blend objects) also exist but they are done in the foreground depth (overlaying things). You see this in area's like the wall market.
That being said, if you want hirez tile sets they must be an integer multiple of the original tileset just like the screen needs to be as well.
I'm not sure if it's possible to use 3d objects strected and depths to give perfect alignment at various resolutions.
(render the background to a texture and paste the texture on a surface which would have the effect of something akin to wolfienstien).

The only way to make improved backgrounds is as said before they must be cut from the same template coordinates, or integer multiple, as used before.


Cyb

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #41 on: 2009-04-01 14:02:25 »


Did I just get field models working? Well no, not really, that image was generated using a hardcoded matrix, positions are all wrong anywhere else :-P

But I have the rendering down, the savepoint rotates, the power soul shimmers etc :-)
« Last Edit: 2009-05-21 14:19:21 by Aali »

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #42 on: 2009-04-01 23:37:21 »
Got some VERY nice new screenshots :-)

This is actually a debug shader I use to determine z coordinates, but it makes for a cool effect; here odin going up against a dragon :-)


Normal battle, with menus hidden for extra impressive screenshots :-D





Now the bad news, sorting out z-coordinates (pun unintended) turned out to be really tricky, these new battle and field models are inconsistent with both the world map and field tiles, making it fit perfectly everywhere is going to be a b*tch.
« Last Edit: 2009-05-21 14:19:46 by Aali »

yoshi314

  • *
  • Posts: 318
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #43 on: 2009-04-02 07:05:18 »
i wonder where could frame animation interpolation be done. is it a resposibility of the graphics driver, or is it in the game exe, in case of ff7?

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #44 on: 2009-04-02 08:02:05 »
That's in the engine...

Aali

  • *
  • Posts: 1196
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #45 on: 2009-04-02 10:16:50 »
Indeed, the animation is already done before it hits the graphics driver, I get a bunch of .p groups and a set of matrices to transform them with, thats all.

Prince Lex

  • *
  • Posts: 882
  • Opinionfact is Redundancy
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #46 on: 2009-04-03 16:49:23 »
This would be a truly amazing addition to all the mods here... it opens up so many new possibilities!

Seriously... amazing progress. If this is released it'll be amazing!

Cupcake

  • And then it dawned on me, that Satan is also an old fuck.
  • *
  • Posts: 906
    • View Profile
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #47 on: 2009-04-04 02:52:05 »
ok, I have to ask,  how does your debug shader help determine Z-coordinates? the deeper the shade of red, the smaller the coordinate (or larger, whichever one means closer)

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Custom graphics driver for FF7/FF8 [v.1-.7.6]
« Reply #48 on: 2009-04-04 08:49:02 »
red = closer to the screen
yellow = further from the screen
black = Up against the screen

Aali

  • *
  • Posts: 1196
    • View Profile
split
« Reply #49 on: 2009-04-09 00:54:58 »
I recently discovered that FF7 has support for custom graphics drivers, with the right config it will load a dll and use that instead of its internal drivers (I also found the OpenGL driver, which works surprisingly well although its not really playable due to massive glitches)

So, my question is this, has anyone ever tried implementing a new graphics driver for FF7? I don't care if it worked or even displayed anything, any info you could provide would be great

I'm going to play around with it for a while, I have already mapped out parts of the direct3d driver and many of the internal structures in FF7 (including .tex, .tim and .p formats if anyone wants some info on that) but if we got some talented people together we could probably make a reasonably good OpenGL driver and never have to worry about poor DX5 compatibility again :-)

:EDIT:

Link to latest release: http://forums.qhimm.com/index.php?topic=8306.msg133947#msg133947
« Last Edit: 2010-06-09 18:24:21 by obesebear »