It seems like raytracing does not check if meshes are set to cast shadows ‘2-sided’ and will only do the one.
If so can this be changed?
Only the path tracer does not “care” about if a plane for example has a double sided material or not, it will cast a shadow regardless.
However, when using real-time ray traced shadows (even “normal” shadow map), it matters; A plane that is not double sided with its normal facing away from the source of light will not cast any shadows.
I just double checked with the 4 types of light and on the latest version it is working correctly.
What HDRP version are you using if you still don’t have this correct behavior ?
A 1-sided plane facing away from a light should still cast a shadow if Lighting-CastShadows-TwoSided set on the mesh. This works with shadow-mapping.
It does not happen for Screen Space, Ray traced, Shadows. e.g. place a vertical quad, with the 2 sided shadow setting on, in way of a light and the visible side will cast a shadow, rotate 180 and it will not for fully ray-traced shadows
Seeing in all versions - latest 2020.1/HDRP8 and beta 2020.2
if not ray-traced or not screen-space ticked then shadows ok
I took a look and I misunderstood your issue, sorry.
I thought you were talking about the double sided option in the material.
Indeed, ray traced shadows ignores the parameter “Cast Shadows : Two sided” in the Mesh Renderer component parameters. It’s expected and by design.
The reasoning behind that choice is that we either want to use double sided for all ray traced effects or no ray traced effect. It can become confusing when double sided is used only for ray traced shadows but for not for other ray traced effect. For that reason, ray tracing effects get the double sided information only from the double sided checkbox in the material properties, not in the mesh renderer lighting properties.
OK it is just a break from every other mode, that is all, and does cause issues.
There are reasons for using “Cast Shadows : Two sided” like cut-throughs of interiors, perhaps a shader-based alternative would allow blocking light but not drawing on the back-face?
I admit that I’m not a fan of non-coherent behavior between rasterization and raytracing.
Out of my head I can think of two simple not shader based solution,
- One would be to duplicate your geometry in place, assign a very simple Unlit double sided material, puting it in another layer and culling it with camera culling mask.
- If you don’t want to work with layers, you can also, do the same but instead of setting a layer, you can set the second geometry to lighting > casting shadow : shadows only