// dersaidin1.shader
//
// dersaidin

// Props

textures/props/box_m04a
{
	surfaceparm woodsteps
	implicitMap -
}

textures/props/box_m04a_sd
{
	surfaceparm woodsteps
	implicitMap -
}

textures/dersaidin/ds-wood1
{
	surfaceparm woodsteps
	implicitMap -
}

textures/dersaidin/door1_cpl
{
	surfaceparm metalsteps
	nomipmaps
	nopicmip
	implicitMap -
}

textures/dersaidin/door2_cpl
{
	surfaceparm metalsteps
	nomipmaps
	nopicmip
	implicitMap -
}

textures/dersaidin/ds-wood2
{
	surfaceparm woodsteps
	implicitMap -
}

textures/dersaidin/ds-board1
{
	surfaceparm woodsteps
	implicitMap -
}

textures/dersaidin/ds-ds-sign_zutritt
{
	surfaceparm metalsteps
	nomipmaps
	nopicmip
	implicitMap -
}

textures/dersaidin/ds-ds-sign_radio
{
	surfaceparm metalsteps
	nomipmaps
	nopicmip
	implicitMap -
}

textures/dersaidin/ametal_m03_nonsolid
{
	surfaceparm metalsteps
	surfaceparm nonsolid
	implicitMap textures/metal_misc/ametal_m03.jpg
	qer_editorimage textures/metal_misc/ametal_m03.jpg
}

// No lightmap

textures/dersaidin/sub1_noLM
{
	surfaceparm metalsteps
	implicitMap textures/props/sub1.jpg
	qer_editorimage textures/props/sub1.jpg
	
	surfaceparm nolightmap
	q3map_vertexScale 1
}

textures/dersaidin/diamond_m03_noLM
{
	surfaceparm metalsteps
	implicitMap textures/metal_misc/diamond_m03.jpg
	qer_editorimage textures/metal_misc/diamond_m03.jpg
	
	surfaceparm nolightmap
	q3map_vertexScale 1
}

textures/dersaidin/afloor_m02_noLM
{
	surfaceparm metalsteps
	implicitMap textures/egypt_floor_sd/afloor_m02.jpg
	qer_editorimage textures/egypt_floor_sd/afloor_m02.jpg
	
	surfaceparm nolightmap
	q3map_vertexScale 2
}

// Doors

textures/dersaidin/mdoor_huge
{
	nomipmaps
	nopicmip
	surfaceparm nomarks
	surfaceparm metalsteps
	implicitMap -
}

textures/dersaidin/mdoor_m02
{
	nomipmaps
	nopicmip
	surfaceparm nomarks
	surfaceparm metalsteps
	
	surfaceparm nolightmap
	q3map_vertexScale 2
	
	implicitMap -
}

// Misc

textures/dersaidin/ds-chicken1
{
	implicitMap -
	surfaceparm metalsteps
	nomipmaps
	nopicmip
	
	surfaceparm nolightmap
	q3map_vertexScale 5
}

textures/dersaidin/rock_grayNEW
{
	implicitMap textures/temperate_sd/rock_grayvar.tga
	qer_editorimage textures/temperate_sd/rock_grayvar.tga
}

// banner textures and shaders all from frostbite
textures/dersaidin/banner
{
	surfaceparm nomarks // added
	qer_editorimage textures/dersaidin/banner.tga
	q3map_bounceScale 0.2

	surfaceparm alphashadow
	deformVertexes wave 10 sin 0 2 0 .2
	cull twosided
	{
		map textures/dersaidin/banner.tga
		alphafunc ge128		
		rgbGen vertex
	}
	{
		map $lightmap
		blendfunc gl_zero gl_one
		rgbgen identity
		depthfunc equal
	}

}

textures/dersaidin/banner_small
{
	surfaceparm nomarks // added
	qer_editorimage textures/dersaidin/banner_small.tga
	q3map_bounceScale 0.5

	surfaceparm alphashadow
	deformVertexes wave 10 sin 0 2 0 .2
	cull twosided
	{
		map textures/dersaidin/banner_small.tga
		alphafunc ge128		
		rgbGen vertex
	}
	{
		map $lightmap
		blendfunc gl_zero gl_one
		rgbgen identity
		depthfunc equal
	}

}

// ======================================================================
// alpha fade terrain shaders
// addapted by dersaidin from examples in tutorial from 
// http://simland.planetquake.gamespy.com/pages/articles/terrain1_1.htm
// ======================================================================

