Hello!
I’m trying to handle frustum culling with instances, and I need to know which instances are in.
Everything seems to work fine using the functions below, but there is one problem. As I’m checking
just against point, and that my instances are rectangular, they don’t appear if they are at the border of the frustum. Then they pop in when their center (posVec) is in.
I could eventually do multiple tests which might be costly, and not sure what would be the most effective. The other idea is to “enlarge” a little bit the frustum without changing the camera characteristics(Fov…), and tune the enlargement until it’s good.
But I have no idea how to make the frustum match the camera as below, but with a slightly bigger frustum.
If there is another way to do it better, I’ll take it!
frustum.setFromProjectionMatrix(
m.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse)
);
// ...
frustum.containsPoint(posVec)