sampler2D Tex0;
sampler2D ShininessTex;
samplerCUBE ReflectionTex;
sampler2D RockTex;

float3 Half;

float Timer;

#include "dcShadowMap_P.HLSL"

struct PS_INPUT{
	float4 Diff				: COLOR0;
	float4 Spec				: COLOR1;
    float2 BaseTex			: TEXCOORD0;
	float3 ReflectionTex	: TEXCOORD1;
	float2 RockTex			: TEXCOORD2;
};

struct PS_OUTPUT{
    float4 Color			: COLOR;
};

PS_OUTPUT main(const PS_INPUT Input){
	float4 BaseTexColor = tex2D(Tex0, Input.BaseTex);
	float4 ShininessColor = tex2D(ShininessTex, Input.BaseTex);
	float3 ReflectionColor = texCUBE(ReflectionTex, Input.ReflectionTex);
	float4 RockColor = tex2D(RockTex, Input.RockTex);

	float4 TexColor = BaseTexColor * Input.Diff;
	TexColor.rgb += (ReflectionColor + (Input.Spec * 2)) * ShininessColor;
	TexColor.rgb += lerp(0, RockColor.rgb, RockColor.a * 0.5f);

	PS_OUTPUT Out;
	Out.Color = TexColor;
	return Out;
}
