- Home /
Issue with Shadow Rendering
Im having issues with my shadow rendering. I am using Forward rendering, soft shadows.
Anyone know the cause?
Answer by Owen-Reynolds · Apr 29, 2013 at 01:33 AM
In general, that sort of "Moire pattern" is usually caused by a much, much too small texture (like several full tiles over each pixel.) Especially if it squirms around as you move the camera.
What would cause this? The terrain texture is 15x15 tiled...
I don't know forward rendering, but are there any other texture sizes (the shadow texture) you can increase? Try making a 1x1 cube and zoo$$anonymous$$g in, maybe you're super-far away (but the starting 15x15 ground texture size is going to go to the base map well before it breaks up.)
Answer by Prophet93 · Apr 29, 2013 at 05:45 AM
As Owen said above me. It does look like the texture is far too small that's why it's giving off that kind of square blocking effect. Try increasing the texture size. If that doesn't work you might need to recreate the texture larger, or find a new one
The texture size is 1024x1024, and I've tried many other textures.
For some reason, after I restarted Unity it got much better and you can only see this effect a little, but it still exists slightly.
A too-large actual texture is another culprit (sort of the opposite of a too-small screen area.) Cram$$anonymous$$g 1024 texture pixels into only 20 or so screen pixels "randomly" picks 20 of them to use. But, mip-mapping (which is normally turned on) prevents this (by pre-building a 32x32 texture.)
Even so, might try with a smaller texture size (like a 16x16 cursor texture just lying around) just to rule out size.
Answer by lazalong · Oct 01, 2013 at 09:09 AM
Try to increase the "Bias" parameter of your ambient light to 0.2 (instead of 0). To near it might create this effect.
Answer by GambinoInd · Oct 01, 2013 at 09:11 AM
It turns out is was due to being too far from the origin (in the upper 30,000 range). With deferred lighting and sometimes forward, when far from the origin shadows would shake.
You need to move closer to the origin! That was the issue :-)
Your answer
Follow this Question
Related Questions
Shadow artifact... forward mode 3 Answers
Point light shadows in forward rendering. 1 Answer
Baked + Real-Time Shadows 6 Answers
Modifying scripts during run-time 2 Answers