Transparent water

Having a problem with a shader or texture
User avatar
Delirium
Posts: 366
Joined: Sat Aug 27, 2011 8:37 am
Location: Auckland, New Zealand

Re: Transparent water

Post by Delirium »

if your texture has an alpha channel then this will do

Code: Select all

textures/textures/PATH_TO_YOUR_TEXTURE/water
{
   qer_editorimage textures/PATH_TO_YOUR_TEXTURE/YOURTEXTURE.tga
   qer_trans 0.6
   surfaceparm trans
   surfaceparm nonsolid
   surfaceparm water
   surfaceparm nolightmap
   surfaceparm nomarks
   cull none
   {
      map textures/PATH_TO_YOUR_TEXTURE/YOURTEXTURE.tga
      alphagen vertex
      blendfunc blend
      tcmod scroll 0 -0.01
      tcmod turb 0 0.5 0.75 0.02
   }
}


if not your not doing it right. this one WONT need an alpha channel and should work

Code: Select all

textures/textures/PATH_TO_YOUR_TEXTURE/water2
{
   qer_editorimage textures/PATH_TO_YOUR_TEXTURE/YOURTEXTURE.tga
   qer_trans 0.6
   surfaceparm trans
   surfaceparm nonsolid
   surfaceparm water
   surfaceparm nolightmap
   surfaceparm nomarks
   cull none
   {
      map textures/PATH_TO_YOUR_TEXTURE/YOURTEXTURE.tga
      alphagen const 0.4
      blendfunc blend
      tcmod scroll 0 -0.01
      tcmod turb 0 0.5 0.75 0.02
   }
}
Image

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

Re: Transparent water

Post by RedSnappa »

I have qer_trans 0.5 in my shader. Does it have to be greater than 0.5 to work?
[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 »

RedSnappa wrote:I have qer_trans 0.5 in my shader. Does it have to be greater than 0.5 to work?

qer_trans 0.5 means its transparent in GTK with 50% transparency
Image

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

Re: Transparent water

Post by RedSnappa »

So anything beginning with qer only affects the display in Radiant and has no effect 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 »

Yes
Image

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

Re: Transparent water

Post by RedSnappa »

It still doesn't work. I wonder if something could be wrong with the .tga file itself? Maybe I have to delete every .pk3 that has a copy of the shader in it.
[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

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

Re: Transparent water

Post by RedSnappa »

OK, I have transparent water using your shader. It is just barely transparent though. How do I adjust the transparency?
[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 »

Which blendfunc did you use?
Image

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

Re: Transparent water

Post by RedSnappa »

blendfunc blend, as per your instructions.

I have tested the shader and textures used in edo for the water in that map, and they work on my map. I think I will play around with them as well and see if I can get exactly what I want that way. Here is the part I am using (and I don't fully understand it):

Code: Select all

textures/hedo/water2
{
   qer_editorimage textures/hedo/clear_ripple32.jpg
   qer_trans .6
   q3map_globaltexture
   surfaceparm trans
   surfaceparm nonsolid
   fogparms ( .1 .2 .2 ) 1512
   surfaceparm water
   cull disable
   tessSize 64
   deformVertexes wave 64 sin 0 1 0 .3
   {
      map textures/hedo/env/reflejo3.jpg
      blendFunc add
      tcGen environment
   }
   {
      map textures/hedo/pmarron.tga
      blendFunc GL_dst_color GL_one
      rgbgen identity
      tcmod scale .5 .5
      tcmod turb 1 0.1 0.1 0.06
      tcmod transform 0 1.5 1 1.5 2 1
      tcmod scroll .01 .01
   }
   {
      map textures/hedo/agua4.jpg
      blendFunc GL_dst_color GL_one
      rgbgen identity
      tcmod scale .5 .5
      tcmod turb 1 0.05 0.1 0.04
      tcmod scroll .02 .02
   }
   {
      map textures/hedo/agua3.jpg
      blendFunc GL_dst_color GL_one
      rgbgen identity
      tcmod scale .5 .5
      tcmod turb 1 0.2 0.1 0.08
      tcmod scroll 0 0.03
   }
}
[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 »

Add this under blendfunc blend;
alphaGen const 0.5

0.5 meaning 50% opaque 1 being fully opaque and 0 being fully transparent
Image

Post Reply