• 3D
  • How to have Particles with Portal Culling?

We have implemented a Portal Occlusion culling for our game with the Room and RoomManager nodes. Everything works but the Particles don't show. Reading the docs we have seen the section concerning this exact problem.

Our problem is that the two solutions that are proposed don't work for us. Both setting the portal mode to DYNAMIC and setting a cull margin don't work for us.

The only thing that has the particles show up is either setting the Portal mode to GLOBAL or ROAMING. Both of these options make our game perform much worse. Is there maybe something we are missing about the system?

We have uploaded a minimal project showing the particles being wrongly culled. There is one room with a simple particle system. When portal culling is activated, only particle systems render that have the portal mode set to Roaming or Global.

You can clone it from Github or see the attached file.

If someone can confirm that I'm not using the system in a blatantly wrong way, I could also open a Github issue.

You are correct there was a regression in the dynamic particles which was fixed in: https://github.com/godotengine/godot/pull/57546

This was cherry picked to 3.4.3 and so won't be working yet in 3.4.2. As for the expansion margin, I actually need to check whether this still works (it depends whether the zero sized AABB is centred on the node or the origin), if not I will change the docs to recommend DYNAMIC.

GLOBAL will work because it is just like regular frustum culling, although you'll get no occlusion culling so depending on how many particle systems you have that could be slow.

ROAMING shouldn't be too bad, but if your particle systems are "large" they could be expanding into adjacent rooms, and so rendering more than you might want, and maintaining large numbers of ROAMING objects could be unnecessarily expensive.

Thank you for the detailed answer! It's good to know that this will be fixed in the upcoming version. In the meantime we will set the particles to ROAMING.

You were correct there was actually a regression for Particles and CPUParticles in STATIC mode. I've done a PR to fix this, and also enable it to use the visibility_aabb for the Particles node. https://github.com/godotengine/godot/pull/58422

If this above PR doesn't make it into 3.4.3 then I would recommend just using the DYNAMIC mode for the time being (when you are on 3.4.3).

All these fixes should also be in 3.5.

That's great, thank you for your work!