Page 1 of 1

DepthTest

Posted: 29 Dec 2012, 12:35
by danil_kalina
How to make selected polygons on the first image - invisible ?
Turned on DepthTest on the second imgae. It allowed me to make selected polygons invisible, but other polygons are chopped.

Image

Image

Re: DepthTest

Posted: 29 Dec 2012, 15:02
by Satirik
Z-fight ? try to decrease the distance to the camera of your polygons, or just move them up

Re: DepthTest

Posted: 29 Dec 2012, 16:27
by zerver
Exactly, the z-buffer is not accurate enough, or your polygons are simply too close to the ground.

Re: DepthTest

Posted: 29 Dec 2012, 16:30
by jK
Here it has nothing to do with accuracy, the `roads` polygons have a different surface than the terrain. Either use PolygonOffset or use stencil shader tricks.

Re: DepthTest

Posted: 09 Jan 2013, 17:23
by danil_kalina
Stencil tricks, Help ! ( I took stencil example from minimap_startbox.lua )

How to remove overlapped area on the left and on the right ?

Image

Image

Re: DepthTest

Posted: 13 Jan 2013, 09:21
by jK
You got an empty cylinder, this form has max 4 polygon overlaps/overdraw. In contrast boxes, cylinders, spheres, ... have only 2.
So the depending on your form/overlapping you need to decide how many stencil bits you use. Minimap etc. only need 1bit (=2 states), you need in contrast 4 states = 2bits. Just change the number of used stencil bits and it should work :)

Re: DepthTest

Posted: 20 Jan 2013, 01:08
by danil_kalina
Thanks JK, I didn't understand much with bits, but I fixed my circles. I need two convex cylinders for that