diff options
author | Jezze <jezze@gmx.net> | 2016-09-28 15:22:38 +0200 |
---|---|---|
committer | Jezze <jezze@gmx.net> | 2016-09-28 15:30:43 +0200 |
commit | ecf1e166fc6342ecf0664fe1d3af7aecb621c650 (patch) | |
tree | f75605582b1bc87ea3b6a2989d9867ea4ea93096 /hlsl/vector.fx | |
parent | 4727ff5e6a1e0aaa1d2b146b819250a6a83e8448 (diff) |
Fixed several small issues in HLSL/BGFX
* fixed target texture dimension when -intoverscan is used (this fixes the appereance of scanline and shadow mask)
* added target_scale and screen_count uniforms
* rounded corners now remain aligned with screen bounds when -intoverscan is used (single screen only)
Diffstat (limited to 'hlsl/vector.fx')
-rw-r--r-- | hlsl/vector.fx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hlsl/vector.fx b/hlsl/vector.fx index 686b617bbd0..7de585fd3a0 100644 --- a/hlsl/vector.fx +++ b/hlsl/vector.fx @@ -46,7 +46,7 @@ float roundBox(float2 p, float2 b, float r) //----------------------------------------------------------------------------- uniform float2 ScreenDims; -uniform float2 QuadDims; +uniform float2 TargetDims; VS_OUTPUT vs_main(VS_INPUT Input) { @@ -76,7 +76,7 @@ uniform float LengthRatio; // Size at which fade is maximum uniform float LengthScale; // How much length affects the vector's fade uniform float BeamSmooth; -float GetRoundCornerFactor(float2 coord, float2 bounds, float radiusAmount, float smoothAmount) +float GetBoundsFactor(float2 coord, float2 bounds, float radiusAmount, float smoothAmount) { // reduce smooth amount down to radius amount smoothAmount = min(smoothAmount, radiusAmount); @@ -100,7 +100,7 @@ float GetRoundCornerFactor(float2 coord, float2 bounds, float radiusAmount, floa float4 ps_main(PS_INPUT Input) : COLOR { - float2 lineSize = Input.SizeInfo / max(QuadDims.x, QuadDims.y); // normalize + float2 lineSize = Input.SizeInfo / max(TargetDims.x, TargetDims.y); // normalize float lineLength = lineSize.x; float lineLengthRatio = LengthRatio; @@ -113,7 +113,7 @@ float4 ps_main(PS_INPUT Input) : COLOR float4 outColor = float4(timeLengthModulate, timeLengthModulate, timeLengthModulate, 1.0f); outColor *= Input.Color; - float RoundCornerFactor = GetRoundCornerFactor(Input.TexCoord - 0.5f, Input.SizeInfo, 1.0f, BeamSmooth); + float RoundCornerFactor = GetBoundsFactor(Input.TexCoord - 0.5f, Input.SizeInfo, 1.0f, BeamSmooth); outColor.rgb *= RoundCornerFactor; return outColor; |