Hi,
my doRender() looks like this:
@Override
public void doRender() {
this.renderer.setBackgroundColor(ColorRGBA.black);
this.renderer.clearBuffers();
this.renderer.setOrthoCenter();
this.backgroundPass.doRender(this.renderer);
this.renderer.unsetOrtho();
this.renderer.renderQueue();
this.rootNode.draw(this.renderer);
this.renderer.renderQueue();
}
my setup like this:
@Override
public void simpleSetup() {
// Setup foreground pass
Line l = new Line("back", new Vector3f[] { new Vector3f(-100f, 0f, -1f), new Vector3f(100f, 0f, -1f) }, null,
null, null);
this.rootNode.attachChild(l);
int i = 0;
for (ScreenshotRect sr : this.screenshotRects) {
TextureState ts = this.renderer.createTextureState();
ts.setTexture(sr.texture);
int w = sr.texture.getImage().getWidth();
int h = sr.texture.getImage().getHeight();
Quad quad = new Quad("", 1.0f, h / (float) w);
quad.setLocalTranslation(new Vector3f(-1.5f * i, 0, 0));
quad.setRenderState(ts);
this.rootNode.attachChild(quad);
i++;
}
this.rootNode.setLocalScale(10.0f);
// Setup background pass
Quad background = new Quad("", 10f, 10f);
background.setRandomColors();
background.setZOrder(0);
this.backgroundPass.add(background);
}
I want to draw a background image behind all 3d scenery. However, the call to unsetOrtho() makes the 3d-scenery disappear, only the background quad gets drawn. Is this normal? I thought I had to re-enable projection mode in order to draw the scenery properly?