is occlusion culling automotic or do i need to write the logic ?

Helllo…i want to ask that is occlusion culling automatic? i have enabled the occlusion culling from project settings but i dont know is it working or not as i m not seeing any effect ? another thing i want to ask is that like i m trying to make a racing game so will unreal engine take care of removing the actors that are behind my car or should i write the logic of removing the actors after they have rendered.? Thanks in Advance

It’s automatic.
Use the console command r.visualizeOccludedPrimitives 1 to visualize.

That’s probably because you are destroying the actors that are not on screen and the ue4 occlusion culling algorithm doesn’t do that. It just hides them so they don’t use gpu for rendering. Ex: you look at a cube, it gets rendered, you turn so the cube is behind you, it does not get rendered, you face the cube again, it gets rendered again. That’s why it doesn’t destroy them. You should only destroy an object if you’re sure you will not need it.

If you have an open world game (very large scene), ue4 has a great level streaming mechanism. I used this mechanism for buildings too (each floor in a different scene).

ok but which one is the best approach should i go with the default occlusion culling settings or should i write my own logic to remove the actors that are not being rendered… another thing is when i was trying to write my own logic of removing the actors that are not being rendered its showing that the actors are being destroyed but when i m using unreal engine occlusion culling settings the total numbers of actors remain same…Thanks n Happy New Year :slight_smile:

ok thanks for replying …so which approach is best my own logic of destroying the actors that are not needed anymore in the level or the unreal engine default occlusion culling algorithm ?

Depends on the game you are trying to make. For example if you build a side scroller that goes only to the right and at start time, the entire scene is loaded, you could delete all objects that exit the screen on the left side, because the user will not see them again. Doing this should increase the FPS as the user aproaches the end of the level.
If the user will need those objects again it’s not a good idea to delete them because reallocating memory to create them is time consuming.
So it’s a trade off: free up memory (delete them) vs. no need to reallocate memory (keep them). It all depends on how frequently the user needs those objects.
That’s what I think.

ok thanks Titirez…another thing i would like to share with you is that after reading your second last comment i did a simple check to see whether unreal engine is really disabling the visibility of actors that are behind the camera and are not being rendered. I placed a simple cube in my level and assign a tick event on that cube that will constantly show the updated status of the isVisible variable of that cube. But the status of the cube “isVisible” variable is always showing as visible when it is behind the camera.

Before sending the draw calls to the GPU, we can decide if we want to hide some of the meshes. That’s what the “isVisible” bool refers to.
To make it false, use the “Set visibility” node.

After that, the GPU does another check for occlusion to see if it should render it.

I don’t think there is a bool to tell us if a mesh will actually be rendered in the current frame, because like I said, this is decided on the GPU, not CPU.

Actually I just found this:
https://docs.unrealengine.com/latest/INT/BlueprintAPI/Rendering/WasRecentlyRendered/index.html
here:

thanks man…