java - LibGDX/OpenGL drawing seperate textures in FrameBuffer? -


so trying combine multiple textureregions in 1 using framebuffer. works extremely when textureregions originate same texture object/file try combine textureregions different textures of origin, textureregions 1 texture file drawn. textureregions different textures of origin not drawn.

for example have 2 textures:

texture tex1 = new texture(path texture 1); texture tex2 = new texture(path texture 2);  textureregion reg1a = new textureregion(region tex1); textureregion reg2a = new textureregion(region tex2);  textureregion reg1b = new textureregion(another region tex1); 

i set framebuffer this:

buffer = new framebuffer(pixmap.format.rgba8888, width, height, true); 

in draw method following:

buffer.begin(); batch.draw(reg1a, x, y); batch.draw(reg2a, x, y); buffer.end();  batch.draw(buffer.getcolorbuffertexture()); 

using above draw method, reg2 drawn. reg1 not show @ all.

buffer.begin(); batch.draw(reg1a, x, y);  buffer.end();  batch.draw(buffer.getcolorbuffertexture()); 

using draw method reg1 drawn, there nothing wrong textures.

buffer.begin(); batch.draw(reg1a, x, y); batch.draw(reg1b, x, y); buffer.end();  batch.draw(buffer.getcolorbuffertexture()); 

this draw method renders both reg1a , reg1b because both come same texture obect/file.

what want able draw textureregions different texture objects in same framebuffer , have them both show up.

i have tried having 1 texture in 1 framebuffer, , other in framebuffer, drawing 2 framebuffers new framebuffer, produces same problem.

any appreciated!


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -