// these are shaders for alphamod blending
// and i will use the new foliage models i made to effect.
//
// this is just a test map****
// raybanb@gmail.com

textures/terrain_magic/base
{
	nopicmips
	q3map_lightmapaxis z
	q3map_lightmapmergable
	q3map_nonplanar
	q3map_shadeangle 80	// 135 is also good.. some ppl use lower like 80-90...
	q3map_forcemeta
	//q3map_tcMod rotate 33
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
}

// using temperate_sd - road_bigpuddle.tga for road, only need 2 blends.. this to dirt3
//
textures/terrain_magic/magic_road
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_road.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/road_bigpuddle.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/terrain_magic/magic_dirt
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_dirt.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/dirt3.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}


textures/terrain_magic/magic_road_dirt // this is our slope off the road, no foliage here...
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_road_dirt.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/road_bigpuddle.tga
		rgbGen identity
	}
	{
		map textures/temperate_sd/dirt3.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

// using temperate_sd - grass_dense1 and master_grass_dirt3
//
textures/terrain_magic/magic_grass
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_grass.tga


	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/grass_dense1.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}


textures/terrain_magic/magic_mountain
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_mountain.tga



	{
		map textures/textures_magic/magic_mountain.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}


textures/terrain_magic/magic_mountain_grass	
{	
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_mountain_grass.tga


	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/textures_magic/magic_mountain.tga
		rgbGen identity
	}
	{
		map textures/temperate_sd/grass_dense1.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/terrain_magic/magic_mountain_moss	
{	
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_mountain_moss.tga

	

	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/textures_magic/magic_mountain.tga
		rgbGen identity
	}
	{
		map textures/textures_magic/moss.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/terrain_magic/magic_mountain_dirt  
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_mountain_dirt.tga


	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/dirt3.tga
		rgbGen identity
	}
	{
		map textures/textures_magic/magic_mountain.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/terrain_magic/magic_dirt_grass  
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_dirt_grass.tga

	

	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/dirt3.tga
		rgbGen identity
	}
	{
		map textures/temperate_sd/grass_dense1.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}


textures/terrain_magic/glinsing
{
	qer_editorimage textures/terrain_magic/glinsing.jpg
	{
		map textures/textures_magic/water1.tga
		tcmod scale -.25 -.25
		tcmod scroll .1 .04
		rgbgen wave sin .75 0 .5 2
	}
	{
		map textures/textures_magic/water1.tga
		blendFunc GL_one GL_ONE
		tcmod scale .25 .25
		tcmod scroll .1 .1
		rgbgen wave sin .75 0 0 2
	}
	{
		map textures/textures_magic/k_wall18.tga
		blendFunc GL_one GL_src_color
		rgbgen identity
	}
	{
		rgbGen identity
		map $lightmap
		blendfunc gl_dst_color gl_zero
	} 
}

textures/textures_magic/water
{
	nocompress
	nopicmip
	qer_editorimage textures/textures_magic/water.tga
	qer_trans .5
	q3map_globaltexture
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm water
	surfaceparm nomarks
	cull disable
	deformVertexes wave 512 sin 0.5 0.5 0.75 0.2
	//waterfogvars ( 0.6 0.7 0.8 ) 1000
	
	{
		fog on
		map textures/textures_magic/water.tga
		blendFunc add
		tcGen vector ( 0.00045 0 0 ) ( 0 0.00045 0 )
		tcmod turb 0.04 0.02 0 0.05
	}

	{
		map $lightmap
		blendFunc filter
		rgbGen identity
		alphaGen vertex
	}
}


textures/textures_magic/k_wall18
{
	
	q3map_nonplanar
	q3map_shadeAngle 60
	q3map_tcGen ivector ( 0 512 0 ) ( 0 0 -512 )
	q3map_lightmapAxis x
	q3map_lightmapmergable
	surfaceparm gravelsteps
	{
		map textures/textures_magic/k_wall18.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/textures_magic/dripping_water
{
	cull none
	nomipmaps
	nopicmip
	{
		map textures/textures_magic/dripping_water.tga
		blendfunc blend
		alphagen vertex
	}
}


textures/textures_magic/waterfall1
{
	qer_editorimage textures/textures_magic/waterfall1.tga
	qer_trans 0.7
	surfaceparm nolightmap
	surfaceparm nonsolid
	surfaceparm trans
	cull disable
	sort 16
	deformVertexes wave 100 sin 0 1 0 1.5
	{
		map textures/textures_magic/waterfall1.tga 
		blendfunc blend
		tcMod scroll 0 -1
		alphaGen Vertex
	}
}

textures/common/spiegel
{
	qer_editorimage textures/common/spiegel.tga
	surfaceparm nolightmap
	portal
  
	{
		map textures/common/spiegel.tga
		blendfunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
		depthWrite
	}
       
        

}

textures/terrain_magic/magic_concrete_fence	
{	
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_concrete_fence	.tga

	
	{
		map textures/textures_magic/concrete.jpg
		rgbGen identity
	}
	{
		map textures/alpha/mesh_c02.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/terrain_magic/mountain_moss  
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/mountain_moss.tga


	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/textures_magic/magic_mountain.tga
		rgbGen identity
	}
	{
		map textures/textures_magic/moss.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/terrain_magic/sand_mountain  
{
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/sand_mountain.tga


	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/textures_magic/magic_mountain.tga
		rgbGen identity
	}
	{
		map textures/magic_ground/sea_ground.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/terrain_magic/magic_grass_mountain	
{	
	q3map_baseshader textures/terrain_magic/base
	qer_editorimage textures/terrain_magic/magic_grass_mountain.tga

	q3map_foliage models/rayban_foliage/w_grass_foliage1.md3  1 48 0.1 2
	q3map_foliage models/rayban_foliage/w_grass_foliage2.md3  1.1 48 0.1 2
	q3map_foliage models/rayban_foliage/w_grass_foliage3.md3  1 48 0.1 2

	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/grass_dense1.tga
		rgbGen identity
	}
	{
		map textures/textures_magic/magic_mountain.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

textures/wezelkrozum_wall/wall1
{
        qer_editorimage textures/wezelkrozum_wall/wall1.tga // texture shown in the editor.
	{
		map textures/wezelkrozum_wall/wall1.tga	// original texture.
		rgbGen identity
	}

	{
		map textures/wezelkrozum_wall/wall1_detail.tga
		blendFunc GL_DST_COLOR GL_SRC_COLOR // blends the detailed texture on the original texture
		detail               // this command tells its a detailed texture, players can turn detailed textures off if they have problems / lag.

		tcMod scale 2 2 //scale the texture 2 times the resolution (2 pixels detail in 1 pixel original texture).
	}

}

