www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: influt on November 14, 2008, 03:11:34 pm

Title: a textured object passes through another
Post by: influt on November 14, 2008, 03:11:34 pm
Hello.

Excuse me, if the same question has been already asked, but i haven't found it here.
I've got two objects: one is semi-transparent, another one is not. When standing near to those objects, everything looks ok:
(http://i386.photobucket.com/albums/oo305/influt/th_ok.jpg) (http://i386.photobucket.com/albums/oo305/influt/ok.jpg)

but when stepping back, the one that has to be behind, passes through the nearer one:
(http://i386.photobucket.com/albums/oo305/influt/th_notOk.jpg) (http://i386.photobucket.com/albums/oo305/influt/notOk.jpg)

changing glZBufferDepth in Config didn't make any effect. So how can i avoid this?
Thank you.
Title: Re: a textured object passes through another
Post by: EgonOlsen on November 14, 2008, 03:24:11 pm
That's z-fighting (http://en.wikipedia.org/wiki/Z-fighting (http://en.wikipedia.org/wiki/Z-fighting)). Either try to increase the offset between the transparent and the opaque objects or eliminate/minimize the overlapping of both. You may also try to play around with near and far clipping plane (in Config), but from my experience this usually doesn't help much.