GUI is painted behind the gamescene

Hello,

im using Nifty GUI for my UI.

Ive the problem that the GUI is painted behind the game scene.

At the start the gui is paintet above the scene, but if im changing the frustum than the gui is painted behind.

this is hapening because im using a parallel projection.

but i have found a solution, im setting the Queuebucket of the root node to “Bucket.Sky”.

is this a bug? because the gui should always be painted above the gamescene.

Mr.Sir said:
but i have found a solution, im setting the Queuebucket of the root node to "Bucket.Sky".

This is a bad idea, what bucket.sky does is setting the depth value at render time to 1.0. Meaning any objects in the sky bucket will render in the far.
Rendering everything in this bucket, will fail anything that is based on depth (Shadows, transparency, SSAO, and many more...)

What values do you use for your frustum?

Is the GUI associated with the guiViewPort or the main viewPort?

"Is the GUI associated with the guiViewPort or the main viewPort? "

guiViewPort. [java]guiViewPort.addProcessor(niftyDisplay);[/java]



[java]

rootNode.setCullHint(CullHint.Never);

rootNode.setQueueBucket(Bucket.Opaque);

flyCam.setEnabled(false);

cam.setParallelProjection(true);

aspect = (float) cam.getWidth() / (float)cam.getHeight();

cam.setLocation(new Vector3f(0, 30, 0));

cam.lookAt(Vector3f.ZERO , worldUpVector);

cam.setFrustum(-100, 100, -aspect * cameraZoom, aspect * cameraZoom, cameraZoom, -cameraZoom);[/java]

Worldupvector is 0,0,-1

Try setting a positive or 0 value to the near value of the frustum.

“Try setting a positive or 0 value to the near value of the frustum.”

ive pushed the rootNode farther away in the negative y - axis, it helped, thx.



but ive got another problem, if im setting up the intro and the scene, the scene is showing for an instant, but i shouldnt be.

it doesnt matter, if im setting up at first the scene or the gui.