Skip to main content
gamedev.net
🔒 Locked

Cubic Shadowmapping at Glancing Angles

Started by Geometrian Jun 12, 2010 at 6:37 PM 3 replies 650+ views
Original Post
Geometrian
Geometrian
Hi,

So, I thought my cubic shadowmapping was working properly, but after some testing, I found that there's actually sometimes a problem when looking at glancing angles. Not all glancing angles cause the problem.

As an example:

The shadow cast by the cube is wrong. Rotating the scene slightly fixes the problem.

I tried anisotropic filtering just on spec, but it doesn't make much (if any) difference.

Any ideas as to what might be causing this issue?

Thanks,
-G
[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]
Ashaman73
Ashaman73
Quote:
Original post by Geometrian
Any ideas as to what might be causing this issue?


I would guess that this is a self-shadowing error (shadow acne). Take a look at this link to get a better understanding of the problem and some options to get rid of it.
Geometrian
Geometrian
Thanks, but unfortunately, there are no such artifacts. The frusta are already quite tightly bounding, and there's already a small offset.

The shadow of the cube is normally just as correct as those of the other five objects. It's only at glancing angles (and it seems, only with this object) that the shadow is incorrect.

Also, the problem only occurs at glancing angles, and changes with the camera's motion (which in my case is completely separate from the light's frusta).

-G
[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]
Ashaman73
Ashaman73
Quote:
Original post by Geometrian
Thanks, but unfortunately, there are no such artifacts. The frusta are already quite tightly bounding, and there's already a small offset.

The shadow of the cube is normally just as correct as those of the other five objects. It's only at glancing angles (and it seems, only with this object) that the shadow is incorrect.

Also, the problem only occurs at glancing angles, and changes with the camera's motion (which in my case is completely separate from the light's frusta).

-G

What offset are you using ? Only in z direction ? Ther could be still an issue with shadow acne at glancing angles if you only apply your offset along the view axis.

For testing purpose, try to switch the culling of front/back when rendering your shadowmaps.
Geometrian
Geometrian
Hi,

I hadn't thought of the offset being along the view direction; so that's a good thing to check. However, the offset is added with glPolygonOffset(...) as the cubemap is updated. It appears I'm in a good habit. Increasing the offset reduces the artifacts, although not entirely eliminating them.

There's no culling of any of the faces as the cubemap is updated, but I'm not sure how that would be the problem. I suppose that if only the front (outer) faces of the box were the only things drawn, then the problem would disappear, because none of the box's faces would be rendered.

In fact, I've found that if the box receiver is not included in the cubemap rendering (so it doesn't cast shadows; it can only receive them), the issue disappears. Evidently the problem has to do with self-shadowing on the box.

-G
[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.