crest icon indicating copy to clipboard operation
crest copied to clipboard

Moving the mesh construction away from OnEnable

Open skowroshima opened this issue 4 years ago • 1 comments

I'm implementing occlusion culling for the water as a decent amount of time is spend inland in my game. The problem is when I detect that I want to re-enable the OceanRender object - OceanRender.OnEnable() calls OceanRender.GenerateMesh(), which has a large cost for a real-time update. In the current state, it creates a FPS spike, making the full disabling/enabling for culling an impractical solution.

skowroshima avatar Feb 10 '21 17:02 skowroshima

Very reasonable.

We might have to move from enable/disable to awake/destroy for resource management. And if developers want resources to be freed they'll have to destroy the OR.

magenta404 avatar Nov 26 '21 19:11 magenta404