Page 1 of 1
How to make underwater areas dark?
Posted: Sat Dec 24, 2011 4:55 pm
by lightmill
Any idea how to achieve realistic looking dark underwater surfaces? Using negative lights is quite awkward and gives bad looking results - I have quite large water area.
Re: How to make underwater areas dark?
Posted: Sat Dec 24, 2011 4:59 pm
by skinmaster
1. make a texture set for underwater, one which darkens and wets the area look via the texture.
2. add a water pass to the textures used there.. a turb..
hey can i have a copy of the water shader you put on your blog?
Code: Select all
//ripplewater modification from vq3 stuff
textures/gregyptctf3/ripplewater4
{
qer_editorimage textures/gregyptctf3/ripplewater4.tga
surfaceparm nonsolid
surfaceparm trans
surfaceparm water
cull disable
qer_trans 0.3
q3map_globaltexture
{
map textures/gregyptctf3/ripplewater4.tga
blendfunc filter
tcMod turb 0.1 0.07 0.1 0.01
tcMod stretch sin 1 0 0 0.1
tcGen environment
}
{
map textures/gregyptctf3/bubbles.tga
blendfunc add
tcMod scale 0.3 0.3
}
{
map textures/gregyptctf3/ripplewater4.tga
blendfunc filter
tcMod turb 0.3 0.06 0.4 0.02
tcMod stretch sin 1 0 0 0.1
}
}
heres a shader for a say bathtile underwater.. im tweaking it now
Code: Select all
//ripplewater modification from vq3 stuff
textures/gregyptctf3/bath
{
qer_editorimage textures/gregyptctf3/pooltyl.tga
{
map textures/gregyptctf3/pooltyl.tga
}
{
map textures/gregyptctf3/bubbles.tga
blendfunc add
rgbGen const ( 0 0 0.501961 )
tcMod turb 0.3 0.06 0.4 0.02 //really slow motion
tcMod stretch sin 1 0 0 0.1
tcMod scale 1 0.4
}
}

bubbles.tga is a red version of the main water texture, used in the main water shader to make it bit bloody, i turn the color dark blue in the second shader and the scaling is because of the wide style of the texture used..
i had the same issue as you, when i got under the water surface the area beneath it was lit and had none of the pretty refractions from the light passing through the water...
Re: How to make underwater areas dark?
Posted: Sat Dec 24, 2011 5:18 pm
by skinmaster
[lvlshot]http://www.rave.ca/en/image/original/441257/[/lvlshot]
ps, slick from common is also a wise underwater doubler on the tyl bushes
Re: How to make underwater areas dark?
Posted: Sat Dec 24, 2011 5:47 pm
by lightmill
Skinmaster thnx, that's quite clever to use separate textures for underwater geometry
The watershader in my blog is from Darkplaces engine, which is not exactly Q3 (it just runs Q3 bsps)
the engine internaly supports refraction\reflection water with normalmaps. If you need it, I can upload textues and shader, mind you they are not that great :/
Re: How to make underwater areas dark?
Posted: Sat Dec 24, 2011 6:53 pm
by skinmaster
just paste the shader here in text, thanks

Re: How to make underwater areas dark?
Posted: Sat Dec 24, 2011 7:12 pm
by themuffinman
You could create a dark fog shader to make underwater areas appear quite dark and have the fog brush roughly the same volume as the water, minus a couple of units from the water surface to avoid zebraing/other issues. You can also tweak the drawing distance or density of the fog as you like. A shader like this should do the trick:
Code: Select all
textures/sfx/waterfog1
{
qer_editorimage textures/sfx/hellfog.tga
surfaceparm trans
surfaceparm nonsolid
surfaceparm fog
surfaceparm nodrop
surfaceparm nolightmap
q3map_globaltexture
q3map_surfacelight 50
fogparms ( 0.125 0.28125 0.375 ) 386
}
The values for fogparms are ( red green blue ) distance. I picked a suitable color and got the RGB for it in Paint Shop Pro, then divided the values by 256.
Re: How to make underwater areas dark?
Posted: Sat Dec 24, 2011 9:00 pm
by skinmaster
chances are that will darken the "see through" part of standing above the water though
Re: How to make underwater areas dark?
Posted: Sat Dec 24, 2011 10:37 pm
by obsidian
You have to be careful how you define shaders in this case. Quake 3 shaders are texture shaders, vs. water surfaces for Dark Places with reflection/refraction are pixel shaders. Two VERY different things.