// Just ps1.1 rendering path, not complete effect.
// See bumped.fx

#ifdef ENABLE_PS11_PATH

// Diffuse + specular pass

SPosTex2TanspLHc vsMain11a( SPosTanspTex2 i ) {
	SPosTex2TanspLHc o;
	o.pos = mul( i.pos, mWVP );
	gTangentLH( (SPosTansp)i, mWorld, o.l, o.h );
	o.l = o.l*0.5+0.5;
	o.h = o.h*0.5+0.5;
	o.uv[0] = o.uv[1] = i.uv[0];
	o.uv[2] = i.uv[1];
	return o;
}

half4 psMain11a( SPosTex2TanspLHc i ) : COLOR
{
	half4 col = tex2D( smpBase, i.uv[0] );
	half3 n = tex2D( smpNormal, i.uv[1] )*2-1;
	half3 lmap = tex2D( smpLightMap, i.uv[2] );
	half diff, spec;
	gDiffSpec11( n, i.l*2-1, i.h*2-1, diff, spec );
	col.rgb *= diff*0.5+0.75;
	col.rgb += spec;
	col.rgb *= lmap;
	return col;
}


// Blur factor pass
#include "blur_11FFpath.fx"

technique tecPS11 {
	pass P0 {
		VertexShader = compile vs_1_1 vsMain11a();
		PixelShader = compile ps_1_1 psMain11a();
	}
	pass PBlur {
		BLUR11_PASS
	}
	pass PLast {
		BLUR_RESTORE
	}
}

#endif
