Shadow corner problem

Hi

For a while i have been wondering why the shadows in Rhino are always creating the same bug, or perhaps there is some settings i need to correct. As you can see on the Image that i have attached there is a problem with the cast shadow right around the corner of the geometry.
Different size geometries can create different variants of the same problem, but its unclear to me where it originates from.
Could anybody shed light on this issue?

which light settings are you using, also which display mode are you using?

i can indeed see that effect, in rendered mode with default light,

when i skew one corner a bit the effect goes away, it does not seem to be related to any corner afaics.

Hi,
Thanks for the swift response, and sorry for my late answer

I tried fiddleling with all my light and shadow settings but without any luck. I also tried what you suggested here but i am not sure I get what you are saying. Or at least i am not getting any corrects by moving or rotating any afaics. Perhaps i am doing something wrong.

best e

Without seeing your actual file/example, I’m guessing this is just the self-shadowing biasing going on.

Shadows in Rhino are achieved by what is known as “Shadow Mapping”… I’m not going to go into a long discussion on what that is, or even how it works… But the method was chosen because it was better than all the other alternatives, given what Rhino’s Rendered viewport and scene can support.

One of the cons of Shadow Mapping is called “self-shadowing”, where an object creates data in the shadow map, and then when that map gets applied to the overall scene, it gets applied to the actual object that created it, thus, causing the object to always be in its own shadow. Note: This is not the same thing as an object casting a shadow onto itself.

Long story short… To get around this drawback, the object is “biased” away from the light source when producing the shadow map data, so that when the final depth comparison occurs, the object’s depth ends up being slightly less than the shadow depth…thereby keeping it out of its own shadow. The problem with that is that it can cause shadows to drift away from sharp edges and/or boundaries, depending on how large the bias value is. That’s just how things work… And it can get compounded even more depending on the overall scene and the camera’s near/far clipping planes, since those can impact the precision of the depth buffer…which in turn can/will impact any/all depth comparisons.

To help mitigate most of this, there is a “Self Shadowing Artifacts” setting in the “Shadows” section for each display mode. Moving the slider to the left (towards “Dirty”), will pull the object’s shadow closer to itself, while moving it to the right (towards “Cleaner”) will push the object’s shadow further away. If you slide it all the way to the left, then that’s going to give no biasing at all, and in most cases, your objects will all turn black, a shade of gray, or speckled (or combinations of all).

There is no magic setting or fix for this, given the current techniques being used. If you want perfect shadows, use Raytraced mode, or some other renderer/raytracer.

We’re always tuning things up, and we may even move away from shadow-mapping in general, but just know, that achieving real-time shadows, for unlimited light sources, consisting of multiple light types (i.e. Directional, Spot, Omni, etc), comes at a cost of not producing perfect results.

-Jeff

3 Likes

Hey Jeff,

Thank you so much for the extensive reply, it was truly helpful and yes the “dirty” alteration did indeed, create a more accurate display.

I hope this post can be of use to future shadow enthusiasts.