You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice how the debug camera frustum is extremely large even though the near and far planes are 1.0 and 10000000.0, which should cover less than the earth.
The problem is DebugCameraPrimitive is using FrameState's frustum splits to render frustums, which doesn't make sense when passing in a custom Camera object. This creates a feedback loop where the DebugCameraPrimitive is created, FrameState adjusts its frustums to fit the DebugCameraPrimitive, then DebugCameraPrimitive uses FrameState's frustum splits to grow even larger, then FrameState adjusts its frustums to fit the larger DebugCameraPrimitive, and so on, eventually getting quite large.
DebugCameraPrimitive shouldn’t be using FrameState's frustum splits at all, since they come from a different Camera. But then this will mean DebugCameraPrimitive can only render one frustum per camera, as Camera doesn’t have a concept of multi-frustum, which will break some debug visualizations in the cesium inspector.
Some fix ideas:
DebugCameraPrimitive only renders one frustum. The cesium inspector would have to render multiple frustum geometries manually using the scene's camera and the associated FrameState frustum splits.
Create a new debug primitive type that takes a list of frustums as arguments.
Add multi-frustum to the Camera class. Not sure how this would work exactly.
I'm leaning towards option 1.
The text was updated successfully, but these errors were encountered:
Brought up on the forum: https://community.cesium.com/t/debugcameraprimitive-depth/9603
Example
Notice how the debug camera frustum is extremely large even though the near and far planes are
1.0
and10000000.0
, which should cover less than the earth.The problem is
DebugCameraPrimitive
is usingFrameState's
frustum splits to render frustums, which doesn't make sense when passing in a customCamera
object. This creates a feedback loop where theDebugCameraPrimitive
is created,FrameState
adjusts its frustums to fit theDebugCameraPrimitive
, thenDebugCameraPrimitive
usesFrameState's
frustum splits to grow even larger, thenFrameState
adjusts its frustums to fit the largerDebugCameraPrimitive
, and so on, eventually getting quite large.DebugCameraPrimitive
shouldn’t be usingFrameState's
frustum splits at all, since they come from a differentCamera
. But then this will meanDebugCameraPrimitive
can only render one frustum per camera, asCamera
doesn’t have a concept of multi-frustum, which will break some debug visualizations in the cesium inspector.Some fix ideas:
DebugCameraPrimitive
only renders one frustum. The cesium inspector would have to render multiple frustum geometries manually using the scene's camera and the associatedFrameState
frustum splits.Camera
class. Not sure how this would work exactly.I'm leaning towards option 1.
The text was updated successfully, but these errors were encountered: