Performance optimization for PlayCanvas

Hi,I have a question about the Performance optimization for PlayCanvas.
The problem:
1.Whether the engine support Occlusion Culling to reduce the number of polygons rendered per frame? whether BSP algorithm can solve this problem?

1 Like

Hello, in the camera settings you have frustumCulling that reduce the poligons rendered but i don’t know much about this topic so wait for a more detailed reply :slight_smile:

Apart of Frustum Culling there is no built-in technique for culling as it is very case to case specific.

We’ve implemented different techniques previously per specific project, and every time it would be different. It is advisable to implement best technique for your specific project.

There are some optimisation guidlines as well touching general aspects of WebGL apps: http://developer.playcanvas.com/en/user-manual/optimization/

Thanks for the advice. We’ve knew the Frustum Culling but we are developing FPS games,the Frustum Culling cannot meet our needs. Recently we are trying to apply the Binary Space Partitioning(BSP) algorithm to the engine, can you give some advice to us?

Thanks for your advice!

On forward renderer there is a cull method: https://github.com/playcanvas/engine/blob/master/src/scene/forward-renderer.js#L1156
Which you could override with your logic applying BSP.

But perhaps you don’t want to check every render frame what to cull or not, and better would be to enable/disable model/light/particle/etc component only when needed, like when partition changes state of visible/hidden. And you need a system to mark thing what should be culled or not, easily can be done with entity tags. And you need a way to keep indexes - space partitions need to know what is inside of it.
You could use BoundingBox, BoundingSphere and OrientedBox for this to help making checks of what intersects with what, etc.

i have been searching for this topic and you keep giving the same “it is case specific” for so many years.
Optimization is NEVER case specific, no matter the size. Even with low demanding projects as better optimized worst phones will move it, which means more customers.

There are more people than you think worried about this, even people that moved to other engines. Just because they do not write a post does not mean they are not there (and a i know some). Oclussion Culling is needed

Please work on it, you wont regret

1 Like

Hi @practicas_imas,

You can open a feature request issue for it here:

I’m afraid we don’t this on our short term roadmap but we have made several optimisations since this topic was made including clustered lighting that allows many lights to be rendered at once, cascaded shadows to improve quality of shadows that are closer to the camera.

We also did a presentation on this here: https://youtu.be/wYAvVUFQP2M?t=3350