Lighting without shadows

What’s the expected behavior when the render has lighting, but shadows are disabled?

I would expect that the particles that would normally be in shadow will be lit as if there is no attenuation between them and the light. But that’s not what appears to be happening.

If you disable shadows for a light, then occlusion meshes will not case shadows for that light. This works the same as KMX.

What are you experiencing? What effect are you looking to achieve?

That’s not what I was expecting, nor what I was seeing. :slight_smile:

It looks like the shadows get sharper, which is very odd.

I was expecting that the shading would be calculated, but the attenuation would be zero.

I think I understand what you’re seeing. And there may be a little bit of confusion regarding the parameter naming.

The “light” class has these two member function:

void enable_shadow_map( bool enableShadowMap )
void set_shadow_map_width( int width )

-Disabling the shadow map with “enable_shadow_map” does not turn off attenuation. It only affects shadows from occlusion meshes. There will always be light attenuation though the particles.
-The “set_shadow_map_width” is used for BOTH the attenuation maps, and the geometry shadow maps. This parameter defaults to 512. In order to get the same look from a light, you will need to set this parameter consistently regardless of whether “enable_shadow_map” is on. The naming is confusing, I know. I should rename it to “Light Resolution” or something.

Do the images rendered in “ShadowCompare.jpg” have the same light::set_shadow_map_width parameter?

Ah. That makes sense. So if my attenuation map was 512, they’d have matched.

Ok, so now that we’ve cleared that up, a possible workaround to make what I was expecting would be to set the lighting pass density to be 0. This appears to be a means to generate a “shadow pass”. I haven’t checked the hair shaders, but it seems to work fine with the others.

I don’t think it needs to be renamed, but the description is wrong, as it doesn’t mention that it’s used for both…

/// @param width Used internally when rendering meshes for matte objects. This is the resolution of the resulting z-depth render. Defaults to 512. void set_shadow_map_width( int width );

Good point. The docs have been updated. Thanks Chad!

Privacy | Site terms | Cookie preferences