Issue with Shadow Rendering

Im having issues with my shadow rendering.
I am using Forward rendering, soft shadows.

Shadows

Anyone know the cause?

4 Answers

4

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 zooming 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.)

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.) Cramming 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.

It's nothing to do with size. I tried all sizes. :-(

Try to increase the “Bias” parameter of your ambient light to 0.2 (instead of 0).
To near it might create this effect.

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 :slight_smile: