Offscreen textures

Hi all,

I’m trying to narrow down my focus to figure out something that isn’t working the way I expect it to.

I’ve gotten the standard offscreen texture example working, but now I’m trying to go beyond that, and am having trouble. In the example, we create a Box geom and use attachScene(box) to hook it into the texture’s scene graph, and it renders beautifully.

For what I want to do, I am not able to create the geometry that will paint the texture at the same time I create the texture itself. I want to be able to dynamically add things here and there later. So I’ve make a fake root node which is what is passed to offView.attachScene. Later I add children Spatials to that node hoping that they will render, but they don’t.

Should they?

Is there a different / better way of going about this?

I know my texture if updating because I can change the clear color in its update loop and that has an effect - it’s my various Boxes which aren’t rendering.

Thanks
-Rich

Are you calling updateLogicalState() and updateGeometricState() on your custom nodes? This is handled for you for the root node, but if you have additional root nodes, you must call these methods every frame for scene graph changes to update properly.

Yes.

That’s not the problem. The problem was that I had commented out offView.attachScene(offRoot); last night like an idiot because I was getting lwjgl thread errors, and was trying to track them down, and then forgot I’d done so this morning.

So now my problem has morphed into an openGL threading issue in that no matter where I try to attachScene I get the same error.
“IllegalStateException: Scene graph not properly updated for rendering, etc…”

Shoot me now.

Sorry for the user error.

EDIT Actually, it WAS the error. Immediately after I attach offRoot as the scene, I needed to do a offRoot.updateGeometricState(); - which I wasn’t doing.

-Rich