Shadow moire artifacts

At first I just assumed I was doing something wrong because I’m new to Unity, but after spending some time with it I still have no idea what the problem is here. Is it just me, or are other people having the same problem? I get this on my MacBook (GeForce 9400M) and my iMac (GeForce 8800 GS).

I’ve tried:

  • Changing between soft and hard shadows. The soft shadows have the same problem, it’s just blurry.
  • Adjusting Range, Angle, and Strength. Doesn’t seem to effect it at all, except for really huge range/angle values.
  • Adjusting Resolution. No effect, just a different pattern.
  • Adjusting Bias. Bias can sometimes be tweaked to fix a specific shadow on a specific surface, but as soon as either object is moved or rotated, the problem returns. And if the light effects multiple surfaces, bias doesn’t really help.

Directional lights have a similar problem, but bias is much more effective in that case.

I have a similar problem with point light shadows - the shadows have spotty concentric circles.

What am I doing wrong?

I have no idea, but I’d check Quality Settings to make sure everything is OK there.

I’ve just described similar problem (http://forum.unity3d.com/viewtopic.php?p=131331), but my happens only when running build in Win web player (no moire on Mac).

Maybe they’re somehow related but we’ll have to wait for some advice from the Elders. :slight_smile:

The point light bug is clearly visible in the apartment “Shadow Demo” project.

If I take that same light and make it a spot, this is what I get. Completely unusable.

I’d guess there’s a bug with the way the UV coordinates are generated. Notice that in the last screenshot I posted, the triangles that are nearest to the light don’t have a problem.

I tried using a cookie that was set to use aniso filtering, but the shadow doesn’t change at all. Maybe the cookie just need to have filtering enabled?

I have this exact same problem using point lights. If the light gets too close to a wall or whatever I get strange artefacts projected onto them. If I disable shadows for the said light they go away.

They’re like rings expanding outwards with different radii, how do you get rid of them? I’ve tried altering the settings but none of the configurations I’ve tried so far work.

I have noticed this also in the case of a light getting too close to a surface. Thinking about it logically, a surface this close to a light source does not need to receive shadows, so I just switched the object to cast only and moved on.

I added this comment to the fogbugz record, but I’ll add it here too. I really hope I’m not just making an ass of myself here… :?

D3DRS_SLOPESCALEDEPTHBIAS? I’m not sure about the GL equivalent. If this is already being used correctly then I guess I’ll just resign myself to either being generally weird in my development process, or being the only one who cares about this. I dunno. I’m just disappointed. :frowning:

That’s great unless your light source or object moves due to AI or player control.

@BananaRaffle
Thanks for the great info, and your suggestions. We definitely have to look into this. Did you report the bug through the bug reporter?

Just for the record, I’ve PM’d fursund with the details. Thanks fursund!

Unity renders depth into a floating point render texture on D3D. This makes hardware depth bias “not do anything” in effect. We used to have slope depth bias on OpenGL, but removed that for sake of consistency (people would create games on Mac, only to discover shadow artifacts on Windows).

And thank you Aras! I didn’t think I was telling you anything new. :wink: I’m confused by the gl vs d3d statement, but I don’t really need a detailed explanation. I also don’t mean to be persistent. You replied to me in a different thread and I was content with that. There was just a recent thread where this issue came up from someone else… and it was said that shadows work fine if you mess with near/far, bias, etc… so I posted a short aside referencing this thread with a plea for help to that person. That’s the only reason I bumped it again.

If it is just me being dumb then I’d be happy to be corrected, but so far no one is willing and able to set me straight. If it’s just a bug then no biggie - bugs happen. If it’s something that just not going to change for whatever reason, then I’d like to know about it so I don’t proceed under the assumption that someday it will work the way I expect.

In any case, I’m happy that the issue is on the UT radar and I’ll stop bringing it up for a while. :slight_smile:

Was there a solution for this?

I now have moire effects on shadows and cant find how to solve it.

Cheers
Anim
Unity Pro 3.0, Windows 7 - 64 Bit, 1GB GeForce 9800 GT

Same

It doesn’t seem like this was ever logged as a bug. Please can you file a report for it (menu: Help > Report A Bug).