Tremulous Forum
Media => Mapping Center => Topic started 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:
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)
-
blendFunc GL_dst_color GL_one
those 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:
...
{
map textures/YOURMAP/water.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPH
...
}
...
-
KK thanks :D
-
nice job getting shaders working still working on understand them.