Render node as always on top [SOLVED]

Hello. I have a game state wich contains some objects that can be chosen. There is another game state which is the main scene. I attached the object game state to the camera node so that objects are shown right in front of the camera when object state is activated. Problem is that if camera is in front of a wall, part of the objects are rendered behind the wall or other main scene geometry. How can I set the object game state to be rendered top of everything? Shall I use render queue, render passes or what else? I have done some tries now but I don't seem to achieve this result. Any help?

I would put these objects in a separate pass and apply a disabled (or test=always) zbufferstate to them.

Good point renanse, I guess I'm taking the right direction. Now, if I set a disabled zbuffer on the separate pass rootnode, pass is drawn on top but object are drawn with zbuffer disabled too. How can I avoid this?

Ah, forgot they were 3d objects.  In that case, extend RenderPass or write your own pass.  Have it clear the depth buffer at the beginning of the pass before it renders the pass objects.  Don't forget to get rid of the disabled zbufferstate from your objects too.

But for sure! That is all what needs to be done! Thanks for clear explanation. XD

Could you please give me a samleimplementation. I am trying to do this. First with the ortho queqe, that was before i figured out that it is meant for 2d Objects, like interfaces. Than i tryed the RenderPass-implementation from the wiki it doesn't worked for me. ZBufferState will do what i want, but my objects own zbuffer is screwed. I want this for a gun in an fps based game. The gun should not stick in the environment, so it must be drawn all over everything. Nice if you could help.



@renanse

Anyway nice quake 3 map loader renanse. Is there a cvs or svn where you keep your actual version of it?

Take a peak into one of the render pass implementations and tests. I think you’ll clearly see its straight forward write a new one.

Just call Renderer.renderQueue() + Renderer.clearZBuffer() before you draw the gun. The gun render pass should be added after all other passes.