java - LibGDX/OpenGL drawing seperate textures in FrameBuffer? -
so trying combine multiple textureregion
s in 1 using framebuffer
. works extremely when textureregion
s originate same texture
object/file try combine textureregion
s different textures of origin, textureregion
s 1 texture file drawn. textureregion
s 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 textureregion
s 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
Post a Comment