diff options
Diffstat (limited to 'misc/xbox/vs_textured.vs.cg')
-rw-r--r-- | misc/xbox/vs_textured.vs.cg | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/misc/xbox/vs_textured.vs.cg b/misc/xbox/vs_textured.vs.cg new file mode 100644 index 0000000..2e3b39b --- /dev/null +++ b/misc/xbox/vs_textured.vs.cg @@ -0,0 +1,36 @@ +struct vIn { + float4 tex : TEXCOORD; + float4 color : DIFFUSE; + float4 position : POSITION; +}; + +struct vOut { + float4 pos : POSITION; + float4 col : COLOR; + float4 tex : TEXCOORD0; +}; + +vOut main( + vIn input, + uniform float4x4 mvp, + uniform float4 vp_scale, + uniform float4 vp_offset + ) +{ + vOut result; + float4 position; + + position = float4(input.position.xyz, 1.0f); + position = mul(position, mvp); + position.xyz = position.xyz / position.w; + + position.x = position.x * vp_scale.x + vp_offset.x; + position.y = position.y * vp_scale.y + vp_offset.y; + position.z = position.z * vp_scale.z + vp_offset.z; + //position.w = 1.0 / half_viewport.w; + + result.pos = position; + result.col = input.color; + result.tex = input.tex; + return result; +} |