Problem rendering scene to separate viewport

i’m getting a strange problem where my geometry in my scene is corrupted/large parts missing.



I’m rendering into my own viewport like this



frameBuffer = new FrameBuffer(800, 400, 0);

sceneTexture = new Texture2D(800, 400, Format.RGBA8);

frameBuffer.setColorTexture(sceneTexture);



ViewPort view1 = renderManager.createMainView(“view 2”, cam);

view1.setClearEnabled(true);

view1.setBackgroundColor(ColorRGBA.White);

view1.setOutputFrameBuffer(frameBuffer);



view1.attachScene(sceneNode);



I then use sceneTexture on a quad to view the result,



I also have a sceneNode.updateGeometricState(); in my code where I initialise/change the scene - if I don’t have this the program crashes.



but here’s the strange thing - when I add a fog filter, the scene renders fine!

don’t know what’s going on,

thanks.

I’m glad that for once adding a filter make things better rather than screwing them to be honest :stuck_out_tongue:



do you set a depth buffer to your framebuffer? if yes what’s the format?

aaah that was indeed the problem :slight_smile:



I had disabled the depthbuffer as I didn’t need it and thought it would save a little speed/memory…



thanks…