1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
| float4x4 worldViewProj : WorldViewProjection;
struct VS_INPUT
{
float3 pos : POSITION;
float2 tex : TEXCOORD0;
};
struct VS_OUTPUT
{
float4 pos : POSITION;
float2 tex : TEXCOORD0;
};
VS_OUTPUT mainVS(VS_INPUT input)
{
VS_OUTPUT vsOut;
vsOut.pos = mul(float4(input.pos, 1), worldViewProj);
vsOut.tex = input.tex;
// vsOut.tex.xy = vsOut.pos.zw;
return vsOut;
}
texture tex0;
sampler2D sample0 =
sampler_state
{
Texture = <tex0>;
/* MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
*/
};
float4 mainPS(float2 tex : TEXCOORD0) : COLOR
{
return tex2D(sample0, tex);
// return tex.x / tex.y;
}
technique technique0 {
pass p0 {
VertexShader = compile vs_3_0 mainVS();
PixelShader = compile ps_3_0 mainPS();
}
} |
float4x4 worldViewProj : WorldViewProjection;
struct VS_INPUT
{
float3 pos : POSITION;
float2 tex : TEXCOORD0;
};
struct VS_OUTPUT
{
float4 pos : POSITION;
float2 tex : TEXCOORD0;
};
VS_OUTPUT mainVS(VS_INPUT input)
{
VS_OUTPUT vsOut;
vsOut.pos = mul(float4(input.pos, 1), worldViewProj);
vsOut.tex = input.tex;
// vsOut.tex.xy = vsOut.pos.zw;
return vsOut;
}
texture tex0;
sampler2D sample0 =
sampler_state
{
Texture = <tex0>;
/* MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
AddressU = CLAMP;
AddressV = CLAMP;
*/
};
float4 mainPS(float2 tex : TEXCOORD0) : COLOR
{
return tex2D(sample0, tex);
// return tex.x / tex.y;
}
technique technique0 {
pass p0 {
VertexShader = compile vs_3_0 mainVS();
PixelShader = compile ps_3_0 mainPS();
}
}