Performance issue when rendering multiple objects

good !
i used the timeSinceLastStep you set : println(frameCount,timeSinceLastStep);
and i see too that first renderScene() frame is really longer 500ms in place of 10~15ms for next ones

i’m not totally sure about what i said, but i think textures are uploaded to videocard only at first use ( i hope a more confirmed user can tell us that), if it s the case a way is to use model/texture during your loading sequence like loading a model/texture by frame (frameCount ) and display it offscreen.

otherwise it puzzle me a lot, it looks quite light to me (compare of what you can do with processing usually) but i can t find the bottleneck, i tried to replace sphere with cubes, no changes, so it s not about a complex geometry, disabling textures doesn’t change much , even removing all moons doesn t bend time, damn

an ugly way, just to hide this freezing frame under “loading” can be:

if (loading) {
    try{solarSystem.sun.display();
         loading = false;
     }catch(Exception e){}
    showLoadingScreen();
  } else {
   renderScene();
  }

it will renderScene only when it succeed a first draw under the loading screen… but i’m sure there is a more elegant solution…it can be two flags in place of try/catch

1 Like