float4x4 World;
float4x4 View;
float4x4 Projection;
float fTimer;
sampler ColorMapSampler : register(s0);
//the texture that will be refracted by the objects
sampler RefractionMap : register(s2);
float3 position;
float WaterLevel;
float Waves;
struct VertexShaderInput
{
float4 Position : POSITION0;
// TODO: add input channels such as texture
// coordinates and vertex colors here.
};
struct VertexShaderOutput
{
float4 Position : POSITION0;
// TODO: add vertex shader outputs such as colors and texture
// coordinates here. These values will automatically be interpolated
// over the triangle, and provided as input to your pixel shader.
};
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
VertexShaderOutput output;
float4 worldPosition = mul(input.Position, World);
float4 viewPosition = mul(worldPosition, View);
output.Position = mul(viewPosition, Projection);
// TODO: add your vertex shader code here.
return output;
}
float4 PixelShader(float2 Tex: TEXCOORD0) : COLOR
{
float4 Color = 0;
//get the diffuse color
//float4 texColor = tex2D(SpriteDiffuse, texCoord);
//position.y = Tex.y;
//Tex.x += sin(fTimer + position.y *50) * 0.002f;
//Tex.y += 0.008f;
Color = tex2D(ColorMapSampler, Tex);
Color.b = 1.0f;
return Color;
//position.x = Tex.x;
//Waves = sin(fTimer + position.x * 5)* 0.022f;
//Waves -= cos(fTimer + position.x * 22)* 0.012f;
//WaterLevel = clamp(WaterLevel + Waves, 0.0f, 1.0f);
//if (position.y > WaterLevel)
//{
//}
//if (position.y > WaterLevel)
//{
//Color.r += (0.1f);
//Color.g += (0.1f);
//Color.b += (0.5f);
//}
}
technique Technique1
{
pass pass0
{
PixelShader = compile ps_2_0 PixelShader();
}
}