Minimal.fx

Aus AquaSoft Wiki
Wechseln zu: Navigation, Suche

uniform extern float4x4 gWVP : WorldViewProjection; uniform extern texture gTexture0; /* erste Textur */

sampler Texture0Sampler = sampler_state {

 Texture = <gTexture0>;
 MinFilter = LINEAR;
 MagFilter = LINEAR;
 MipFilter = LINEAR;
 AddressU = MIRROR;
 AddressV = MIRROR;

};

struct OutputVS { float4 posH: POSITION0; float2 tex0: TEXCOORD0; };

OutputVS mainVS(float3 pos : POSITION, float2 tex0: TEXCOORD0) { OutputVS outVS;

outVS.tex0 = tex0.xy; // Texturekoordinaten übergeben outVS.posH = mul(float4(pos.xyz, 1.0), gWVP); // Vertexkoordinaten transformieren

return outVS; }

float4 mainPS(float2 tex0: TEXCOORD0) : COLOR {

 return tex2D(Texture0Sampler, tex0);

}

technique technique0 { pass p0 { VertexShader = compile vs_2_0 mainVS(); PixelShader = compile ps_2_0 mainPS(); CullMode = None; FillMode = Solid; } }