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 » 29 Dec 2012, 12:35

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
0 x

Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: DepthTest

Post by Satirik » 29 Dec 2012, 15:02

Z-fight ? try to decrease the distance to the camera of your polygons, or just move them up
0 x

zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: DepthTest

Post by zerver » 29 Dec 2012, 16:27

Exactly, the z-buffer is not accurate enough, or your polygons are simply too close to the ground.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: DepthTest

Post by jK » 29 Dec 2012, 16:30

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.
0 x

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

Re: DepthTest

Post by danil_kalina » 09 Jan 2013, 17:23

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
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: DepthTest

Post by jK » 13 Jan 2013, 09:21

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 :)
0 x

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

Re: DepthTest

Post by danil_kalina » 20 Jan 2013, 01:08

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

Post Reply

Return to “Help & Bugs”