//--- water
// de base texture
textures/UJE_00/water_base
{
//	q3map_backshader textures/UJE_00/water_back
//	q3map_cloneshader textures/UJE_00/water_back

	nocompress
	qer_editorimage textures/UJE_00/c1_128.tga
	qer_trans .40

	q3map_globaltexture
	q3map_nonplanar
	q3map_nofog

	surfaceparm water
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm lightfilter //zichtbare  texture tint op ondergrond  vanuit onder water
//	surfaceparm pointlight

//	cull twosided
//	cull none

//	tessSize 512
//	deformVertexes wave 224 sin 0 3 0.5 0.23
}

// het water-oppervlak, gezien vanaf boven uit het water
textures/UJE_00/water
{
	q3map_baseshader textures/UJE_00/water_base

	qer_editorimage textures/UJE_00/c1_128.tga

//	q3map_backshader textures/UJE_00/water_back
//!	q3map_cloneShader textures/UJE_00/water_back

	cull none

	tessSize 512
	deformVertexes wave 224 sin 0 3 0.5 0.23

	{
		animMap 9 textures/UJE_00/c1_128.tga textures/UJE_00/c2_128.tga textures/UJE_00/c3_128.tga textures/UJE_00/c4_128.tga textures/UJE_00/c5_128.tga textures/UJE_00/c6_128.tga textures/UJE_00/c7_128.tga textures/UJE_00/c8_128.tga

		blendfunc gl_src_alpha gl_one

		alphaGen const 0.25

//		rgbGen identity
		rgbGen vertex
		//tcGen vector ( 0.09 0.11 0 ) ( 0 0.11 0.11 )

		depthWrite

		tcmod scale 0.3 0.25
		tcmod turb 0 0.1 0.3 0.25
		tcmod scroll 0.004 0.003
	}
	{ 
		map textures/UJE_00/water.tga
		rgbGen identity
		blendFunc blend
		alphaGen const 0.85 //0.56
		depthWrite
//		tcmod scale 0.3 0.25
//		tcmod turb 0 0.01 0 0.15
//		tcmod scroll 0.004 0.003
	}
	{
		map textures/UJE_00/uje_env.tga

		blendfunc gl_src_alpha gl_one
		alphaGen const 0.05
		tcGen environment
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbgen identity
		depthFunc equal	
	}
}

// het water-oppervlak, gezien vanuit onderwater
textures/UJE_00/water_back
{
	q3map_baseshader textures/UJE_00/water_base

	q3map_invert	//!

//	cull front

//	sort nearest //rook aan wal is zichtbaar, kijkend vanuit onder-water

	tessSize 512
	deformVertexes wave 224 sin 0 3 0.5 0.23

	{ 
		map textures/UJE_00/water.tga
		rgbGen identity
		blendFunc blend
		alphaGen const 0.56
		depthWrite
		tcmod scale 0.3 0.25
		tcmod turb 0 0.01 0 0.15
		tcmod scroll 0.004 0.003
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbgen identity
		depthFunc equal	
	}
}

// alle 5 resterende zijkanten van de brush
textures/UJE_00/waternodraw
{
	qer_editorimage textures/common/nodrawwater.tga
	qer_trans .5
	
	surfaceparm nomarks
	surfaceparm nodraw
	surfaceparm nonsolid
	surfaceparm trans
	surfaceparm water
}

// de mist in het water
//textures/UJE_00/water_fog 
//{ 
//	qer_editorimage textures/UJE_00/water.tga
//	qer_trans 0.5
//
//	surfaceparm trans
//	surfaceparm nonsolid
//	surfaceparm nolightmap
//	surfaceparm pointlight
//	surfaceparm fog
//	fogparms ( 0.05 0.13 0.11 ) 512
//	//fogGen <genFunc> <yOffset> <yScale> <startOffset> <speed>
//	//fogGen sin 0 1 0.60 100
//}
