Selfillum + Transparency

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

Selfillum + Transparency

Postby Kosire on Fri Nov 12, 2010 4:41 pm

Hello lopers!

I have a problem with my model when using transparency (tried both $transparent and $alphatest) and $selfillum at the same time.

I have a model of a christmas tree, on top of it there is a star and that texture needs transparency using either $transparent or $alphatest. BUT it also needs to glow by it self using $selfillum, problem is when i enable that in the .vmt the transparency gets disabled.

I googled it and found out that it's a known issue in the source engine (http://developer.valvesoftware.com/wiki/$selfillum).

When i was googling i found out that there was another command for transparency named $additive. So I set it to 1 and enabled selfillum and it WORKED!

BUT now is my problem that when using additive there comes a strange box around my texture as seen here.

Image

So guys, any help? How can i make something glow and transparency without having that stupid box around it?

christmastree_star.vmt
Code: Select all
"VertexLitGeneric"
{
   "$basetexture"      "models/props_kosire/christmastree_star"
        "$model"          "1"
   "$additive"      "1"
   "$selfillum"      "1"
   "$nocull"         "1"
   "%keywords"       "xmas2010,kosire"
}
User avatar
Kosire
1337 p0st3r
1337 p0st3r
 
Joined: Sat Mar 07, 2009 7:25 pm
Location: Denmark

Re: Selfillum + Transparency

Postby Kosire on Fri Nov 12, 2010 5:02 pm

Oh snap, I've fixed it! And I've been dealing with this problem for 2-3 days before posting!

So here comes the solution for both models and world brushes:

Change the shader no matter if it's for a brush or model to UnlitGeneric. Then use $alphatest (and not $transparent, that doenst work) and then $selfillum.

Example:
Code: Select all
"UnlitGeneric"
{
   "$basetexture"      "kosire/christmaslights002"
   "$selfillum"      "1"
   "$alphatest"      "1"
   "$nocull"         "1"
   "%keywords"       "xmas2010,kosire"
}

Just remember $model 1 in the vmt if it's for a model.

Image
User avatar
Kosire
1337 p0st3r
1337 p0st3r
 
Joined: Sat Mar 07, 2009 7:25 pm
Location: Denmark

Re: Selfillum + Transparency

Postby Groxkiller585 on Fri Nov 12, 2010 8:19 pm

You don't need selfillum if you used the unlitgeneric shader, because it already does what selfillum does to a lightmapped texture.

Though if I may make a suggestion, you may wanna shrink the star/make the tree larger, ATM is looks too big for the tree.
User avatar
Groxkiller585
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Fri Jul 09, 2010 3:43 pm

Re: Selfillum + Transparency

Postby crazycarl on Sat Nov 13, 2010 1:17 am

That looks awesome, BTW. My bet would be that the background of the texture was not completely black. That would be why the box showed up in additive mode.
crazycarl
Been Here A While
Been Here A While
 
Joined: Tue Jan 12, 2010 9:12 pm

Re: Selfillum + Transparency

Postby Kosire on Sat Nov 13, 2010 12:59 pm

Groxkiller585 wrote:You don't need selfillum if you used the unlitgeneric shader, because it already does what selfillum does to a lightmapped texture.

Though if I may make a suggestion, you may wanna shrink the star/make the tree larger, ATM is looks too big for the tree.


Hm, i doubt it. I can clearly see a difference using $selfillum 1 or 0 on unlitgeneric. Strange.
User avatar
Kosire
1337 p0st3r
1337 p0st3r
 
Joined: Sat Mar 07, 2009 7:25 pm
Location: Denmark

Re: Selfillum + Transparency

Postby Groxkiller585 on Sat Nov 13, 2010 4:06 pm

Well it makes no sense since $selfillum basiclly makes bits of your texture be unlit based on the alpha channel, while the unlitgeneric shader makes the whole texture unlit. In this case the star would be lit both ways in the same way. Unless for whatever reason $selfillum is brighter, though IDK why it would be.
User avatar
Groxkiller585
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Fri Jul 09, 2010 3:43 pm

Re: Selfillum + Transparency

Postby Groxkiller585 on Sun Nov 14, 2010 12:24 am

bekey wrote:it makes it kinda glowy and over saturated too!


It does? I had no idea. Cool to know!
User avatar
Groxkiller585
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Fri Jul 09, 2010 3:43 pm

Return to Custom Asset Help

Who is online

Users browsing this forum: No registered users

cron