Page 1 of 3

Transparent water

Posted: Mon Sep 12, 2011 1:37 pm
by RedSnappa
I have water that appears transparent in Radiant but is opaque in-game. How do I make it transparent in-game?

Re: Transparent water

Posted: Mon Sep 12, 2011 1:41 pm
by Delirium
Whats the shader your using?

Re: Transparent water

Posted: Mon Sep 12, 2011 1:44 pm
by ValkoVer
first thing, shader work actually? (ie it "behave" like water in game :D ). If yes You need to add different blendfunc.

this is and shader from urt:

Code: Select all

textures/urban_terror2/water1
{
      qer_editorimage textures/liquids/pool3d_3e.tga
      qer_trans .5
      q3map_globaltexture
      surfaceparm trans
      surfaceparm nonsolid
      surfaceparm water
      cull disable
      deformVertexes wave 64 sin .25 .25 0 .5   
      {
         map textures/liquids/pool3d_5e.tga
         blendFunc GL_dst_color GL_one
         rgbgen identity
         tcmod scale .5 .5
         tcmod scroll .025 .01
      }
      {
         map textures/liquids/pool3d_3e.tga
         blendFunc GL_dst_color GL_one
         tcmod scale -.5 -.5
         tcmod scroll .025 .025
      }
      {
         map $lightmap
         blendFunc GL_dst_color GL_zero
         rgbgen identity      
}

   }

Re: Transparent water

Posted: Mon Sep 12, 2011 8:39 pm
by RedSnappa
Shader works. It is water, but it is not transparent.

Code: Select all

textures/greatwall/greatwall_water
{
   qer_editorimage textures/greatwall/greatwall_water.tga
   qer_trans 0.2
   surfaceparm alphashadow
   surfaceparm lightfilter
   surfaceparm nomarks
   surfaceparm nonsolid
   surfaceparm trans
   surfaceparm water
   cull disable

   {
      map textures/greatwall/greatwall_water.tga
      blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
      tcMod turb 0.0 0.1 1.0 0.1
      tcmod scroll 0.01 0.01
   }
   {
      map $lightmap
      blendfunc filter
   }
}

Re: Transparent water

Posted: Mon Sep 12, 2011 8:43 pm
by Delirium
Does the image your uding have an alpha channel?

Try using the blendfunc valkover posted

Re: Transparent water

Posted: Mon Sep 12, 2011 11:05 pm
by RedSnappa
No alpha channel that I'm aware of. I'll try that blendfunc.

Re: Transparent water

Posted: Mon Sep 12, 2011 11:08 pm
by Delirium
blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA blends the alpha channel with white pixels being opaque and black being fully transparent. if no alpha channel is present. no blend :)

either add an alpha channel or experiment with different blends, you could also try my favourite
blendfunc blend
alphaGen const 0.2

Re: Transparent water

Posted: Thu Sep 15, 2011 1:15 am
by RedSnappa
How do I add an alpha channel? I use GIMP 2.4 for all texturing I do.

Re: Transparent water

Posted: Thu Sep 15, 2011 2:02 am
by Delirium
Google

Re: Transparent water

Posted: Sun Sep 18, 2011 12:53 am
by RedSnappa
I got alpha channels to work but my water is still not transparent. I even tried to copy a working example (from ut4_edo_b1) and it still doesn't work. I'm out of ideas...