DebugCameraPrimitive: Depth?

Is there a change to limit the depth (z-direction) of DebugCameraPrimitive? Currently, the depth seems close to infinity, and modifying the frustum parameters near and far doesn’t seem to have an impact.

debugCameraPrimitive

Thank you very much for any hints!

Sancastle: Link

It looks like the DebugCameraPrimitive uses the near/far from the frameState, not from the camera you pass in:

Not sure if this is intentional. @sean_lilley do you know why?

If you want to visualize this another way would be to construct your own frustum geometry: https://cesium.com/docs/cesiumjs-ref-doc/FrustumGeometry.html?classFilter=Frustum

I’m pretty sure Ian fixed this on a local branch last week. I’ll ping him.

1 Like

My local branch fixes a slightly different problem which sets tighter bounds on the near far plane. The problem here is the use of frameState which @omar brought up, creating a feedback loop where the debug primitive is created, the scene’s camera adjusts its frustums to fit the debug primitive, then the debug primitive uses the scene’s frustum splits to get even larger, then the scene’s camera adjusts it’s frustums to fit the larger debug primitive, and so on, eventually getting quite large.

I agree that DebugCameraPrimitive shouldn’t be using the scene’s frustum splits at all. But then this will mean it can only render one frustum per camera, as the camera class doesn’t have a concept of multi-frustum, which will break some debug visualizations in the cesium inspector.

1 Like

Github issue: https://github.com/CesiumGS/cesium/issues/8848

1 Like

Fix here: https://github.com/CesiumGS/cesium/pull/8849/

This ought to get in for the June release.

1 Like