uniform float4x4 ViewProj; uniform texture2d image; uniform float2 mul_val; uniform float2 add_val; sampler_state textureSampler { Filter = Linear; AddressU = Border; AddressV = Border; BorderColor = 00000000; }; struct VertData { float4 pos : POSITION; float2 uv : TEXCOORD0; }; VertData VSCrop(VertData v_in) { VertData vert_out; vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj); vert_out.uv = v_in.uv * mul_val + add_val; return vert_out; } float4 PSCrop(VertData v_in) : TARGET { return image.Sample(textureSampler, v_in.uv); } technique Draw { pass { vertex_shader = VSCrop(v_in); pixel_shader = PSCrop(v_in); } }