diff options
author | 2016-12-12 22:09:59 -0800 | |
---|---|---|
committer | 2016-12-12 22:09:59 -0800 | |
commit | 77fd0232e6a24930e577d2813e8eddefcffd3c23 (patch) | |
tree | 7fd3fc54a2258729ffc255c4681d079f580b16c5 /hlsl | |
parent | 35035aae28d53bcfb4af4feb4e9288999dfb4e94 (diff) |
Fix phosphor shader to work properly for multi-screen games and
multi-window use.
hlsl/phosphor.fx: Update semantics.
src/osd/modules/render/d3d/d3dhlsl.cpp: Implement
shaders::delta_time member function.
src/osd/modules/render/d3d/d3dhlsl.h: Add acc_t and delta_t
members for use by shaders::delta_time. Member function returns the
amount of time since itself has been called, for use by time-dependent
shaders.
Diffstat (limited to 'hlsl')
-rw-r--r-- | hlsl/phosphor.fx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx index 40bc049bbc2..d78473a2c6e 100644 --- a/hlsl/phosphor.fx +++ b/hlsl/phosphor.fx @@ -94,17 +94,17 @@ VS_OUTPUT vs_main(VS_INPUT Input) //----------------------------------------------------------------------------- uniform float3 Phosphor = float3(0.0f, 0.0f, 0.0f); -uniform float dt = 0.0f; -static const float f = 30.0f; +uniform float DeltaTime = 0.0f; +static const float F = 30.0f; float4 ps_main(PS_INPUT Input) : COLOR { float4 CurrPix = tex2D(DiffuseSampler, Input.TexCoord); float3 PrevPix = tex2D(PreviousSampler, Input.PrevCoord).rgb; - PrevPix.r *= Phosphor.r == 0 ? 0 : pow(Phosphor.r, f * dt); - PrevPix.g *= Phosphor.g == 0 ? 0 : pow(Phosphor.g, f * dt); - PrevPix.b *= Phosphor.b == 0 ? 0 : pow(Phosphor.b, f * dt); + PrevPix.r *= Phosphor.r == 0 ? 0 : pow(Phosphor.r, F * DeltaTime); + PrevPix.g *= Phosphor.g == 0 ? 0 : pow(Phosphor.g, F * DeltaTime); + PrevPix.b *= Phosphor.b == 0 ? 0 : pow(Phosphor.b, F * DeltaTime); float RedMax = max(CurrPix.r, PrevPix.r); float GreenMax = max(CurrPix.g, PrevPix.g); float BlueMax = max(CurrPix.b, PrevPix.b); |