Adding "$selfillum" to existing textures

Adding "$selfillum" to existing textures

Re: Adding "$selfillum" to existing textures Posted by Bl1tz on Fri Apr 15th 2005 at 6:45am
Bl1tz
35 posts
Posted 2005-04-15 6:45am
Bl1tz
member
35 posts 14 snarkmarks Registered: Jan 23rd 2005 Occupation: Slacker
Hi.

Tonight I was messing around with my lights.rad
file, and I realized that you can't just have any texture emit light as
long as it's in the .rad file, like in HL1. So I did a little
investigating and found that the .vmt of the texture you want to emit
light needs to have a ' "$selfillum" 1 ' in it. Easy enough right?
Well...not really.

What I did was take the texture I wanted to use
(toxicslime002a) and extract the .vtf from the .gcf, renamed it to
'blitzslime.vtf' and put it in C:\Program
Files\Steam\SteamApps\<user>\half-life 2
deathmatch\hl2mp\materials\customtex along with the modified
toxicslime002a.vtm (now named 'blitzslime.vtm')

So I compiled it, and it's still not working. The
texture showed up in WC, and in the game, but it wasn't emitting light.

Thanks to anyone who can provide a solution or a workaround.
Re: Adding "$selfillum" to existing textures Posted by fishy on Fri Apr 15th 2005 at 8:38am
fishy
2623 posts
Posted 2005-04-15 8:38am
fishy
member
2623 posts 1476 snarkmarks Registered: Sep 7th 2003 Location: glasgow
you'd need to go back to extracting the original vtf, and convert it to a .tga format. then you would need to add an alpha channel to it. the alpha channel should be all black, apart from the areas of it that correspond to the same areas of the rgb channels that you want to illuminate.

here's a pic of a model texture i made,

User posted image

if you look at the top left corner, you will see that's the headlight part of the texture. to make this part of the texture illuminate in game, it need to have an alpha channel, which in this instance looked like this-

User posted image

the final brightness of you texture will depend on how light you make the alpha channel. black in the alpha has no illumination effect, and white will be fullbright. so with the above alpha, my texture would have fullbright headlights, the sidelights would be bright, but not as bright as the headlights, and the speedo/clock would have a slight glow.

User posted image

once you've added the alpha channel, export the image as a 32bit .tga (no compression), and compile it with vtex as normal. the resulting vtf will be ready to accept the $selfillum command.

for the likes of the car, it's a good idea to write two vmt files. one with $selfillum, and one without, so that you have the choice of having the lights on or off. both vmt's can point at the same vtf.
Re: Adding "$selfillum" to existing textures Posted by OtZman on Fri Apr 15th 2005 at 2:58pm
OtZman
1890 posts
Posted 2005-04-15 2:58pm
OtZman
member
1890 posts 218 snarkmarks Registered: Jul 12th 2003 Occupation: Student Location: Sweden
Will a texture with $selfillum spread light on surrounding objects or will it just make the texture itself appear lit up?
Re: Adding "$selfillum" to existing textures Posted by fishy on Fri Apr 15th 2005 at 6:43pm
fishy
2623 posts
Posted 2005-04-15 6:43pm
fishy
member
2623 posts 1476 snarkmarks Registered: Sep 7th 2003 Location: glasgow
just gives the appearance of light. for the car example, adding the texture to the lights.rad wouldn't be the best idea, because there's only a little bit of the texture emitting any light. for textures, like say a piece of coloured n0n-transparent window that has been $selfillum'ed, lights.rad would need an entry to make the texture actually cast any light on the world.
Re: Adding "$selfillum" to existing textures Posted by Bl1tz on Fri Apr 15th 2005 at 10:49pm
Bl1tz
35 posts
Posted 2005-04-15 10:49pm
Bl1tz
member
35 posts 14 snarkmarks Registered: Jan 23rd 2005 Occupation: Slacker
Okay...how do I do this with an existing HL2 texture?

Also, is there an easier/different way to get it to look texture lit
without actually being so? Point lights don't really look correct.
Re: Adding "$selfillum" to existing textures Posted by wil5on on Sat Apr 16th 2005 at 4:20am
wil5on
1733 posts
Posted 2005-04-16 4:20am
wil5on
member
1733 posts 570 snarkmarks Registered: Dec 12th 2003 Occupation: Mapper Location: Adelaide
-Copy the existing textures .vmt, give the vmt a different name but make it point to the same .vtx in the file. Add the $selfillum line into the vmt.

-Not that I'm aware of.
Re: Adding "$selfillum" to existing textures Posted by Bl1tz on Sat Apr 16th 2005 at 5:12am
Bl1tz
35 posts
Posted 2005-04-16 5:12am
Bl1tz
member
35 posts 14 snarkmarks Registered: Jan 23rd 2005 Occupation: Slacker
No, that doesn't work. That's what I did initially. I need to have an alpha channel like fishy said.