Yoshgunn / LightShadowThrowaway

This repository holds the Unity Project for the throwaway version of the Light/Shadow game. This does not reflect the final state of the game. All features, code and art assets are completely subject to change.
GNU General Public License v3.0
2 stars 0 forks source link

Shadow Striping #48

Open Jacquies opened 9 years ago

Jacquies commented 9 years ago

When the light hits a wall with a low angle of incidence, there is a 'striping' effect, where there are vertical stripes of shadow on the wall even though there shouldn't be. It's pretty ugly...

Jacquies commented 9 years ago

This is caused by the object casting a shadow ON ITSELF.

It's a really weird phenomenon, but it's like this: since the light is almost perpendicular to the object, once it gets close enough, it decides that the light has hit the object (even though there's more object behind it to hit), so it casts a shadow on itself.

We can fix this issue by creating a slightly smaller (like 99% as big) copy of the object in the exact same spot. We then set 'Cast Shadows' on the renderer of the original object to 'No', and set it to 'Shadows Only' on the smaller one. The difference in size should be imperceptible.

This is a really annoying workaround (because we'll have twice as many renderers), so I'll see if I can find some way to fix this (I only thought of this because all of the comments I found about it online said that it couldn't really be fixed natively in Unity).

Jacquies commented 9 years ago

If we have to use this workaround, this would be a great place to use editor scripts...