Render only close objects

Is it possible render only close objects. Say, I don’t want to render objects further 100.

There is Occlusion Queries. But, as I understand, it helps not to render only objects not seen by camera.

Hey and welcome!

You can set the camera.maxZ = 100

1 Like

Thanks! It helped.
Maybe a silly question.
It really does not render meshes or meshes are rendering but just camera does not see it?

It will only compute the vertex shader and never output the pixels

1 Like

Do I understand right?
The less maxZ value the more fps

if you are GPU bound: definitely yes

1 Like

Are you sure of that?

I would have thought that the isInFrustum method would have thrown the mesh away even before reaching the vertex shader stage?

Yup they might get clipped even before being dispatched as they would not be active.

That is correct for meshes entirely out of the frustum planes but for intersecting ones, only the vertex shader will be run