struct VS_OUTPUT { float2 TexCoords : TEXCOORD0; float4 Position : POSITION; }; struct VS_INPUT { float2 TexCoords : TEXCOORD0; float4 Position : POSITION; }; float4x4 WorldViewProjection; bool underWater = false; Texture diffuseTexture; sampler textureSampler = sampler_state { Texture = ; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; }; VS_OUTPUT VS (VS_INPUT Input) { VS_OUTPUT Output; Output.Position = mul(Input.Position, WorldViewProjection); Output.TexCoords = Input.TexCoords; return Output; } float4 PS (VS_OUTPUT Input) : COLOR { if(underWater) clip(Input.Position.y); return tex2D(textureSampler, Input.TexCoords) + 0.3f; } technique Scene { pass P0 { VertexShader = compile vs_2_0 VS(); PixelShader = compile ps_2_0 PS(); } }