Page 1 of 1

custom-placed decals

Posted: Wed Sep 07, 2005 1:59 am
by lizardkid
I know somebody figured out how to do this, but i cant find the post on it.

So how can i make some blood or bullet decals somewhere on my map?

shader

Posted: Wed Sep 07, 2005 3:39 am
by tltrude
The only thing that makes a decal a decal is this line in the shader.

polygonOffset

It makes the see-through texture sit one pixcel above the normal surface of a brush or patch. The face of a decal textured brush, or patch, overlaps the face of the brush, or patch, you apply it to.

Here is an example of a decal shader.

Code: Select all

textures/decals/cracked2
{
	qer_editorimage textures/decals/cracked2.tga
	polygonOffset
	cull none
	{
		clampmap textures/decals/cracked2.tga
		blendfunc blend
		alphagen vertex
		rgbgen identify
	}
}

Posted: Wed Sep 07, 2005 6:23 am
by bdbodger
run the map and use the decal menu but if you change your bsp you will have to do it again . Bring down the console by hitting the tilde key ( ` ). Then type in “pushmenu decals”. This will bring down the decal console.

Posted: Wed Sep 07, 2005 6:25 am
by diego
I was just trying to get these to work this weekend myself. A lot of the decal shaders that I saw were using the GE 128 alphagen parameter which is really only good for solid black & white alpha channels in your image.

I was also having a hard time getting my lighting to work with the various decal shaders I tried. After a lot of experimenting, I stumbled upon this combination for my shaders:

Code: Select all

textures/praetoria/alpha/decal_sign_03

{	qer_keyword praetoria
	qer_keyword decal
	qer_editorimage textures/praetoria/alpha/decal_sign_03.tga
	surfaceparm rock
	polygonOffset
		{
		map textures/praetoria/alpha/decal_sign_03.tga
		rgbGen identity
		alphagen vertex
		blendFunc blend
	nextbundle
		map $lightmap
		blendFunc blend
	}
}
It's been a while since I've been through the shader manual. I'm not entirely sure if I have redundant code in here or if the behavior of this shader would be the same as the one Tom posted. But I know it works with alpha channels in shades of gray and my lighting.

Posted: Wed Sep 07, 2005 6:31 am
by diego
bdbodger wrote:run the map and use the decal menu but if you change your bsp you will have to do it again . Bring down the console by hitting the tilde key ( ` ). Then type in ?pushmenu decals?. This will bring down the decal console.
I've heard about this technique before. It totally turned me off the idea of using decals and I don't understand why anyone in their right mind would want to add decals to the map in this way knowing that they may have to completely redo it from scratch. Just doesn't seem like useful tool to me. But I guess I shouldn't knock it until I try it, eh?

The handful of decals I've put in my map so far I stick on a brush that is embedded in my walls. I only have to do it once.

Posted: Wed Sep 07, 2005 2:38 pm
by PKM
same here diego. i just make a transparent background .tga file. the image editing program i use is very different from photoshop tools so i create the image and whatever parts i don't want show or see through, i cut them out.

Posted: Wed Sep 07, 2005 6:34 pm
by lizardkid
alright, i figured it out with my inborn genius and piecing apart overlay textures and reading here, thanks guys. :wink:

Posted: Wed Sep 07, 2005 6:51 pm
by Rookie One.pl
Oh, how modest you are. :P

Posted: Wed Sep 07, 2005 7:19 pm
by lizardkid
i know. :P

jk!

Posted: Thu Sep 08, 2005 12:56 am
by bdbodger
Well the decal menu can add decals to a map that is done already like a stock map . I think if you put it on a brush that is 1 unit thick it would be very hard to tell it was not on the wall instead of sinking into the wall that is .