VOGONS


Fog issue in FFXI

Topic actions

Reply 21 of 38, by Maestrobob

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-02-17, 10:38:

Thanks! I've just sent you a PM.

Got your PM, but can't reply to it...

I am unable to capture FFXI within RenderDoc since the PlayOnline frontend is required to launch the game, and that relies solely on DirectDraw to render. As far as I know, there is no way to launch FFXI from outside of PlayOnline. I'm thinking I would also need a RenderDoc compatible DDraw.dll as well... not sure if that's possible or if it would even work.

I was able create a level 2 DebugView++ log using release 79.3
The log begins just before the D3D session is created. I logged directly into my character which was in the zone with fog, made sure all assets were loaded, then did a /shutdown to logout and close the session.

It's hosted here on my gdrive - https://bit.ly/3YEyGJW

Reply 23 of 38, by Maestrobob

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-02-19, 09:46:

Thanks! I've sent you another PM to see what extra things could be tried.

Thanks, Dege! The new .dlls worked with RD. Initially I got the same injection error when launching pol.exe, but switched to the nightly RD build and bam. Worked perfectly.

Here's the RD capture.

Also, using the crosire d3d8 -> dgvoodoo d3d9 chain resulted in the fog being rendered correctly.

Reply 25 of 38, by Maestrobob

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-02-20, 18:12:

Thanks!!

So, I changed the code that I suspect causing the problem. Could you plz test this D3D8 version?

http://dege.fw.hu/temp/dgVoodooWIP89.4_FFXItest.zip

Beautiful stuff, Dege! Looks like you nailed it.

Thank you so much for your work on this.

Attachments

Reply 28 of 38, by djc5166

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-01-20, 18:51:
Maestrobob wrote on 2022-12-06, 07:18:

Hi Dege, I've been following this issue on and off for quite some time checking back occasionally to see if there's been any improvement.

I saw the recent build which fixed vertex fog in PSOBB in 2.79.3 and though it might resolve the fog in FFXI as well, however it is still incorrect.

It's interesting to see that some objects in the scene appear like they are "fogged" properly, while others are completely not at all.

I'm in to look into this long standing bug, as djc5166 is kindly offering me his account. But I don't have a clue how to get to the problematic location.
Is it easy to get there by some repro-steps?

Sorry I guess I wasn't really checking this forum lately. I can either let you use my retail account or private server account if you still need it. I don't think the rendering would be any different between them. I can just log out in that area.

EDIT: Sounds like you figured it out anyways.

Reply 29 of 38, by El-Neko

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-02-20, 18:12:

Thanks!!

So, I changed the code that I suspect causing the problem. Could you plz test this D3D8 version?

http://dege.fw.hu/temp/dgVoodooWIP89.4_FFXItest.zip

Had to make a account and say thank you for fixing the fog issue. Tested it on HorizonXI and it works fine and now I can use dgVoodoo full time for FFXI now.

Attachments

Reply 30 of 38, by Atomic Skull

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-02-20, 18:12:

Thanks!!

So, I changed the code that I suspect causing the problem. Could you plz test this D3D8 version?

http://dege.fw.hu/temp/dgVoodooWIP89.4_FFXItest.zip

What was causing the problem?

Reply 32 of 38, by Atomic Skull

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-03-27, 18:29:

Some unnecessary fog "post-processing" in a shader.

Was that something FFXI was actually doing or an artifact/bug of the wrapper converting shaders? If it's something FFXI actually does then I wonder how much other unnecessary crap it does and if that's the cause of the performance not scaling proportionally with modern GPUs?

I wonder if FFXI is doing some unnecessary thing with the shadows because that has always had a massive performance penalty on FFXI far more than it actually should.

Forced MSAA slows things way down, you'll want to keep using the supersampling trick with FFXI (setting the rendering resolution 2x the window size) as this is way faster even than 2x MSAA on this game. Interestingly turning shadows off mostly fixes this.

Reply 33 of 38, by Dege

User metadata
Rank l33t
Rank
l33t
Atomic Skull wrote on 2023-03-28, 04:43:

Was that something FFXI was actually doing or an artifact/bug of the wrapper converting shaders?

No, it's a bug of converting the shaders, on the wrapper side.

But the DX8-fog saga is continuing, in the meantime I noticed that by fixing it for FFXI, I also broke Soul Reaver 2 with dgV 2.8. It renders exactly the same bad way as natively.
Looking into it all again, it seems there is a difference between DX8.0 and DX8.1 fogging (Soul Reaver 2 is DX8.0, FFXI is 8.1), the DX docs is unclear about that and my guess is that MS broke DX8.0 with Vista WDDM.
So, what I've just removed from the converted shaders is needed for DX8.0, I'll put it back (only for "feature level" DX8.0).

Atomic Skull wrote on 2023-03-28, 04:43:

