Flags “Cast Shadow” in static meshes’ lod 0 sections don’t work properly with Contact Shadows.
Contact Shadow is considered a Primitive property, and is not influenced by sections properties (maybe due to GetPrimitive_PerObjectGBufferData in shader files).
Steps to Reproduce
Disable “Cast Shadow” on a static mesh’s sections. Look at Contact Shadow.
Hello,
Thank you for reaching out.
I am assigning your issue to another team member so they can help you.
Hi there,
I have been unable to reproduce the issue that you have described. In the screen capture below I have a simple scene with a point light with a contact shadow length of 0.1 .
[Image Removed]
The capture shows the ‘contact shadow’ checkbox and the ‘cast shadow’ checkbox behaving as intended. This may mean that I have missed something or may not have performed the correct steps in order to present the issue. Can you please update this case with detailed steps to reproduce or a minimal project that showcases the issue.
Many thanks.
Hi,
Thank for providing the project files and a further explanation of the problem. Apologies if I had indeed missed the project files the first time around.
I have successfully reproduced the described issue and I believe the contact shadow not respecting the shadow state set in the material LOD section may be a bug ( e.g if all sections LOD sections have ‘cast shadow’ disabled, the contact shadow probably shouldn’t render ).
However, separate contact shadows for individual LOD sections may not be a supported feature at this time. One way to think about it could be that the ‘main’ shadow configuration is set in the Level editor and some tuning options are present in the Static Mesh Editor.
Another options to mitigate this, if you did want separate contact shadows, might be to split out the LOD sections into separate objects, if these objects share the same material it should incur a minimal rendering overhead.
I have sent off a bug report to Epic, you can monitor progress at this link when the bug becomes publicly available.
Are you sure that there is no project attached to this issue? I can see it in my uploaded files. Maybe I didn’t link it properly. Here it is again.
More on the reprostep: leave Contact Shadow enabled on your component, but disable “Cast Shadow” flag on one or more LOD 0 sections in the static mesh editor. As you can see in the attached project, a contact shadow enable component with all lod 0 sections cast shadow flags disable, will continue to have contact shadow.
So, there is no way to disable contact shadow just on one lod 0 section either.
Contact shadows are often used as cheap substitutes for cast shadows for small objects that would be impractical to draw with cascading shadow maps. Thus it is important for them to be available to activate even shadow casting is turned off.
However, I agree that there should be a way to toggle contact shadows on a per-LOD basis.