From 0ad0e5548efd6c82d62058c92ae381fa51932a2a Mon Sep 17 00:00:00 2001 From: ImJezze Date: Sun, 25 Oct 2015 11:02:52 +0100 Subject: Fixed Vector Intensity and Flicker - fixed vector intensity in vector.fx - fixed vector flicker in vector.c - change range of vector flicker option from 0 - 100 to 0.00 - 1.00 --- hlsl/vector.fx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'hlsl') diff --git a/hlsl/vector.fx b/hlsl/vector.fx index 0e5f2ac314c..5b2df81758b 100644 --- a/hlsl/vector.fx +++ b/hlsl/vector.fx @@ -42,15 +42,19 @@ uniform float3 LengthParams; VS_OUTPUT vs_main(VS_INPUT Input) { VS_OUTPUT Output = (VS_OUTPUT)0; - + Output.Position = float4(Input.Position.xyz, 1.0f); Output.Position.xy /= ScreenDims; - Output.Position.y = 1.0f - Output.Position.y; - Output.Position.xy -= 0.5f; - Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f); - Output.Color = Input.Color; + Output.Position.y = 1.0f - Output.Position.y; // flip y + Output.Position.xy -= 0.5f; // center + Output.Position.xy *= 2.0f; // zoom + Output.TexCoord = Input.Position.xy / ScreenDims; + + Output.Color = Input.Color; + Output.LineInfo = Input.LineInfo; + return Output; } @@ -64,14 +68,14 @@ VS_OUTPUT vs_main(VS_INPUT Input) // LengthParams.z: Size at which fade is maximum float4 ps_main(PS_INPUT Input) : COLOR { - float timeModulate = lerp(1.0f, TimeParams.x, TimeParams.y) * 1.0; + float timeModulate = lerp(1.0f, TimeParams.x, TimeParams.y); float lengthModulate = 1.0f - clamp(Input.LineInfo.x / LengthParams.z, 0.0f, 1.0f); float minLength = 2.0f - clamp(Input.LineInfo.x - 1.0f, 0.0f, 2.0f); - lengthModulate = lerp(lengthModulate, 4.0f, minLength * 0.5f); - lengthModulate = lerp(1.0f, timeModulate * lengthModulate, LengthParams.y) * 1.0; + lengthModulate = lerp(lengthModulate, 2.0f, minLength * 0.5f); + lengthModulate = lerp(1.0f, timeModulate * lengthModulate, LengthParams.y); - float4 outColor = Input.Color * float4(lengthModulate, lengthModulate, lengthModulate, 1.0f) * 2.0; + float4 outColor = Input.Color * float4(lengthModulate, lengthModulate, lengthModulate, 1.0f); return outColor; } -- cgit v1.2.3-70-g09d2