foggy/murky water


(=DaRk=CrAzY-NuTTeR) #1

how do i make foggy water? what lines do i add o the shader?

here is my shader for my water

//Textures used to 
textures/death_by_coffeeeee/river
{
	nocompress
	qer_editorimage textures/liquids_sd/sea_bright_na.tga
	q3map_globaltexture
	q3map_foliage models/foliage/splash5.ase 1 64 0.1 2
	q3map_foliage models/foliage/splash4.ase 0.8 64 0.1 2
	q3map_foliage models/foliage/splash3.ase 0.6 64 0.1 2
	q3map_foliage models/foliage/splash2.ase 0.9 64 0.1 2
	q3map_foliage models/foliage/splash1.ase 0.7 64 0.1 2
	q3map_foliage models/foliage/splash0.ase 0.5 64 0.1 2
	surfaceparm trans
	surfaceparm water
	surfaceparm nomarks
	cull disable
	nopicmip

	waterfogvars ( 0.11 0.13 0.15 ) 200

		{ 
		fog on
		map textures/liquids_sd/sea_bright_na.tga
		blendFunc blend
		alphaFunc GE128
		depthWrite
		rgbgen identity
		tcmod scale 0.5 0.5
		tcmod scroll 0.8 0
	}
}

//For when the river is coverd by something, like a bridge for example

textures/death_by_coffeeeee/river_coverd
{
	nocompress
	qer_editorimage textures/liquids_sd/sea_bright_na.tga
	q3map_globaltexture
	surfaceparm trans
	surfaceparm water
	surfaceparm nomarks
	cull disable
	nopicmip

	waterfogvars ( 0.11 0.13 0.15 ) 200

		{ 
		fog on
		map textures/liquids_sd/sea_bright_na.tga
		blendFunc blend
		alphaFunc GE128
		depthWrite
		rgbgen identity
		tcmod scale 0.5 0.5
		tcmod scroll 0.8 0
	}
}

there are 2 parrts there, one for when the water is being hit by rain and one when it isnt, help me


(LaggingTom) #2

Try adding a qer_trans with a value of .2 or something. Experimentation always works! :slight_smile:


(MadJack) #3

qer_* keywords are for Radiant only


(=DaRk=CrAzY-NuTTeR) #4

besides, making it transparent wouldnt solve the fact i need fog


(LaggingTom) #5

from what I thought, that lowers the value of the water’s transparency.

Edit: Do you need the water murky just from the top layer or underwater, too?


(ratty redemption) #6

definitely applies to qer_trans but with -bounce compiles, the radiosity color can be taken from a qer_editorimage, which is why I think, the q3map_lightimage should be used before a qer_editorimage.


(Java.Lang) #7

All the qer_editorimage does is display an image for that particular texture in Radient. It’s not going to pull any information from it’s shader, if it even has any.


(MadJack) #8

I agree with Java, qer_editorimage is only there to tell radiant what texture to use to display in the editor and I doubt any other qer_* keywords affect the compiling process in any way though I might be wrong.

From what I could read/see qer_trans is only used as a transparency indicator inside radiant but I haven’t checked q3map2’s source so you might be right on that ratty.


(Java.Lang) #9

No that too is true, qer_trans will adjust the transparency of a texture inside the editor to simulate translucency.


(chavo_one) #10

Sorry guys, but Ratty is right on this one. If you don’t provide a q3map_lightimage then q3map2 uses qer_editorimage for lighting purposes (lightfilter, alphashadows, radiosity).

A ydnar quote from q3world:

A shader’s light image will default to whatever image is loaded for itself. If a q3map_lightimage is specified and no qer_editorimage is specified and shadername.tga is not found, the light image will be used as the shader image.

Search order:

Shader image: qer_editorimage, .tga, q3map_lightimage.

Light image: q3map_lightimage, Shader image.

As for fog in water, you will need to make two separate shaders one for fog and one for water. Then make two identical brushes and apply the water shader to one, and the fog shader to the other. waterfogvars doesn’t do anything as far as I can tell.

I got lightmapped, foggy water in venice with the following shaders:


textures/liquids_c1/canal_water
{
	nocompress
	qer_editorimage textures/liquids_c1/x.tga
	qer_trans .25
	q3map_globaltexture

	surfaceparm water
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm lightfilter

	tessSize 256
	cull disable
	deformVertexes wave 100 sin 0 2 .5 .25
	{ 
		map textures/liquids_c1/x.tga
		rgbGen identity
		blendFunc blend
		alphaGen const 0.7
		depthWrite
		tcmod scale .5 .5
		tcmod turb 0 0.01 0 0.15
		tcmod scroll .01 .01
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbgen identity
		depthFunc equal	
	}
}

textures/liquids_c1/canal_fog
{
	qer_editorimage textures/liquids_c1/pool3d_5c.tga
        qer_trans 0.5

	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nolightmap
	surfaceparm fog
	fogparms ( 0.18 0.19 0.13 ) 4096
}

(=DaRk=CrAzY-NuTTeR) #11

ok, i tried that but my water is a func_bobing, and the fog for some reason takes over, u have to be really close to actually see the water


(ratty redemption) #12

@chavo_one, thanx for clarifying that for me :slight_smile:

and guys I too thought this was odd, but first noticed it when a red qer_editorimage was bouncing red light off a blue water surface I was testing in rtcw, so I then researched into any official reason for this… just one of those odd little quirks we come across while mapping :wink:

but in all other cases other then light compiles, qer_* do appear to just affect the editor, as we would expect.


(chavo_one) #13

ratty, no prob. just wanted you to get credit. :slight_smile:

ok, i tried that but my water is a func_bobing, and the fog for some reason takes over, u have to be really close to actually see the water

Why is your water a func_bobbing? If you want waves, use deformVertexes.

Also, I forgot to mention that you may need to place the top of the fog brush a few units below the top of the water brush. Weird things can sometimes happen when they are flush. I don’t know what you mean by “takes over”, but it may be related to this. (?)


(ratty redemption) #14

:drink:

Also, I forgot to mention that you may need to place the top of the fog brush a few units below the top of the water brush. Weird things can sometimes happen when they are flush.

I found that aswell in my water tests.


(=DaRk=CrAzY-NuTTeR) #15

what i mean is you cant see the water for the fog


(=DaRk=CrAzY-NuTTeR) #16

ok, everything is sorted now, thanks for all the help