lilxyzw / lilToon

Feature-rich shaders for avatars
MIT License
930 stars 95 forks source link

Check for UV Discard in vert before lighting/post-proc effects #186

Closed nullstalgia closed 4 months ago

nullstalgia commented 4 months ago

Closes #179

I saw the issue and decided to give a quick shot at fixing it. Seems like the "Fog and Lighting" section was causing it. Since we're discarding the vertex anyway, it didn't seem prudent to keep that.

(Frankly, we could move UV Discard and even ID Mask further up, potentially near Invisible, to avoid performing unneeded calculations that will be discarded anyway. Would like to hear your thoughts on it!)

The change did not seem to be needed on the Fur shader, but I moved it to preserve parity. Let me know if I should revert that.

EDIT: Oops! I didn't check dev before the switch! My bad! 🙇

nullstalgia commented 4 months ago

Further testing revealed that the offending pass is LIL_TRANSFER_SHADOW_CASTER

Which also explains why the fur was unaffected, as there is no SHADOW_CASTER present!

lilxyzw commented 4 months ago

Thanks!