diff options
author | ImJezze <jezze@gmx.net> | 2016-03-12 16:03:28 +0100 |
---|---|---|
committer | ImJezze <jezze@gmx.net> | 2016-03-12 16:03:28 +0100 |
commit | 7add54760210313651c8a53a9ff6676512ce3fc8 (patch) | |
tree | e4e58b88feac19928cbb40479c9b799caead065c /hlsl/vector.fx | |
parent | a026a582f1a0ea8c1ede3acaddacef506ef3f3b0 (diff) |
Refactoring of render targes and vector texture coordinates
- implemented proper texture coordinates for vector quad primitive
- vector screen is now processed in texture coordinates
- revered workaround for raster screen, which is again processed in
texture coordinates
- known issue: cocktail mode for vector screen looks wrong
Diffstat (limited to 'hlsl/vector.fx')
-rw-r--r-- | hlsl/vector.fx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/hlsl/vector.fx b/hlsl/vector.fx index 1e94042ad5e..13aeb943c53 100644 --- a/hlsl/vector.fx +++ b/hlsl/vector.fx @@ -36,6 +36,8 @@ struct PS_INPUT //----------------------------------------------------------------------------- uniform float2 ScreenDims; +uniform float2 QuadDims; + uniform float2 TimeParams; uniform float3 LengthParams; @@ -47,9 +49,9 @@ VS_OUTPUT vs_main(VS_INPUT Input) Output.Position.xy /= ScreenDims; Output.Position.y = 1.0f - Output.Position.y; // flip y Output.Position.xy -= 0.5f; // center - Output.Position.xy *= 2.0f; // zoom + Output.Position.xy *= 2.0f * (ScreenDims / QuadDims); // zoom - Output.TexCoord = Input.Position.xy / ScreenDims; + Output.TexCoord = Input.TexCoord; Output.Color = Input.Color; @@ -75,7 +77,9 @@ float4 ps_main(PS_INPUT Input) : COLOR lengthModulate = lerp(lengthModulate, 4.0f, minLength * 0.5f); lengthModulate = lerp(1.0f, timeModulate * lengthModulate, LengthParams.y); - float4 outColor = Input.Color * float4(lengthModulate, lengthModulate, lengthModulate, 1.0f); + float4 outColor = float4(lengthModulate, lengthModulate, lengthModulate, 1.0f); + outColor *= Input.Color; + return outColor; } @@ -90,6 +94,6 @@ technique DefaultTechnique Lighting = FALSE; VertexShader = compile vs_2_0 vs_main(); - PixelShader = compile ps_2_0 ps_main(); + PixelShader = compile ps_2_0 ps_main(); } } |