java - libGDX OpenGL clear buffer bit -
i effect of not clearing buffer bit how creates ghost trail , allows me create neat effects , images. there way can capture , save somehow drawing on screen? perhaps recall in code later.
you try using framebuffer. in loading code have like:
framebuffer fbo; public void load() { int screenwidth = gdx.graphics.getwidth(); int screenheight = gdx.graphics.getheight(); fbo = new framebuffer(format.rgb8888, screenwidth, screenheight, false); }
and in rendering code:
public void render(spritebatch batch) { fbo.begin(); batch.begin(); //rendering stuff goes here batch.end(); fbo.end(); }
now texture of framebuffer later reuse:
fbo.getcolorbuffertexture()
Comments
Post a Comment