Transparent model textures (kinda)

Modelling, Textures, Animating and other general engine asset topics.

Transparent model textures (kinda)

Postby andy4729 on Tue Feb 21, 2012 7:21 pm

So I made a bush model and created the branches with a LOAD of flat planes with a texture of a branch on them. The texture has an alpha channel obviously. However, I am getting a strange effect when you look closely at the model. Part of the branches are transparent and you can see the ones behind. It looks really odd.

Here's my vmt:

Code: Select all
"VertexLitGeneric"
{
   "$color"            "[1 1 1]"
   "$baseTexture"         "models/bush01a"
   "$selfIllum"         0
   "$translucent"         1
   "$alpha"            1
   "$nocull"            1
}


This image tries to show what I mean. The darker branch that the arrow points at is actually behind all the branches directly in front of the player and yet it is visible... This happens throughout the model.

Image
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Re: Transparent model textures (kinda)

Postby marnamai on Tue Feb 21, 2012 7:44 pm

You should use "$alphatest" instead of translucent

https://developer.valvesoftware.com/wiki/$translucent

Also compile your map with "-TextureShadows"

https://developer.valvesoftware.com/wiki/VRAD

Don't forget to add the material path to lights.rad

Code: Select all
forcetextureshadow props_example/prop.mdl
User avatar
marnamai
Veteran
Veteran
 
Joined: Thu Nov 10, 2005 12:17 pm
Location: Belgium

Re: Transparent model textures (kinda)

Postby andy4729 on Wed Feb 22, 2012 5:12 pm

Ahh yeah, forgot about alphatest!

Thank you very much :).
We're squatting in a system that consistently stalls
User avatar
andy4729
Regular
Regular
 
Joined: Sat Sep 09, 2006 7:26 pm
Location: Canterbury, United Kingdom

Return to Art Creation

Who is online

Users browsing this forum: No registered users