PDA

View Full Version : Shader question


Garland
06-29-2002, 07:43 AM
In a map I'm trying to make, I'm trying to make everything look as though it has a high quality sheen. Sadly, I don't want to try and make everything reflective and thus bog down the system needlessly.

I'm not sure about the technical term for this effect, but I'm wanting to make a faux environment map. Have a shader with the top texture (are they called layers or just texture passes?) alpha blended to look like a gloss, but move depending on the player's perspective.

Kind of like a sky texture, but I only want it applied to layer/pass in the shader. so the rest of the texture stays static and the "gloss" layer has the perspective effect.

That's about the best I can describe it, since I don't know the technical term for it. Sorry if it doesn't make sense. Hehe.

-Garland

silverwest
06-29-2002, 02:29 PM
*i'm not sure about this*

try taking the shader /tests/mirror_floor2

copy out the section about the third texture...i think that's what causes the sheen on the mirror floor. you can probably add this to your other shaders.

Xcom
06-29-2002, 03:34 PM
Hm, imo, environment maps suck in q3 engine. If I understand you correctly you don't want real reflection.

So, a shader might look smth like this:

path/texture
{
{
map $lightmap
}
{
map path/texture
blendFunc GL_DST_COLOR GL_ZERO
}
{
//this is where your sky goes
map path/texture2
blendFunc GL_ONE GL_ONE
tcGen environment
}
}


Be warned, results may be ugly :D

Garland
06-30-2002, 02:28 AM
Heh, I should have figured to environment map I'd end up using the "environment" portion of the code.. didn't know the command for it though.

tcGen enviroment, eh? Might be ugly, but I'll be able to put it onto a few more surfaces than reflection.

Might end up being ugly, but I'll see if I can't make it look half decent. ;) :D

Thanks for the help you two!

-Garland

Garland
06-30-2002, 05:57 AM
This is EXACTLY what I wanted, thanks Xcom!

-Garland

Xcom
06-30-2002, 06:01 AM
Glad it worked.