textures/dersaidin/ter_grass
{
	qer_editorimage textures/dersaidin/ter_grass_qer.tga
	surfaceparm landmine
	surfaceparm grasssteps
	
	q3map_nonplanar
	q3map_shadeangle 100
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	q3map_bounceScale 0.2
	       
	{
		map textures/dersaidin/grass_dense1_a.tga	// Primary
		rgbGen identity
	}
	{
		map textures/temperate_sd/master_grass_dirt3.tga	// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_grasspath
{
	qer_editorimage textures/dersaidin/ter_grasspath_qer.tga
	surfaceparm landmine
	surfaceparm grasssteps
	
	q3map_nonplanar
	q3map_shadeangle 100
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	q3map_bounceScale 0.1
     
	{
		map textures/dersaidin/grass_dense1_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/ds-dirt1.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_grasspath_nomines
{
	qer_editorimage textures/dersaidin/ter_grasspath_qer1.tga
	surfaceparm grasssteps
	
	q3map_nonplanar
	q3map_shadeangle 100
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	q3map_bounceScale 0.0
	        
	{
		map textures/dersaidin/grass_dense1_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/ds-dirt1.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_cliffs
{
	qer_editorimage textures/dersaidin/ter_cliffs_qer.tga
	
	q3map_nonplanar
	q3map_shadeangle 80
	q3map_tcGen ivector ( 256 0 0 ) ( 0 0 256 )
	q3map_bounceScale 0.2
      
	{
		map textures/dersaidin/grass_dense1_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/rock_grayvar_a.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_cliffs1
{
	qer_editorimage textures/dersaidin/ter_cliffs1_qer.tga
	
	q3map_nonplanar
	q3map_shadeangle 80
	q3map_tcGen ivector ( 0 256 0 ) ( 0 0 256 )
	q3map_bounceScale 0.2

	{
		map textures/dersaidin/grass_dense1_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/rock_grayvar_a.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_cliffst
{
	qer_editorimage textures/dersaidin/ter_cliffs_qer.tga
	qer_trans 0.70
		
	q3map_nonplanar
	q3map_shadeangle 80
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	q3map_bounceScale 0.2

	{
		map textures/dersaidin/grass_dense1_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/rock_grayvar_a.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_cliffst_grav
{
	qer_editorimage textures/dersaidin/ter_cliffs2_qer.tga
		
	q3map_nonplanar
	q3map_shadeangle 80
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
	q3map_bounceScale 0.2
	        
	{
		map textures/dersaidin/rocky_sand_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/rock_grayvar_a.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_cliffs_smo1
{
	qer_editorimage textures/dersaidin/ter_cliffs4_qer.tga
	
	q3map_nonplanar
	q3map_shadeangle 80
	q3map_tcGen ivector ( 0 256 0 ) ( 0 0 256 )
	q3map_bounceScale 0.2

	{
		map textures/dersaidin/rock_smooth_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/rock_grayvar_a.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/dersaidin/ter_cliffs_smo2
{
	qer_editorimage textures/dersaidin/ter_cliffs4_qer.tga
	
	q3map_nonplanar
	q3map_shadeangle 80
	q3map_tcGen ivector ( 256 0 0 ) ( 0 0 256 )
	q3map_bounceScale 0.2
	qer_trans 0.70

	{
		map textures/dersaidin/rock_smooth_a.tga
		// Primary
		rgbGen identity
	}
	{
		map textures/dersaidin/rock_grayvar_a.tga
		// Secondary
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

// ======================================================================
// sky shader
// Addapted from Goldrush by Dersaidin
// ======================================================================

textures/dersaidin/adlernest_sky
{
	nocompress
	qer_editorimage textures/skies/sky_8.tga
	
	q3map_lightrgb 0.8 0.9 1.0
	q3map_skylight 35 3
	
	q3map_sunExt 1 1 0.9 20 200 60 6 28
	q3map_sunExt .7 .7 .65 9 245 62 3 8
	q3map_sunExt .7 .7 .65 6 290 63 3 8
	q3map_sunExt .7 .7 .65 3 335 64 2 8
	q3map_sunExt .7 .7 .65 1 20 65 1 8
	q3map_sunExt .7 .7 .65 3 65 64 2 8
	q3map_sunExt .7 .7 .65 6 110 63 3 8
	q3map_sunExt .7 .7 .65 9 155 62 3 8
	
	skyparms - 200 -
	surfaceparm nodlight
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm sky
		
	{	fog off
		map textures/skies_sd/goldrush_clouds.tga
		tcMod scale 5 5
		tcMod scroll 0.0015 -0.003
		rgbGen identityLighting
	}
	{	fog off
		map textures/skies/nightsky1.jpg
		tcMod scale 10 10
		blendfunc add
		rgbGen identityLighting
	}
	{
		fog off
		clampmap textures/skies_sd/goldrush_mask.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		tcMod scale 0.956 0.956
		tcMod transform 1 0 0 1 -1 -1 
		rgbGen const ( 0.4 0.4 0.4 ) 
	}
}