Enforcing specific LODs for custom pass rendering

Hi!
I was wondering if it’s possible to render objects with a specified LOD in the custom pass context.

In the camera’s custom frame settings there’s a very nice parameter called “Offset Factor” that seems to do exactly what I need. However when the ctx.renderContext.Cull() is called before CoreUtils.DrawRendererList(), this parameter is not taken into account and meshes render with their default LODs, ignoring the offset factor.

Is there any way around it?
Thank you!
@antoinel_unity, sorry to bother you again, but maybe you know the answer :slight_smile:

Video

ezgif-1-da4bd61f2f

Here’s an example of the same behaviour in “CameraDepthBaking” example from GitHub - alelievr/HDRP-Custom-Passes: A bunch of custom passes made for HDRP where ctx.renderContext.Cull() is also used. As you can see, when the LOD offset parameter on the camera is changed it doesn’t affect drawing to this normal buffer render texture, resulting in a mismatch between what the actual camera sees and what is being rendered by the custom pass.

Hello, the lod override from the frame settings or HDRP quality settings is applied at the beginning of the frame (just before culling) using the QualitySettings.SetLODSettings function. I think that if you’re calling Cull manually from a custom pass, you should be able to achieve the same result if you call this SetLODSettings function before.

2 Likes