Flickering planes

Started by chupakabra, June 10, 2013, 10:30:56 AM

Previous topic - Next topic

chupakabra

Hello,

I am trying to draw squares on the ground. Currently I am drawing small planes on a big plane.

When I move camera around, litle planes starts flickering. I pasted two images as good and bad example.

How can I resolve this issue? Is this because camera is too far?

[attachment deleted by admin]

EgonOlsen

That's z-fighting. Your small planes are too close to the larger one for the zbuffer to distinguish. Which renderer is that?

chupakabra

Thank you for quick answer.

I tried to increase the distance. Now "little planes" are 40 units higher than ground. Before they were 20 units higher.
I still get flickering. I added an example picture with forklift roof flickering.

I am using:
      buffer = new FrameBuffer(resWidth, resHeight, FrameBuffer.SAMPLINGMODE_GL_AA_4X);
      buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
      buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);

[attachment deleted by admin]

chupakabra

I increased the distance to 1000 and now it works great. Thanks :)

I'll try to minimize the distance, but it won't be such a problem if they hover a little.

Can you advise me, what to do with forklift, to resolve the flickering?

EgonOlsen

If the ground is always below everything else, you might want to put it into another instance of World, render that one, clear the zbuffer and render the rest (you could also do it in one world by altering the visibility between render passes). Anyway, how far away is that? moving the blue boxes 1000 units away sounds like as if this is very far away from the camera...