DepthTest

DepthTest

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

DepthTest

Post 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
Attachments
2.png
(799.19 KiB) Downloaded 1 time
1.png
(720.51 KiB) Downloaded 4 times
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: DepthTest

Post by Satirik »

Z-fight ? try to decrease the distance to the camera of your polygons, or just move them up
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: DepthTest

Post by zerver »

Exactly, the z-buffer is not accurate enough, or your polygons are simply too close to the ground.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: DepthTest

Post 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.
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: DepthTest

Post 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
Attachments
2.jpg
(159.63 KiB) Downloaded 1 time
1.jpg
(160.54 KiB) Downloaded 1 time
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: DepthTest

Post 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 :)
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: DepthTest

Post by danil_kalina »

Thanks JK, I didn't understand much with bits, but I fixed my circles. I need two convex cylinders for that
Post Reply

Return to “Help & Bugs”