textures/acidwdm2/sky_black
{
	surfaceparm noimpact
	surfaceparm nolightmap
	q3map_lightimage textures/acidwdm2/struc_white.tga
	qer_editorimage textures/acidwdm2/sky_black.tga
	q3map_surfacelight 150
	q3map_sun	1 1 1 20 30 90
	skyparms - 512 -
	{
		map textures/acidwdm2/struc_black.tga
	}
}

textures/acidwdm2/acidwdm2_sky
{
	qer_editorimage textures/acidwdm2/acidwdm2_sky.tga
	surfaceparm sky
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm nomarks
	skyparms env/acidwdm2/sky - -
}

textures/acidwdm2/light_white
{
	surfaceparm nolightmap
	surfaceparm nomarks
	q3map_lightimage textures/acidwdm2/struc_white.tga
	qer_editorimage textures/acidwdm2/light_white.tga
	q3map_surfacelight 600
	{
		map textures/acidwdm2/struc_white.tga
	}
}

textures/acidwdm2/ink
{
	q3map_notjunc
	q3map_nonplanar
	q3map_bounce 0.0
	q3map_shadeangle 120
	q3map_texturesize 1 1
	q3map_invert
	q3map_offset -2.5
	
	surfaceparm nolightmap
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nomarks
	
	sort 16
	
	{
		map textures/acidwdm2/struc_black.tga
		rgbGen identity
	}
}

// cubemapped water
textures/acidwdm2/water1
{
	qer_editorimage env/cube03_ny.tga
	q3map_globaltexture
	qer_trans .75
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm water
	surfaceparm nolightmap
	q3map_surfacelight 25
	cull none

	//deformVertexes wave <div> <func> <base> <amplitude> <phase> <freq>
	tesssize 64
	deformVertexes wave 64 sin 1 1 0.25 0.6 


	//for 3d cards supporting cubemaps
	if textureCubeMap
	{
		cubemap env/acidwdm2/water

		//one possible blendfunc
		//blendFunc GL_ONE GL_ONE_MINUS_SRC_COLOR	//shines. Brights underwater

		//another one
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen constant 0.4	//alpha graduated blend
		
		tcMod turb 0.6 0.5 0.5 0.5	//texture 'waves'
	}
	endif

	//the second water pass from the old water1 shader
	//I do this just for showing how to use 'if' in qfusion shaders
	
	if ! textureCubeMap //for 3d cards not supporting cubemaps (older than gf2)
	{ 
			map textures/acidwdm2/water1.tga
			blendFunc GL_dst_color GL_one
			tcmod scale -.5 -.5
			tcmod scroll .02 .02
	}
	endif

	//the last pass from water1 shader
	{
		map $lightmap
		blendFunc GL_dst_color GL_zero
		rgbgen identity		
	}
}

// cubemapped water
textures/acidwdm2/colormadness_water
{
	qer_editorimage env/cube03_ny.tga
	q3map_globaltexture
	qer_trans .75
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm water
	surfaceparm nolightmap
	q3map_surfacelight 25
	cull disable

	//deformVertexes wave <div> <func> <base> <amplitude> <phase> <freq>
	tesssize 64
	deformVertexes wave 64 sin 1 1 0.25 0.6 
	
	//for 3d cards supporting cubemaps
	if textureCubeMap
	{
		cubemap env/acidwdm2/water
		//blendFunc GL_ONE GL_ONE_MINUS_SRC_COLOR
		blendFunc GL_SRC_COLOR GL_ONE_MINUS_SRC_COLOR
		rgbgen identity
		//tcMod turb <base> <amplitude> <phase> <freq>
		tcMod turb 0.6 0.5 0.5 0.5	//texture 'waves'
	}

	//now for 3d cards not supporting cubemaps (older than gf2)
	if ! textureCubeMap
	{
		map textures/acidwdm2/water1.tga
		blendFunc GL_ONE GL_ONE_MINUS_SRC_COLOR
		rgbgen identity
		rgbGen const ( 0.627451 0.627451 0.627451 )
		//tcMod turb <base> <amplitude> <phase> <freq>
		tcMod turb 0.08 0.1 0.1 0.1	//texture 'waves'
		tcMod scroll 0.05 0.04
	}
	endif

	endif
	{
		map *white
		rgbgen vertex
		blendFunc filter
	}
}