Darkplaces transparent tga skin reverses draw order?
Moderator: InsideQC Admins
18 posts
• Page 2 of 2 • 1, 2
Hello lth,
the most important line in LH´s code (thank you Sajt for posting it) is:
cull disable
This makes the texture "transparent".
Please see the detailed description of how "cull" works in the Q3-shader manual here:
http://toolz.nexuizninjaz.com/shader/
I pasted the important lines from the manual for you:
Kind regards,
Seven
PS: Be aware, that DarkPlaces has not ALL Q3 shaders implemented.
Only some of them can be used in DP.
the most important line in LH´s code (thank you Sajt for posting it) is:
cull disable
This makes the texture "transparent".
Please see the detailed description of how "cull" works in the Q3-shader manual here:
http://toolz.nexuizninjaz.com/shader/
I pasted the important lines from the manual for you:
3.2 cull <side>
Every surface of a polygon has two sides, a front and a back. Typically, we only see the front or "out" side. For example, a solid block you only show the front side. In many applications we see both. For example, in water, you can see both front and a back. The same is true for things like grates and screens.
To "cull" means to remove. The value parameter determines the type of face culling to apply. The default value is cull front if this keyword is not specified. However for items that should be inverted then the value back should be used. To disable culling, the value disable or none should be used. Only one cull instruction can be set for the shader.
3.2.1 cull front
The front or "outside" of the polygon is not drawn in the world. This is the default value. It is used if the keyword "cull" appears in the content instructions without a <side> value or if the keyword cull does not appear at all in the shader.
3.2.2 cull back
Cull back removes the back or "inside" of a polygon from being drawn in the world.
3.2.3 cull disable, cull none
Neither side of the polygon is removed. Both sides are drawn in the game. Very useful for making panels or barriers that have no depth, such as grates, screens, metal wire fences and so on and for liquid volumes that the player can see from within. Also used for energy fields, sprites, and weapon effects (e.g.; plasma).
Design Notes: For things like grates and screens, put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.
Kind regards,
Seven
PS: Be aware, that DarkPlaces has not ALL Q3 shaders implemented.
Only some of them can be used in DP.
- Seven
- Posts: 301
- Joined: Sat Oct 06, 2007 8:49 pm
- Location: Germany
the cull keyword doesn't make things transparent. it only makes it visible from both sides (or the wrong side, if specified that way).
'alphafunc GE128'
that's the important line - means draw the surface pixels only if the alpha value is greater than 0.5 (256*0.5=128).
otherwise refered to as alpha tests.
This can be used for grills and stuff, and does not require any depth sorting (depth is written as normal, if the pixel is actually drawn).
It will not help at all with translucency. It is only useful for removing pixel samples entirely, or not.
'alphafunc GE128'
that's the important line - means draw the surface pixels only if the alpha value is greater than 0.5 (256*0.5=128).
otherwise refered to as alpha tests.
This can be used for grills and stuff, and does not require any depth sorting (depth is written as normal, if the pixel is actually drawn).
It will not help at all with translucency. It is only useful for removing pixel samples entirely, or not.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Thanks guys, I'll give it a go sometime - I didn't even know you could specify your own shaders in DP.
-

lth - Posts: 144
- Joined: Thu Nov 11, 2004 1:15 pm
18 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest