First time enable object

Hi there. I’ve created new scene (editor) for demonstration my trouble. As you can see, I’m just enabling planets over time, then hide and show again. When I enable them at first time, render is freezing very much. I think, this is trouble of material compiling or first rendering. So, how can I pre-render all hidden objects?

Unfortunately, the best way to get around this is to have all objects enabled and disable them on the first frame. Perhaps have a full screen quad/image to hide the ‘blink’.

1 Like

Okay, but what if I want spawn objects procedurally? Do I need to render the first example of object on load or something else?

Are you creating new objects from scratch or cloning an existing instance? If the latter, as long as it’s been enabled at some point, the clones shouldn’t causing an issue in theory.

What’s usually taking time is shader compilation which only happens once per new shader. So a trick is indeed to pre-make some of the entities that you’re going to be spawning beforehand and disable them as soon as your scripts load - this will trigger shader compilation and from that point on spawning these entities won’t have a shader compilation cost.

1 Like

Thank you. I thought same. That’s doing a trick :slight_smile: