I was chatting with Nico, John, Arturs and wondered about the need for clearing the backbuffer - if you game used a non-transparent tilemap or has an image covering the background - as not clearing it would give a speed boost and could even be used to add some nice special effects...
Anyhow Nico found an undocumented command!!!
stage:setClearColorBuffer(false)
This will stop the back buffer from clearing, true will turn it back on again. There is a corresponding getClearColorBuffer() too.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
https://deluxepixel.com
Comments
may setClip() - which i haven't had the time to test yet - be used to draw only the "needed" (on screen) portion of stage? or this is already managed by gideros?
At this time I am checking at any screen movement if there are things I can hide outside screen boundaries, but setClip could change things a lot: do you know anything about its performance?
thank you
https://deluxepixel.com
If things must be hidden, better not insert them in stage at all until they should actually be visible.
Up to 2014.10, I noticed that i had a speed improvement if I hid some kind of objects instead of keeping them as they were.
If you say that glScissor is already applied to screen boundaries maybe I am wasting resources
It can be reproduced though using a render target and drawing that on the screen and still turning the clearcolorbuffer off to get the boost.
https://deluxepixel.com