If it's something FFXI actually does then I wonder how much other unnecessary crap it does and if that's the cause of the performance not scaling proportionally with modern GPUs?

Then the game probably CPU-limited (too much Draw calls or other internal logic), try the game with uncapped fps and see if the GPU usage is near 90% or above. If not, then I think it's CPU-limited.

Atomic Skull wrote on 2023-03-28, 04:43:

EDIT: So from running Vanabench 3 (FFXI benchmark program) phong shading slows everything down, fast video memory access slows things down, DirectX 11 / feature level 10.0 gives best performance essentially the same as with no wrapper. DirectX 11 is slightly slower and DirectX 12 slightly slower than 11 though without a benchmark you'd never notice this, the benchmark scores are something like 9200 / 9050 / 8900

Thanks for the benchmark, it's interesting because the only difference between DX10.0 and 11.0 in dgV is the feature level passed to the DX11 runtime + some internal checking for DX10.0 limitations, IIRC. So, I would expect no difference in the results. DX12 on the other side, well, it can be slower for "short / empty" frames, I don't know what the benchmark renders (cpu/gpu limit).

Atomic Skull wrote on 2023-03-28, 04:43:

Forced MSAA slows things way down, you'll want to keep using the supersampling trick with FFXI (setting the rendering resolution 2x the window size) as this is way faster even than 2x MSAA on this game.

I guess it is a built-in feature FFXI, not the one from dgV presentation (which works only in fullscreen).

Reply 34 of 38, by Atomic Skull

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-03-28, 13:17:

I guess it is a built-in feature FFXI, not the one from dgV presentation (which works only in fullscreen).

It's basically a hack of sorts that eventually got officially supported by the developers years later. The registry settings allow for the rendering resolution, the UI overlay and the actual presentation resolution to all be set seperatly. People discovered you could set the rendering resolution higher than the presentation resolution and the game would render at e.g. 2048x1440 and then downsample to 1024x768. The UI size relative to the screen size can also be adjusted this way so you can run the game at much higher resolutions than originally intended without it being unusable small.

In later years FFXI had these settings accessible directly from the config program. But originally there were only three options for rendering resolution low (256x256) medium (512x512) and high (1024x1024) with the presentation resolution being whatever full screen modes the video card offered. So the first thing people started doing was matching the rendering resolution to the presentation resolution by editing the registry settings directly, then they figured out supersampling was possible later as video cards started getting more powerful.

Back in the day with my Geforce 3 ti200 I would run FFXI in 800x600 and match the rendering resolution to the screen resolution, this was a win-win as the game both looked better than the "high" setting this way and performed better too.

Forced MSAA has some sort of interaction with shadows in FFXI that really kills performance. No idea why this is but it's so bad that brute force supersampling (rendering the screen at 2x the display resolution and then downsampling) is actually faster. (ffxi has three options for shadows, off, a projection shadow for you and blob shadows for everyone else, or projection shadows for everyone)

I recall that originally projection shadows were half the resolution they are now (same resolution as the PS2 version shadows) about a year into the game they doubled the resolution of projection shadows on the PC version and that introduced performance issues with the "full" shadow mode. Even today in very congested areas full shadows can cause framerate and lag problems.

Reply 35 of 38, by Atomic Skull

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-03-28, 13:17:

Then the game probably CPU-limited (too much Draw calls or other internal logic), try the game with uncapped fps and see if the GPU usage is near 90% or above. If not, then I think it's CPU-limited.

Tried that and yeah 350+ FPS and like 20% GPU usage. That's actually dangerous to do when playing on SE's servers if you move or do anything but pan the camera around your character would move much faster than they are supposed to which would then set off alarms calling the GMs attention so I do not recommend this with the official servers.

Reply 36 of 38, by maxtherabbit

User metadata
Rank l33t
Rank
l33t
Atomic Skull wrote on 2023-04-01, 07:38:
Dege wrote on 2023-03-28, 13:17:

Then the game probably CPU-limited (too much Draw calls or other internal logic), try the game with uncapped fps and see if the GPU usage is near 90% or above. If not, then I think it's CPU-limited.

Tried that and yeah 350+ FPS and like 20% GPU usage. That's actually dangerous to do when playing on SE's servers if you move or do anything but pan the camera around your character would move much faster than they are supposed to which would then set off alarms calling the GMs attention so I do not recommend this with the official servers.

I've tried uncapping the FPS before and it didn't affect my movement speed

Reply 38 of 38, by djc5166

User metadata
Rank Newbie
Rank
Newbie
Dege wrote on 2023-04-04, 20:16:

Ok, so the game is cpu-limited.

I think XI was pretty notoriously single threaded and cpu-limited, even for its time. High shadows and bard song transparencies were a huge fps killer back in the day IIRC.