totally lit liquid in darkness


(denizsi) #1

I’ve been trying to make my own liquid shaders, based on some of the SD’s liquid_sd, and I get it working except for lighting. They always show up totally lit even in pitch black darkness, and the same thing is also the case with the SD’s own textures/shaders. Help, anyone?


(chavo_one) #2

Basically what you are after is lightmapped water so you need to add a lightmap stage to your water shader. Here is the water shader from my (soon-to-be-released) map venice. I have lightmapped water in this map.


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

	surfaceparm water
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm lightfilter

	tessSize 256
	cull disable
	deformVertexes wave 100 sin 0 1 .5 .5
	{ 
		map textures/liquids_c1/x.tga
		rgbGen identity
		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		
	}
}

(denizsi) #3

thanks but it didnt work. I guess I need to spend more time studying the shader manual


(chavo_one) #4

Well, post the shader that you tried, and maybe someone can help you.


(SoulRebel) #5

try something like this

textures/xxxx/gma_light
{
	qer_editorimage textures/xxxx/water.tga
	q3map_lightimage textures/lights/light_c01.blend.tga
	q3map_surfacelight 8000
	surfaceparm nomarks
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/xxxx/water.tga
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
	{
		map textures/lights/light_c01.blend.tga
		blendFunc GL_ONE GL_ONE
	}
}

and then make your own “blend” tga with a "light-"alpha-channel