Alpha channel flashlight shadows

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

Alpha channel flashlight shadows

Postby Text_Fish on Sun Jul 10, 2011 1:09 pm

Is it possible to have a texture with an alpha channel that casts a shadow when the L4D2 flashlight passes through it?

I'm looking for an effect like this but using the torch as a lightsource instead of (or even in addition to) the map lights: http://www.interlopers.net/tutorials/27738

I'm not averse to making a prop, although I would prefer just sticking a texture on a brush!

Thanks.
Mappers Top Tip #548
Lighting: The arrangement, hue and intensity of one or multiple light sources.
Lightning: A dazzling discharge of electric sparks in the atmosphere, often preceding thunder.
User avatar
Text_Fish
Been Here A While
Been Here A While
 
Joined: Tue Jul 21, 2009 8:41 am
Location: Bristol, UK

Re: Alpha channel flashlight shadows

Postby dark0r on Sun Jul 10, 2011 2:13 pm

It should work already, have you tried yet?
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: Alpha channel flashlight shadows

Postby Dives on Sun Jul 10, 2011 5:24 pm

Absolutely. The brush just needs to be func_detail.
User avatar
Dives
May Contain Skills
May Contain Skills
 
Joined: Sat Feb 28, 2009 9:54 pm
Location: Moorpark, CA

Re: Alpha channel flashlight shadows

Postby Text_Fish on Sun Jul 10, 2011 6:22 pm

Hrmm. Thanks for the suggestion Dives, but it doesn't seem to work.

Image
That's just a testbox with a simple homemade alpha texture on a func_detail. There's a spotlight shining through it as well as my flashlight and the walls on the farside have a lightmap scale of 2.

Edit: I should probably also mention that the texture is repeated six times, so none of those "Joe"'s are shadows.

Does the VMT need any more info than:

Code: Select all
"LightmappedGeneric"
{
   "$basetexture" "Joe/joetest"
   "$translucent" 1
   "$nocull" 1
}

?

Cheers.
Mappers Top Tip #548
Lighting: The arrangement, hue and intensity of one or multiple light sources.
Lightning: A dazzling discharge of electric sparks in the atmosphere, often preceding thunder.
User avatar
Text_Fish
Been Here A While
Been Here A While
 
Joined: Tue Jul 21, 2009 8:41 am
Location: Bristol, UK

Re: Alpha channel flashlight shadows

Postby dark0r on Sun Jul 10, 2011 6:37 pm

Try adding these to your VMT:
Code: Select all
"$AlphaTest" "1"
"$AlphaTestReference" "0.3"
"$AllowAlphaToCoverage" "1"


EDIT: also, keep it as a func_detail, so then it doesn't cast a shadow itself
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: Alpha channel flashlight shadows

Postby Text_Fish on Sun Jul 10, 2011 7:00 pm

Hmm. Thanks dark0r but that doesn't seem to fix it either. Maybe I'll go down the prop route when I've recharged my patience!
Mappers Top Tip #548
Lighting: The arrangement, hue and intensity of one or multiple light sources.
Lightning: A dazzling discharge of electric sparks in the atmosphere, often preceding thunder.
User avatar
Text_Fish
Been Here A While
Been Here A While
 
Joined: Tue Jul 21, 2009 8:41 am
Location: Bristol, UK

Re: Alpha channel flashlight shadows

Postby Dives on Sun Jul 10, 2011 7:53 pm

Oops sorry I forgot, it can't be used with $translucent, only $alphatest
User avatar
Dives
May Contain Skills
May Contain Skills
 
Joined: Sat Feb 28, 2009 9:54 pm
Location: Moorpark, CA

Re: Alpha channel flashlight shadows

Postby Text_Fish on Sun Jul 10, 2011 8:28 pm

Hahah! Removing $translucent totally worked, thank you so much!
Mappers Top Tip #548
Lighting: The arrangement, hue and intensity of one or multiple light sources.
Lightning: A dazzling discharge of electric sparks in the atmosphere, often preceding thunder.
User avatar
Text_Fish
Been Here A While
Been Here A While
 
Joined: Tue Jul 21, 2009 8:41 am
Location: Bristol, UK

Return to Custom Asset Help

Who is online

Users browsing this forum: No registered users