Author Topic: Water issue  (Read 2308 times)

nubcake

  • Posts: 529
  • Turrets: +49/-85
Water issue
« on: November 14, 2008, 08:04:56 am »
Does anyone know how to set the transparency of water from the Gloom2 shader? Here it is:

Quote
textures/bedtime/water
{
   qer_editorimage textures/bedtime/water.jpg
   qer_trans .9
   q3map_lightimage textures/bedtime/water.jpg
//   q3map_surfacelight 50
   q3map_globaltexture

   surfaceparm trans
   surfaceparm nonsolid
   surfaceparm water

   cull disable
   deformVertexes wave 64 sin .25 .25 0 .5   
   {
      map textures/bedtime/water.jpg
      blendFunc GL_dst_color GL_one
      rgbgen identity
      tcmod scale .5 .5
      tcmod scroll .025 .01
   }
   {
      map textures/bedtime/water.jpg
      blendFunc GL_dst_color GL_one
      tcmod scale -.5 -.5
      tcmod scroll .025 .025
   }
   {
      map $lightmap
      blendFunc GL_dst_color GL_zero
      rgbgen identity      
   }
}
At the moment, the water is too clear, i want it to be as dark as the editor water (0.9)

seeeker

  • Posts: 122
  • Turrets: +19/-5
Re: Water issue
« Reply #1 on: November 15, 2008, 03:21:31 am »
Code: [Select]
blendFunc GL_dst_color GL_onethose lines make the texture in the stage be transparent, it makes all white colors be transparent.
You need to make a new image or darken your current one so that it has less white to remove. You dont have a specific way to control transparency from the shader itself afaik.

You can also make a new image with an alpha channel(.tga), then the part of the shader that makes use of the image would be something like this:
Code: [Select]
...
   {
      map textures/YOURMAP/water.tga
      blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPH
      ...
   }
...
« Last Edit: November 15, 2008, 03:24:50 am by seeeker »

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Water issue
« Reply #2 on: November 15, 2008, 06:09:57 am »
KK thanks :D

cactusfrog

  • Posts: 390
  • Turrets: +678/-176
    • tremulous fun server offical site
Re: Water issue
« Reply #3 on: November 17, 2008, 12:57:51 am »
nice job getting shaders working still working on understand them.
« Last Edit: November 17, 2008, 01:02:15 am by cactusfrog »