Minimal.fx

Aus AquaSoft Wiki
Version vom 30. August 2012, 11:57 Uhr von Steffen.binas (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „uniform extern float4x4 gWVP : WorldViewProjection; uniform extern texture gTexture0; →‎erste Textur: sampler Texture0Sampler = sampler_state { Texture = <g…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springenZur Suche springen

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; } }