Tremulous Forum

Media => Mapping Center => Topic started by: nubcake on November 14, 2008, 08:04:56 am

Title: Water issue
Post by: nubcake 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)
Title: Re: Water issue
Post by: seeeker 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
      ...
   }
...
Title: Re: Water issue
Post by: nubcake on November 15, 2008, 06:09:57 am
KK thanks :D
Title: Re: Water issue
Post by: cactusfrog on November 17, 2008, 12:57:51 am
nice job getting shaders working still working on understand them.