Tremulous Forum

Media => Mapping Center => Topic started by: CATAHA on January 14, 2009, 09:19:38 pm

Title: Wet surface shaders
Post by: CATAHA on January 14, 2009, 09:19:38 pm
Is it possible make such shaders? Want make wet walls in sewers but still cant imagine what shader stages in what order i need. -_-
Any ideas?
Title: Re: Wet surface shaders
Post by: Kaleo on January 15, 2009, 04:57:31 am
Your best bet would probably be to make a rather watery-looking environment map and applying it to your texture.
Title: Re: Wet surface shaders
Post by: Zero Ame on January 15, 2009, 05:43:28 am
also mite want to add a very faint reflective surface to them
Title: Re: Wet surface shaders
Post by: Odin on January 15, 2009, 06:45:34 am
Is it possible make such shaders? Want make wet walls in sewers but still cant imagine what shader stages in what order i need. -_-
Any ideas?
Something like this is extremely difficult to do on a game engine such as Quake3(which Tremulous is based off of). You could create a texture for each surface you want to be shiny, and use alphaGen lightingSpecular to cause it to brighten the surface when you move around it. You'll need to use a blendFunc that blends with the alpha channel(GL_DST_ALPHA/GL_SRC_ALPHA and their inverse operators) to see it, limiting your choices for different effects somewhat. It needs to blend on top of the base texture(off the top of my head, blendFunc GL_SRC_ALPHA GL_ONE seems to work).

Note also that alphaGen lightingSpecular is rather slow on older machines, on top of it only modifying the alpha channel of a texture and even then only at the vertices for the surface it is placed on. Because of this is will look like a gradient(for an example of vertex lighting, try turning on r_vertexLighting). It will not, by any means, look like this (http://www.zanir.szm.sk/dx/obrazky/016_Per_Pixel_Lighting_big.jpg).
Title: Re: Wet surface shaders
Post by: nubcake on January 15, 2009, 07:13:05 am
This is the shader I use for my map Reise
Quote
textures/Reise/waterbricks
{
   q3map_nonplanar
   q3map_shadeangle 120
   qer_editorimage textures/Reise/wall_1024_tex1_05.tga
   {
      map textures/Reise/water1.tga
      tcmod scale -.25 -.25
      tcmod scroll .1 .04
      rgbgen wave sin .75 0 .5 2
   }
   {
      map textures/Reise/water1.tga
      blendFunc GL_one GL_ONE
      tcmod scale .25 .25
      tcmod scroll .1 .1
      rgbgen wave sin .75 0 0 2
   }
   {
      map textures/Reise/wall_1024_tex1_05.tga
      blendFunc GL_one GL_src_color
      rgbgen identity
   }
   {
      rgbGen identity
      map $lightmap
      blendfunc gl_dst_color gl_zero
   }
}

This will give your texture a nice looking surface with animated water texture 'shining' off of it :)
Title: Re: Wet surface shaders
Post by: CATAHA on January 16, 2009, 04:16:32 pm
Thanx guys. Got some ideas and still searching better solution.
Title: Re: Wet surface shaders
Post by: nubcake on January 16, 2009, 05:48:00 pm
Did you try my shader? Im certain it will fix your problem
Title: Re: Wet surface shaders
Post by: Evoc on January 16, 2009, 07:50:06 pm
Won't he have to have the textures that are referenced in your shader?
Title: Re: Wet surface shaders
Post by: nubcake on January 17, 2009, 01:52:28 am
No, he just needs the texture he wants the water to reflect off (any) and the water texture from karith :)
Title: Re: Wet surface shaders
Post by: [RUS] dRiver on January 22, 2009, 01:18:08 pm
Yep, i tried and that i can say... Seems i need to play with environment maps, bcaus really 'wet' surface changin when you moving around. =) when you standing you see static 'overlighted' places around texture. Still trying get some result.