Shader color - water


(Igloo) #1

Hi there,

Is there any way I can change the color of water? I’m using the shader of oasis-pure water but I would like to darken it a little bit (rather set an RGB color for it). Actually, I had searched for information without positive results.

Sorry if it was already answered.

Thanks.

Greetings,
Igloo


(stealth6) #2

here’s an example to change the color with tobruk walls, so you could apply the same thing for oasis water I guess?
Well I’m not sure if you want to use RGB or not

textures/test/tobrukgrey
{
	qer_editorimage textures/tobruk_wall_sd/tobruk_wall_base1.tga
      {
		map textures/tobruk_wall_sd/tobruk_wall_base1.tga
		rgbGen const ( 0.258 0.258 0.258 )
		// 66 66 66
      } 
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

Maybe something like this for red water?


textures/liquids_sd/siwa_water
{
	nocompress
	qer_editorimage textures/liquids_sd/siwa_water.tga
	qer_trans .5
	q3map_globaltexture
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm water
	surfaceparm nomarks
	cull disable
	nopicmip
	nofog

	waterfogvars ( 0.11 0.13 0.15 ) 0.2
		{ 
		fog on
		map textures/liquids_sd/siwa_water.tga
		blendFunc blend
		alphaFunc GE128
		depthWrite
		rgbgen const ( 1 0 0 )
		tcmod scale 0.5 0.5
		tcmod scroll -.02 .001
	}
	
	{ 
		fog on
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.3 0.02 0 0.25 
		tcmod scale 0.01 0.01
		tcmod scroll -.001 -.0002
	}
	
	{ 
		fog on
		map textures/liquids_sd/seawall_ripple1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.1 0.03 0 0.4
		tcmod scale 1 1
		tcmod scroll -.005 -.001
	}
	{ 
		fog on
		map textures/liquids_sd/siwa_shimshim1.tga
		blendFunc GL_ONE GL_ONE
		rgbGen wave sin 0.4 0.02 0 0.3
		tcmod transform 0 1.5 1 1.5 2 1
		tcmod scroll .005 -.001
	}
}


(Igloo) #3

Yes, it is a thing (rgbGen const) I’ve been looking for. But also, which command changes the intensity of a texture? I choose a color and then need to reduce lighting - again, I can’t find it myself in any q3 shader guide, but guess it exists.


(stealth6) #4

not sure about intensity? But if you mean it gives light then maybe this:
q3map_surfaceLight