Performance issue when rendering multiple objects

Hello again th75!

I’ve been tinkering with println(frameCount,timeSinceLastStep); and found out it’s both solarSystem.display() and spaceship.display() who are slowing things down, with ~300ms and ~200ms respectively, hence the 500ms you got on that particular frame (without any texture). I think it must be something related to all the transformations that take place, and also solarSystem.display() being kind of recursive in nature. The spaceship seems simple, but I manually reset the transformation matrix, that may explain why the small difference :face_with_raised_eyebrow:

After some research on off-rendering, PGraphics and ways of rendering outside of draw() I stumbled upon this stackoverflow post. I might try to perform some magic with Java Thread, although it seems like some kind of rabbit hole that will surely take me a couple of days :face_exhaling: . Also, the same answer that propose Thread, suggests it may not be thread secure.

I’ll come back to you in a couple of days with news, be them of victory or defeat :joy: