Geometry Collection Components with GeometryCollectionRootProxyRenderer and GeometryCollectionISMPoolRenderer cannot have "Cast Shadows" turned off

Hello!

In UE 5.8, I’ve observed an issue with Geometry Collection Components. As I understand it, by default, the GC asset when created will use the GeometryCollectionRootProxyRenderer, but this can be overridden in the blueprint GCC.

If you don’t override the renderer and leave it to use GeometryCollectionRootProxyRenderer, when you attempt to turn off “Cast Shadows” on the component, the object still casts shadows. I’ve confirmed this is also an issue in GeometryCollectionISMPoolRenderer. If you set the custom renderer to “None” however, this issue doesn’t occur.

I’ve found a fix for GeometryCollectionRootProxyRenderer, which is the following:

void UGeometryCollectionRootProxyRenderer::CreateRootProxyComponents(UGeometryCollectionComponent& InComponent)
{
....
Line 83
MeshComponent->SetCastShadow(InComponent.CastShadow);
}

This resolves the issue.

For the GeometryCollectionISMPoolRenderer, the fix is a bit more involved, but it’s essentially caching if the component wants shadows and ensuring the flag for affects shadows is removed.

if (!bCastShadow)
{
StaticMeshInstance.Desc.Flags &= ~FISMPoolComponentDescription::AffectShadow;
}

Is this just a bug that was missed or was there an intentional reason for not being able to disable shadows with these renderers?

If it’s a bug, are these fixes sufficient? Or is there something I’m missing. Any info is appreciated!

Kind regards,

Darien

[Attachment Removed]

Steps to Reproduce

  1. Create a geometry collection asset
  2. Create a blueprint actor asset and add a geometry collection component
  3. Tick “Cast Shadows” to off and observe the shadow for the collection doesn’t disappear
    [Attachment Removed]

Hi Darien,

You are right that this we are missing correct support here.

Your fix to UGeometryCollectionRootProxyRenderer::CreateRootProxyComponents() is good, and should really be extended to other mesh component settings such as bCastFarShadow.

The change to UGeometryCollectionISMPoolRenderer also works if you cache settings in OnRegisterGeometryCollection() and apply in both InitMergedMeshFromGeometryCollection() and InitInstancesFromGeometryCollection().

But although this works for static/editor cases, these changes don’t propagate runtime changes to the component from SetCastShadow().

If you need that, then it’s not straightforward to plumb in right now I think. A minimal/ugly workaround for that would be to toggle ForceNativeRendering() on/off to force reregistration of the custom renderer.

I’ll put this issue on the backlog. We can probably take your changes directly, but need to think a bit more about the other properties and the dynamic runtime case.

Best regards,

[mention removed]​

[Attachment Removed]