Page 1 of 1

Make certain parts of a texture glow?

PostPosted: Sun Jun 15, 2014 5:35 pm
by LimestaX
I have been working on a map with a few custom textures, and I want to make a texture $selfillum, but only it self-illuminates the whole texture, so I was wondering if there would be a way to self illuminate specific parts of the texture? I haven't been able to find a specific tutorial on how to do it.

Here is an example, I would like to light up the just the Cyan Parts, can anyone explain to me the process?
Image

Re: Make certain parts of a texture glow?

PostPosted: Sun Jun 15, 2014 6:13 pm
by WhiteDevil
You need to make an alpha channel to your diffuse to tell source what parts of the texture you want to illuminate.
Any decent image software can edit alpha channels.

Re: Make certain parts of a texture glow?

PostPosted: Sun Jun 15, 2014 7:35 pm
by LimestaX
I made this Alpha in photoshop, VTFEdit doesn't auto-create a proper alpha channel with any of the settings I have found, is there a way I can do it in the VMT manually?
Image
Code: Select all
"LightmappedGeneric"
{
   "$basetexture" "cbn/cbn_octile_cy"
   "$surfaceprop" "Metal"
   "$selfillum" 1
   "$alpha" "cbn/cbn_octile_alpha"
   "%keywords" "cbn"
}

Since using alpha like that didn't work I instead used "$alpha" "G", what this did is it took the Green Channel's Alpha and i ended up with this neat affect:
Image
The texture shows up only with a dynamic light shined to it, revealing the texture, with it's alpha channel.
Still, not what I wanted.
So instead I tried without selfillum, same effect.
So then I went a little deeper and tried "$selfillummask" "cbn/cbn_octile_alpha", no affect, what i did then was I re-made cbn/cbn_octile_alpha, with transparency, literally removing the black, no effect.

Any advice? How would I set up Alpha Channels with VTFEdit automatically to detect the black when creating an alpha layer?

Re: Make certain parts of a texture glow?

PostPosted: Mon Jun 16, 2014 6:53 am
by jimonions
I would suggest using the vtf plugin for photoshop so you can set the alpha channel yourself straight from there. I use the one for gimp and it works great, just need to collapse all layers and set a layer mask before export. Not too sure about photoshop though.
Also source will only recognize black as transparent with the $translucent or $alphatest paths.

https://developer.valvesoftware.com/wik ... VTF_Plugin

Re: Make certain parts of a texture glow?

PostPosted: Mon Jun 16, 2014 9:31 am
by [Steve]
im not entirely sure what you mean, are you saying vtfedit doesnt import the alpha channel of your texture correctly?
because it works for me fine.
Just save as a tga from photoshop, then when using vtf edit to import set alpha format to dxt 5.
your alpha should then be the same as in photoshop.

To glow use "$selfillum" "1" which will make the white parts of your alpha channel glow.

Re: Make certain parts of a texture glow?

PostPosted: Mon Jun 16, 2014 6:15 pm
by kraid
I've done a little example.
http://www.mediafire.com/download/fnjx2g5wgx2671w/Sellfillum_test.zip
Inside this pack you will find a .tga with the source image i used, as well as the vtf and vmt of the texture.
Also there's an example map bsp and vmf and a .rad file that enables the texture to actually emit light (texture light).

The .rad needs to be put into the base directory of your game/mod and has to have the same name as the map.
Ofc. you can also open the file with a text editor and put the line into the lights.rad that should be allready there.

The rest of the files i think you know where to put them.

If you want to compile a texture yourself, it has to be saved as 32bit (8 bits per channel RGB=24bit, RGBA=32bit) with an existing alphachannel. You cannot create one automatically.
Also you have to choose one of the vtf formats that include an alphachannel, such as DXT5 (compressed) or BGRA8888 (uncompressed).