[SOLVED] Frustum culling a little too eager?

Hiya,

We’re using Fustrum Culling in our project, but find that it’s a little too eager and objects will disappear before they fully go off screen. IE, we have a car moving across the screen and it gets culled while the back part is still visible as it moves off.

If we untick ‘Frustrum culling’ on the camera, all is fine, but ideally we’d like culling enabled.

Is there any control we have over this?

Thanks,

I have not seen similar issues before. Are you using custom AABB (specified on model or render component), which allows you to specify custom bounding box used for culling? If not, culling should be correct. If not, are you able to create a simple repro case to demonstrate?

1 Like

Hi Martin, we’ve got an NDA signed with you so have just shared the project directly in read mode https://playcanvas.com/editor/project/793034

SceneMain (and dev branch) is where we’re currently at. Notice the car, and two characters, will clip in at edge of screen as you pan around.

Alas not sure is the answer to the custom AABB question…

There sure was an engine bug … I have a fix here which should be released soonish.

Thanks for the report and the repro!

1 Like

Thats great thanks, for now we’ll disable frustum culling, but do let us know when the fix is up and we can re-enable :slight_smile:

1 Like

There’s an API and Editor support to override the Engine calculation of the AABB for each model that it does on a per frame basis.

By setting a explicit AABB to ModelComponent | PlayCanvas API Reference, it will use that AABB instead of doing the calculation each frame.

The AABB is used for cull checks for example.

We’ve noticeable improvements when using this in other projects, especially when animated characters are used as the cost for calculation goes up with the number of bones in the character.

The fix was released Release v1.45.0 · playcanvas/engine · GitHub

2 Likes