GLGraphics & GLModel - Layering textures with textures alpha instead of blend
in
Contributed Library Questions
•
1 year ago
Im rendering the texures fine (ie using parent.image renders them properly over one another preservign transparency)
I need to use GLObject textures though, to layer everything up based on what it is and render them all nice and fast
Ive added noBlend() to the various things (even though the code below doesnt show that) and it doesnt make any difference, the results is shown on the right
Id only need blending for bloomed layers etc, but it seems to be doing some kind of blending all the time
The shots layer is cleared with clear(0f,0f,0f,0f) if filled red the background is visible but everything is tinted red
Any help would be great guys :) thanks!!
Render code:
I need to use GLObject textures though, to layer everything up based on what it is and render them all nice and fast
Ive added noBlend() to the various things (even though the code below doesnt show that) and it doesnt make any difference, the results is shown on the right
Id only need blending for bloomed layers etc, but it seems to be doing some kind of blending all the time
The shots layer is cleared with clear(0f,0f,0f,0f) if filled red the background is visible but everything is tinted red
Any help would be great guys :) thanks!!
Render code:
- void render() {
GLGraphics renderer = (GLGraphics)g;
GL gl = renderer.gl;
texCoords();
offscreenBuffer.beginDraw();
offscreenBuffer.beginGL();
offscreenBuffer.setSize(350,550);
offscreenBuffer.clear(1.0f,1.0f,1.0f,0.0f);
for(int i = 0; i < renderList.size(); i++){
img = renderList.get(i);
Vec2D pos = renderPos.get(i);
offscreenBuffer.image(img,pos.x-(img.width*0.5f),pos.y-(img.height*0.5f));//,img.width,img.height);
}
offscreenBuffer.endGL();
offscreenBuffer.endDraw();
outputPlane.initTextures(2);
texCoords();
outputPlane.setTexture(0, testing);
GLTexture buf = offscreenBuffer.getTexture();
outputPlane.setTexture(1, buf);
renderer.beginGL();
translate(width/2, height/2,-(width/2)-(height/2));
renderer.model(outputPlane);
renderer.endGL();
//parent.image(testing,0,0,350,550);
//parent.image(offscreenBuffer.getTexture(),0,0,350,550);
renderList.clear();
renderPos.clear();
initTex();
}
1