$distancealpha on static prop

Got problems with your models? Struggling with textures? Get help with your custom assets.

$distancealpha on static prop

Postby marks on Sun Sep 05, 2010 3:08 pm

VMT:
Code: Select all
"VertexlitGeneric"
{
   "$basetexture" "pipe_dream/catwalks/catwalk_yellow"
   "$bumpmap" "pipe_dream/catwalks/catwalks_normal"
   
   //"$alphatest" 1
   "$translucent" 1
   "$distancealpha" 1
      "$softedges"      1
      "$edgesoftnessstart"   0.05
      "$edgesoftnessend"   0.4
      "$scaleedgesoftnessbasedonscreenres" 1
         
      "$glow"      0

   "$halflambert" 1
   "$model" "1"
   "$surfaceprop" "Metal"
   "$normalmapalphaenvmapmask" 1
   "$envmap" "env_cubemap"
   "$envmapcontrast" 1   
   "$envmapsaturation" 1
   "$envmaptint" "[ 0.08 0.08 0.08 ]" 
      
   "$phong" "1"
   //"$phongexponent" 12
   "$phongexponenttexture" "pipe_dream/models/pipes_exponent"      
   "$phongboost"   "3"
   "$phongfresnelranges"   "[4 12 28]"
   "$phongalbedotint" "1"
}


VTEX compile script
Code: Select all
// Enable distance alpha compiling
alphatodistance 1

// Scale the image down to 1/nth its original size. '8' takes 2048 down to 256
reduce 4

// Size of 'spread' zone between alpha values of 0 and 1. This is the area the shader works with.
// Bear in mind that higher numbers exponentially increase texture compile time!
distancespread 1

// To prevent artefacting:
nomip 1
nolod 1
nocompress 1


I compiled this all with Source 2007 base, it seems like no matter what I do $distancealpha does nothing, isnt recognised. The edge softness values seem to not change anything and worse - if I use $translucent instead of $alphatest in the VMT it screws up the Z-sorting on the mesh. But using $alphatest artifacts the alpha when it is rendered ...
User avatar
marks
Creative Assembly
Creative Assembly
 
Joined: Tue Aug 16, 2005 5:07 pm

Re: $distancealpha on static prop

Postby Garrador on Wed Oct 20, 2010 10:28 am

I think theres actually aint much you can do. Source has some awesome contradictions between parameters. So one would rule out the other. Alpha maps with other alpha parameters often fucks it up.

I cant say this for sure, but in my experience and vaguely remembering reading something about it, it just wont work right =P
You click on Build or type
make (or some equivalent), and you are astonished, then mortified, as you realize that the whole world is being
recompiled and relinked!
- Scott Meyers
User avatar
Garrador
Veteran
Veteran
 
Joined: Fri May 12, 2006 10:39 pm
Location: Norway

Re: $distancealpha on static prop

Postby Kremator on Wed Oct 20, 2010 10:35 am

Try these params instead of $distancealpha

Code: Select all
"$alphatest" "1"
"$AlphaTestReference" ".2"
"$AllowAlphaToCoverage" 1


You can increase the $alphatestreference to adjust the fuzziness of the edge, it looks kinda crap but its a lot cheaper than $translucent and causes no Z-sorting issues.

EDIT : If its a model be sure to include $model 1
User avatar
Kremator
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Mon Jan 03, 2005 8:50 am
Location: the alarums of war

Re: $distancealpha on static prop

Postby Mr. Happy on Tue Oct 26, 2010 10:54 pm

My guess would be that it's because you are using envmapped reflections with phong and translucency. Envmappng already causes problems with translucency sometimes and is unneeded because of your phong. Try commenting out those lines, if that doesn't work, comment out the phone as well. If that works bring back the envmapping and not the phong.
Image
-You've just been happified!?
User avatar
Mr. Happy
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sat Dec 30, 2006 9:20 am
Location: Flyin' thru "da cloud" in the MotherShip

Return to Custom Asset Help

Who is online

Users browsing this forum: No registered users

cron