Quads uncanny overlay


I have two quads on same "forward-backward" coordinate. I rotate with both about the coordinate.

In some moments, part of one quad is rendered into part of second quad, see attachement.

Anybody know why it is happen and how can I correct it without changing the coordinate?

Thank you for help.

thats called z-fighting. Experiment with ZBufferState and its Functions. Create one zbs and attach it to both of the Quads to take effect.

Thank you for help! It is functional for this case.

I checked z-buffer before and I removed it for unsuccessful result.

In my previous case I have two quads on two places.

One quad is little rotated about left-right axis, so it goes like knife through second quad like letter X looked from side.

zBuffer works fine when normal texture is used, but I now found problem is when transpared texture is used(BlendState).

Exactly in some positions and rotations transparent texture on one quad is not transparent for second quad, so I don't see part of second quad but I see background.

Is it possible do it functional with transparent textures?

Node q1 = ...loaded q1.png on quad
        Node q2 = ... loaded q2.png on quad
        q2.setLocalTranslation(250,240,250); // move one quad near to me in my coordinate system
        q2.getLocalRotation().fromAngleAxis( -c.rad1*10, Vector3f.UNIT_X );


Recently I've had a bundle of fun with the exact problem you're encountering

Thank you for help.

I found there is not problem with transparency probably but only with crossing quads.

I use white and black textures for see what's happen exactly.

See attachements please.

PS: When I use setWriteable(false) there is always one full quad before second quad and this is wrong state.

Depending on size of quads and yourgrafic card i would say zbuffer precision issues.

Thanks monkey_scratches_head,  that solved a problem I was having  :smiley: