We want more Update functions for RaytracingAccelerationStructure

Hi Unity developers,

Currently, I notice the rendering layer mask changes to MeshRenderers in runtime cannot be reflected into closest-hit shaders. I suppose the acceleration structure need to be updated by these changes but there is not such API to do the update, leaving user to have to rebuild the instances for those renderers which seems unneccessary and less performant.

If more parameter changes could be updated directly by Update APIs rather than rebuild, it would be very helpful.

Hi!

The rendering layer mask is not part of the acceleration structure. It’s an uniform and is set for each ray tracing instance (Mesh Renderer) when DispatchRays is called. You can access it like this in your closest hit shader:

// Builtin uniform declaration.
float4 unity_RenderingLayer;

uint renderingLayerMask = asuint(unity_RenderingLayer.x);

You can submit a bug using Bug Reporter from the menu Help → Report a Bug. Thanks!