Memoria
Memoria copied to clipboard
Transparency of foreground pixels ignored by 3D objects
Background alpha is working correctly between background layers (so I can have soft edges between foreground and scrolling sky for example) but if a layer is on top of a 3D object, it will appear as alpha 1 or 0, never in between.
In the same way anti-aliasing turned out to be an easy feature, maybe this is fixable as well?
A good example here
Alpha on the jar is partially transparent, showing parts of the layer under, but never a 3D object. If someone is knowledgeable in shaders...
@SamsamTS, Tsuna mentioned that you might know some things about this? This has been itching me since I began working on the mod.
Hey @snouz Tsuna brought me here. I don't have direct experience with Unity shaders but I might try to help you on the general concept. But before doing that, would you be so kind pointing me where can I find the shader code ( if any around ) and where the shader logic is applied for those specific cases? Thanks :)
@julianxhokaxhiu There is this https://github.com/Albeoris/Memoria/tree/main/Memoria.Patcher/StreamingAssets/Shaders Unsure if it's of any help.
The shaders used for field objects are mainly:
- PSX/FieldMapActor for the 3D models of the characters,
-
PSX/FieldMap_Abr_None for the backgrounds (there are also other
Abr
shaders used, in particular theFieldMap_Abr_1
for most semi-transparent background layers, like lights, but I thinkAbr_None
is what is involved in all those problems anyway as it originally wasn't meant to handle gradual transparency at all).
Also, it might help to look at my C# code in FieldCreatorScene because it's a relatively compact class that handles the rendering of the fields, with much fewer subtleties than the usual in-game machinery.
In particular, it setups the parameters _OffsetX
, _OffsetY
, _MatrixRT
etc. that are used in the shader's code.
Thanks a lot for the comments. I'll try to run some investigations here and I'll let you know my findings :) Is this a core issue or happening only with Memoria installed? If the latter, which version can I use to test? latest is good? Also can you please provide a save game where I can repro the scene above?
Thanks for looking at this! Here are saves for the whole game: SavedData_ww.zip You can see this happening all through the game, here's the same example from vanilla: You can see it happening, because instead of having pixels from the model, we have pixels from the underlayer in green In fact you can even see the scrolling: And since there are no grey alpha pixels in vanilla, this is actually a result of the smoothing between black and white alpha pixels that become grey at the display level.
I don't know much about the issue, only that the result of my work is greatly reduced by this limitation. whether I leave grey alpha or limit myself to 2 colors, it will look like shit at the limit with models.
Thanks a lot @snouz I'll investigate and come back to you
So I did try to start looking into this, thank you very much for the save game. Have you got experience using RenderDoc on top of FF9? I did try and so far I'm not able to make it work, it seems to not detected the rendering API somehow. I wanted to start from there as it's amazing way to look at what the GPU is doing.
I did try with the vanilla installation, but let me know. I'll try also with Memoria just in case, but this is where I am so far. I'll keep you posted.