Rendering viewport aligned quad as background

I’m trying to render a simple quad to be used as a background without luck, I just get black nothingness.

The idea is to set up a new viewport similar to the gui viewport, which is an ortho2d projection aligned to the screen.

Since I want infinite z values I use the sky bucket, which seems to render at furthest possible z.

The code is simple, in simpleAppInit() I do:


Camera bgCam = new Camera(settings.getWidth(), settings.getHeight());

bgViewPort = renderManager.createMainView(“bg viewport”, bgCam);

bgViewPort.setClearFlags(false, false, false);



Quad backgroundQuad = new Quad(640,480);

Geometry bgGeometry = new Geometry(“Background quad”, backgroundQuad);

Material bgMat = new Material(assetManager, “MatDefs/background.j3md”);

bgMat.setTexture(“ColorMap”, assetManager.loadTexture(“Textures/test_right1.png”));


bgGeometry.setLocalTranslation(0, settings.getHeight(), 0);



The material works, it renders if the node is put in the normal scene (but of course then it does not cover the screen and renders at inf distance).

What have I missed?

Search the forum for “background image”