Scene Register Before Render Performance

Yo @Deltakosh, @sebavan or anybody else… I got a question regarding scene.registerBeforeRender.

When i create a script component for attaching to a transform node in unity to provide some encapsulated logic. EACH instance of a script using scene.registerBeforeRender for its own little render update tick function.

So if i had hundreds of script objects they would each be using scene.registerBeforeRender function.

My question is there ANY performance penalty for this approach ???

Should i add all my script components to a array list and iterate that array list from one global scene.registerBeforeRender call ???

Would iterating an array of hundreds of objects and calling its tick or update each frame be ANY improvement vs letting each object register its own render loop via scene.registerBeforeRender

Any info would help for the architecture of the Unity Exporter And the Scene Manager :slight_smile:

The funny thing is that it is exactly what registerBeforeRender does :slight_smile: It pushes it into an array that will go through on each requestAnimationFrame so not sure yours would be different.

Hope that helps

That is exactly what i saw when i made the function… But a colleague of mine is swears that me keeping an array and doing it myself would be better than me calling scene.registerBeforeRender.

So i thought i better check the forums and see what up … Thanks Sebastian :slight_smile: