Translucent Problem

Well i have this problem where i need to add translucent to a this part of a model, though whenever i do this a block appears where it shouldn’t be like on these screen:

[img_thumb]http://www.cap-data-storage.comeze.com/data/images/Project-stargate/update/sga/wip4/1.jpg[/img_thumb]

[img_thumb]http://www.cap-data-storage.comeze.com/data/images/Project-stargate/update/sga/wip4/2.jpg[/img_thumb]

Without translucent

[img_thumb]http://www.cap-data-storage.comeze.com/data/images/Project-stargate/update/sga/wip4/3.jpg[/img_thumb]

As you can see the triangle is supposed to be inside the block and not doing like above, so is there any fix with for this ?

This is my vmt:



"Vertexlitgeneric"
{
	"$basetexture" "madman07/stargate/chev_sga"
	"$bumpmap"    "madman07/stargate/chev_sg1_normal"
	"$normalmapalphaenvmapmask" 1
	"$surfaceprop" "metal"
	"$envmap" "env_cubemap"
	"$envmaptint" "[ .1 .1 .1 ]"
	"$envmapconstrast" "1"
	"$model" "1"
	"$translucent" "1"

	"$phong"     "1"
	"$phongexponent"  "22"
	"$phongboost"   "3"
	"$phongfresnelranges"   "[1 9 6]"
	"$phongwarptexture"  "Boba_Fett/shaders/phongwarp"
	"$lightwarptexture"      "Boba_Fett/shaders/lightwarp_white_blue"
	"$phongalbedotint" "1"
	"$halflambert" "1"

	"$rimlight" "1"
	"$rimlightexponent" "12"	
	"$rimlightboost" "0.6"
	"$rimexponent" "1"
	"$rimboost" "0.6"
	"$rimmask" "Boba_Fett/shaders/mask"
}

Well does anyone know a solution for this ?

And other question how does alpha test work can’t seem to figure that out either…

What are you trying to achieve?

$alphatest is used for 0/1 transparency, so it’s not suitable for glass or or semi-transparency.

For glass, you’ll have to use $translucent.This, unfortunately, reveals a flaw in the Source Engine’s alpha-sorting abilities in some situations. You can ease the severity of this by incorporating the $alpha 1 attribute under $translucent. Like this:

“$translucent” “1”
“$alpha” “1”

Thanks for the advice unfortunately it didn’t work, as it would have the same effect like without alpha.

Compile with wither $opaque or $mostlyopaque in the qc.

Problem is i don’t have the original model, so if i would do this i should recompile it and that will fuck it more up :s

I don’t see how recompiling would fuck it up if you leave the rest of the QC intact. All you need to do is slap that new command in then recompile.

Doesn’t $phong break $alphatest and $translucent? Also check to see if the alpha channel of $basetexture isn’t completely black (completely black means opaque, white means 100% translucent/transparent.)

i’ll try to remove phong though dont read anywhere on valve wiki that phong can conflict, though i’ll try

the base is all white as it needs to be shown only the front tip that needs the transparency got a 20% gray on it.

its rly annoying as this problem never occured to me in the last 2 years…

$phong works fine with $translucent, haven’t tried it with $alphatest. Also, black is fully transparent and white fully opaque in an alpha channel.

Weird thing is with alpha test no matter what i do it just don’t transparent anything.

Should i use translucent with alphatest together to make it work ?

$translucent and $alphatest are two sides of the same coin. $translucent is a much higher quality transparency effect, but multiple transparent layers can cause sorting issues. $alphatest is a low-grade transparency, and doesn’t work well with semitransparent textures, but increases performance and can resolve some rendering problems. If you use both, only one’s going to actually take effect, and I’m not sure what determines which. Either way, using both is redundant.

I second compiling the model with $mostlyopaque in the QC.

So if i use alpha test i need to make the black more blacker to make alpha test make any transparency ?

[editline]21st January 2011[/editline]

Recompiled it with these commands, didn’t have any effect sadly.

Scratch that, just give the part you’re making transparent its own separate translucent texture and VMT, and take the translucent commands out of the stone/metal/solid whathaveyou VMT.

The front tip, as you can see on the first 2 pics you see the blue dots coming trough it that i need to create without making the triangle do weird shit.

[editline]21st January 2011[/editline]

Oke i finally know what alpha test does but yea thats not what i need so yea i don’t think there is a solution with this only by recompiling and vmt commands :s

[img_thumb]http://www.cap-data-storage.comeze.com/data/images/bugs/1.jpg[/img_thumb]

This is another good solution, one that I often resort to when mostlyopaque doesn’t solve all my problems.

Can you explain how to make a separate texture and VMT out a single solid texture? I got a model of a gun that uses a single .vtf All i want to do it making the lens in the sight transparent with alpha channeling but Like OP I have rendering problems with $translucent because it affects the entire model.

Open the mesh in a modelling program and assign a copy of the texture to the polies you want to be transparent.

If you guys didn’t notice this was from almost 3 years ago.

Could you tell me how?