Transparent water

Having a problem with a shader or texture
RedSnappa
Posts: 323
Joined: Sun Aug 21, 2011 12:10 pm
Location: North Carolina (USA)

Transparent water

Post by RedSnappa »

I have water that appears transparent in Radiant but is opaque in-game. How do I make it transparent in-game?
[LCDLC]Snappa
LCDLC Mapmaking Dept.
Maps finished: Hellhouse, Sorry, Worrior 1-20
Maps modded: CubeOrigin
Maps in release candidate: Blockforts, Cannons 1, Hotzone, Icecastle
Maps in beta: Arctica, Cannons 2, Cerulean-River, Igloo, Skygarden, Spacestation
Maps in alpha: Merlin, Totem

User avatar
Delirium
Posts: 366
Joined: Sat Aug 27, 2011 8:37 am
Location: Auckland, New Zealand

Re: Transparent water

Post by Delirium »

Whats the shader your using?
Image

User avatar
ValkoVer
Posts: 176
Joined: Mon Aug 22, 2011 11:01 am
Location: Poland

Re: Transparent water

Post 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      
}

   }

RedSnappa
Posts: 323
Joined: Sun Aug 21, 2011 12:10 pm
Location: North Carolina (USA)

Re: Transparent water

Post 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
   }
}
[LCDLC]Snappa
LCDLC Mapmaking Dept.
Maps finished: Hellhouse, Sorry, Worrior 1-20
Maps modded: CubeOrigin
Maps in release candidate: Blockforts, Cannons 1, Hotzone, Icecastle
Maps in beta: Arctica, Cannons 2, Cerulean-River, Igloo, Skygarden, Spacestation
Maps in alpha: Merlin, Totem

User avatar
Delirium
Posts: 366
Joined: Sat Aug 27, 2011 8:37 am
Location: Auckland, New Zealand

Re: Transparent water

Post by Delirium »

Does the image your uding have an alpha channel?

Try using the blendfunc valkover posted
Image

RedSnappa
Posts: 323
Joined: Sun Aug 21, 2011 12:10 pm
Location: North Carolina (USA)

Re: Transparent water

Post by RedSnappa »

No alpha channel that I'm aware of. I'll try that blendfunc.
[LCDLC]Snappa
LCDLC Mapmaking Dept.
Maps finished: Hellhouse, Sorry, Worrior 1-20
Maps modded: CubeOrigin
Maps in release candidate: Blockforts, Cannons 1, Hotzone, Icecastle
Maps in beta: Arctica, Cannons 2, Cerulean-River, Igloo, Skygarden, Spacestation
Maps in alpha: Merlin, Totem

User avatar
Delirium
Posts: 366
Joined: Sat Aug 27, 2011 8:37 am
Location: Auckland, New Zealand

Re: Transparent water

Post 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
Image

RedSnappa
Posts: 323
Joined: Sun Aug 21, 2011 12:10 pm
Location: North Carolina (USA)

Re: Transparent water

Post by RedSnappa »

How do I add an alpha channel? I use GIMP 2.4 for all texturing I do.
[LCDLC]Snappa
LCDLC Mapmaking Dept.
Maps finished: Hellhouse, Sorry, Worrior 1-20
Maps modded: CubeOrigin
Maps in release candidate: Blockforts, Cannons 1, Hotzone, Icecastle
Maps in beta: Arctica, Cannons 2, Cerulean-River, Igloo, Skygarden, Spacestation
Maps in alpha: Merlin, Totem

User avatar
Delirium
Posts: 366
Joined: Sat Aug 27, 2011 8:37 am
Location: Auckland, New Zealand

Re: Transparent water

Post by Delirium »

Google
Image

RedSnappa
Posts: 323
Joined: Sun Aug 21, 2011 12:10 pm
Location: North Carolina (USA)

Re: Transparent water

Post 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...
[LCDLC]Snappa
LCDLC Mapmaking Dept.
Maps finished: Hellhouse, Sorry, Worrior 1-20
Maps modded: CubeOrigin
Maps in release candidate: Blockforts, Cannons 1, Hotzone, Icecastle
Maps in beta: Arctica, Cannons 2, Cerulean-River, Igloo, Skygarden, Spacestation
Maps in alpha: Merlin, Totem

Post Reply