This scamped shader doesn’t work well for a terrain having steep grades. But, because the shader works in only shader, it’s possible to use for a model which XNA doesn’t allow to access vertex buffers. (It’s impossible to access buffers with the GetData method, because buffers of auto managed models are readonly)
1) Prepares your terrain model having no steep grades.
2) Prepares the shade which takes POSITION.xz for TEXCOORD0.uv. The most simply example;
float4 vPos : POSITION,
float2 vTexCoord0 : TEXCOORD0 )
Output.Position = mul(vPos, WorldViewProj);
Output.TextureUV = vPos.xz * TexScale;
You may add your effects to this.
You may change a effect of a model on your program directy, if you don’t want to make the special custom pipe-line.
This shader is helpful for prototype. Download sample.