rebtd7/FF13Fix

Shadow rendering is slightly broken on PC

Closed this issue · 4 comments

This is once again another longstanding issue with XIII, and XIII-2 PC ports with the shadow rendering.

(First off I am sorry if I am incorrect with any of the guesses here as I am still learning about 3d graphics and have a long way to go.)

I am making a wild guess that the game is incorrectly calculating and casting shadows of alpha channel textures along with the other shadows on PC.
The PS3 and the Xbox 360 versions, calculates and renders the shadows by considering the alpha channel textures correctly, unlike on PC, where the alpha channel textures is not properly considered by the game's code making the shadows look glitched or blocky.

I am guessing this is the issue with the shadow rendering in XIII-2 as I have found certain posts on the steam community forums about this and sharing the same guess as mine:

https://steamcommunity.com/groups/ff-modding/discussions/19/1694920442949214472

This post has screenshots from the PC version and the Xbox 360 version. Notice the palm tree leaves not considered, while the shadow is cast.
https://steamcommunity.com/app/292140/discussions/0/620700960214645361/?ctp=13#c620700960725654917

https://steamcommunity.com/app/292140/discussions/0/620700960214645361/?ctp=32#c606068060823969268

Now I don't know if this applies to XIII-1 as well, but since both of them use the same engine and exhibit such blocky shadows I assumed it could be the same issue for this game as well. the shadows that is cast on the faces, during in game real time cutscenes and in normal game play shows off this blocky shadows.

Screenshots taken from the new Xbox one version and the PC version from a cut scene. I am comparing the Xbox one version as it graphically looks pretty good, and the visual differences are easily noticeable.
This one is taken from a youtube video from the new Xbox one version. the shadows look normal and soft.
https://imgur.com/N5siYaz

This screenshot is from the PC version, notice the small blob below the characters nose.
https://imgur.com/v7UyHZL

More screenshots with the shadows from the PC version during gameplay. the shadows cast on the character faces is quite noticeable and odd looking.
https://imgur.com/o99tl5X

https://imgur.com/UsTTcUN

This issue is still present even if you the game runs in 720p and with the 512 shadow resolution setting as well.
I have set the shadow resolution in my game launcher to 409x4096 as the highest 8192x8192 resolution does not give good shadows.
The higher 8192 resolution, fixes the jagged edges of the shadow and I am guessing again, increases the shadow density without adjusting the shadow's soft filter. Once again, the texture's alpha channel shadow is incorrectly calculated and rendered but with more density which makes it even more blocky.

Could you please look at this issue and try fixing it if possible ?

More info on the bug and its seems to be an issue with only XIII-2.

The game uses alpha textures to make an low poly mesh to exhibit details and shape, keeping the poly count low and easy for the GPU to render objects on screen per frame.
Now what seems to be happening with this bug is that the shadows are cast without taking whatever shape of the mesh that the alpha channel has created. instead the low poly mesh's shadows are cast.

Hope I have been a bit clear about this bug. Would be nice if you could fix this along with the surround sound bug that can be fixed with a compatibility mode toggle to windows 8. If you can see what exactly in the compatibility mode set to windows 8 that is fixing the surround sound on the game and incorporate that fix directly into the FF13 fix itself would be great.

It is present in FF 13 as well, specifically with lightning's hair. I haven't seen trees in the game yet but the screenshot on pcgamingwiki shows the issue with lightning's hair shadow (her hair also uses alpha textures to exhibit details)
https://www.pcgamingwiki.com/wiki/Final_Fantasy_XIII#Shadows_appear_pixelated.2C_jagged_and_blocky

It is present in FF 13 as well, specifically with lightning's hair. I haven't seen trees in the game yet but the screenshot on pcgamingwiki shows the issue with lightning's hair shadow (her hair also uses alpha textures to exhibit details)
https://www.pcgamingwiki.com/wiki/Final_Fantasy_XIII#Shadows_appear_pixelated.2C_jagged_and_blocky

I mistook this for the alpha channel issue and later found in archylte steppe area of the first game that the shadows cast by such trees and other objects do look fine.

those jagged looking shadows and that small blocky looking effect on character face present in the PC version can be due to the lack of a proper shadow filter which is present in the console versions, but doesn't seem to work in the PC version.
Either square enix removed it due to them going with a different shadow rendering system on the PC port or that filter is present in the code but doesn't work for some reason. its the same with XIII-2 and that has this alpha channel bug.

First off I am very sorry @rebtd7, @Nucleoprotein and @suyash691 for opening this issue. I am closing it now as I was wrong about the whole shadow rendering part.

After speaking to some modders, I now have an much better understanding of the shadow bug and as it turns out it only affects 13-2. I will be opening another issue in which I will try my best to explain this bug as clearly as I can.

Once again I apologize for this mistake of mine.