-
Notifications
You must be signed in to change notification settings - Fork 3
Fog and some SA_ONE or DA_DST models not blending correctly #5
Comments
Comparing the second and fourth screenshots, the distant light shaft looks correct, just with correct self-blending. I'm really not sure why the nearer one changes at all in vanilla, to be honest. It shouldn't do that with |
Maybe it's something like the |
OIT does indeed blend all of the model's faces, front and back (which isn't to say a single face gets blended with itself; that would be weird). Since SADX loads all of its vertex data incorrectly, enabling culling isn't an option unless all the vertex loading functions are rewritten. Writing to the depth buffer would solve this issue in vanilla, but even in those screenshots above it's not working correctly if that's what they're supposed to be doing. The last two screenshots shows the back faces rendering... for the most part. OIT just fills in the missing gaps there. It still doesn't explain why the closer ones are so much more transparent in vanilla, though. |
Here are a couple screens from the DC version just in case I noticed one thing though, it looks like the "front" side (which covers the area in the center) is rendered with the correct opacity, but the remaining three sides are too bright. There's also some weird stuff going on with the "front" side changing suddenly depending on camera position: |
That would make sense, now that I think about it. Transparent fragments for OIT are stored after fog is applied. In this case, it causes to surfaces influenced by fog to blend together, causing the overly bright result. |
This "side effect" would be nice to have for stuff with SA_ONE blending, which apparently applies fog before blending the color. E.g. Sonic's spindash trail, electric shield. |
The issue is back with the latest generic build, and it seems that SA_ONE/DA_ONE is also affected. |
In SA1, the object Rlight uses a material that has NJD_SA_SRC and NJD_DA_DST. This makes the light more opaque when you're far away from it, and more transparent when you get closer. With OIT it blends incorrectly:
Without OIT it looks like this, which is correct apart from self-blending artifacts:
Here's a DLL that has SA_SRC and DA_DST enabled for this model: https://dcmods.unreliable.network/owncloud/data/PiKeyAr/files/Various/lwselfblend.7z
The text was updated successfully, but these errors were encountered: