Author Topic: Wet surface shaders  (Read 5137 times)

CATAHA

  • Posts: 539
  • Turrets: +8/-18
    • Tremulous Lair
Wet surface shaders
« 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?
Russian q3/trem mapping site: http://tremlair.krond.ru/
=[ Boxmaps suck if they have no concept ]=

Ice Trap (InstaGib)

Other maps: A.T.D*S Remake

Kaleo

  • Posts: 2098
  • Turrets: +176/-220
    • KaleoDesign
Re: Wet surface shaders
« Reply #1 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.
Quote from: Stannum
Thou canst not kill that which doth not live,
but you can blow it into chunky kibbles!
I has a cookie, and u can has a cookie, but i no givs u mai cookie...

Zero Ame

  • Posts: 329
  • Turrets: +33/-15
    • NOS
Re: Wet surface shaders
« Reply #2 on: January 15, 2009, 05:43:28 am »
also mite want to add a very faint reflective surface to them

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Re: Wet surface shaders
« Reply #3 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.
« Last Edit: January 15, 2009, 06:50:27 am by Odin »

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Wet surface shaders
« Reply #4 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 :)

CATAHA

  • Posts: 539
  • Turrets: +8/-18
    • Tremulous Lair
Re: Wet surface shaders
« Reply #5 on: January 16, 2009, 04:16:32 pm »
Thanx guys. Got some ideas and still searching better solution.
Russian q3/trem mapping site: http://tremlair.krond.ru/
=[ Boxmaps suck if they have no concept ]=

Ice Trap (InstaGib)

Other maps: A.T.D*S Remake

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Wet surface shaders
« Reply #6 on: January 16, 2009, 05:48:00 pm »
Did you try my shader? Im certain it will fix your problem

Evoc

  • Posts: 127
  • Turrets: +13/-12
Re: Wet surface shaders
« Reply #7 on: January 16, 2009, 07:50:06 pm »
Won't he have to have the textures that are referenced in your shader?
Quote from: ...lying to people about being banned...
Evoc: I JUST GOT BANNED FROM THE FORUMS
Amanieu: lolwut
Thorn: nice
your_face: rofl
Thorn: the less places you can say anything the better

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Wet surface shaders
« Reply #8 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 :)

[RUS] dRiver

  • Posts: 6
  • Turrets: +0/-0
    • http://krond.ru/
Re: Wet surface shaders
« Reply #9 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.
[STAY PARANOID]=