add ntsclut-phosphorlut preset and tweak crtsim ntsc setting

This commit is contained in:
hunterk 2017-05-04 21:36:39 -05:00
parent 6f47464db3
commit f9c47b074a
2 changed files with 47 additions and 7 deletions

View file

@ -19,9 +19,6 @@
// This is where we apply effects "inside the screen," including spatial and temporal bleeding,
// an unsharp mask to simulate overshoot/undershoot, NTSC artifacts, and so on.
#define RcpScrWidth vec2(params.SourceSize.x, 0.0)
#define RcpScrHeight vec2(0.0, params.SourceSize.w)
layout(push_constant) uniform Push
{
vec4 SourceSize;
@ -46,7 +43,7 @@ layout(push_constant) uniform Push
#pragma parameter Tuning_Bleed "Composite Bleed" 0.5 0.0 1.0 0.05
#pragma parameter Tuning_Artifacts "Composite Artifacts" 0.5 0.0 1.0 0.05
#pragma parameter NTSCLerp "NTSC Artifacts" 1.0 0.0 1.0 1.0
#pragma parameter NTSCArtifactScale "NTSC Artifact Scale" 200.0 0.0 1000.0 5.0
#pragma parameter NTSCArtifactScale "NTSC Artifact Scale" 255.0 0.0 1000.0 5.0
#pragma parameter animate_artifacts "Animate NTSC Artifacts" 1.0 0.0 1.0 1.0
layout(std140, set = 0, binding = 0) uniform UBO
@ -103,8 +100,8 @@ void main()
float lerpfactor = (params.animate_artifacts > 0.5) ? mod(params.FrameCount, 2.0) : params.NTSCLerp;
half4 NTSCArtifact = lerp(NTSCArtifact1, NTSCArtifact2, 1.0 - lerpfactor);
half2 LeftUV = vTexCoord - vec2(1.0 / params.SourceSize.x, 0.0);//RcpScrWidth;
half2 RightUV = vTexCoord + vec2(1.0 / params.SourceSize.x, 0.0);//RcpScrWidth;
half2 LeftUV = vTexCoord - vec2(1.0 / params.SourceSize.x, 0.0);
half2 RightUV = vTexCoord + vec2(1.0 / params.SourceSize.x, 0.0);
half4 Cur_Left = tex2D(curFrameSampler, LeftUV);
half4 Cur_Local = tex2D(curFrameSampler, vTexCoord);
@ -150,4 +147,4 @@ void main()
Cur_Local = saturate(max(Cur_Local, Tuning_Persistence * (10.0 / (1.0 + (2.0 * params.Tuning_Bleed))) * (Prev_Local + ((Prev_Left + Prev_Right) * params.Tuning_Bleed))));
FragColor = vec4(Cur_Local);
}
}

View file

@ -0,0 +1,43 @@
shaders = 6
shader0 = ../crt/shaders/crtsim/composite.slang
filter_linear0 = false
shader1 = ../crt/shaders/phosphorlut/scanlines-interlace-linearize.slang
alias1 = firstPass
scale1 = 2.0
scale_type1 = source
srgb_framebuffer1 = true
filter_linear1 = false
shader2 = ../blurs/blur5fast-vertical.slang
scale_type2 = source
scale2 = 1.0
srgb_framebuffer2 = true
filter_linear2 = true
alias2 = blurPassV
shader3 = ../blurs/blur5fast-horizontal.slang
alias3 = blurPass
filter_linear3 = true
scale3 = 1.0
scale_type3 = source
srgb_framebuffer3 = true
shader4 = ../crt/shaders/phosphorlut/phosphorlut-pass0.slang
alias4 = phosphorPass
filter_linear4 = true
scale_type4 = source
scale_x4 = 4.0
scale_y4 = 2.0
srgb_framebuffer4 = true
shader5 = ../crt/shaders/phosphorlut/phosphorlut-pass1.slang
filter_linear5 = true
textures = "NTSCArtifactSampler;shadow;aperture;slot"
NTSCArtifactSampler = "../crt/shaders/crtsim/artifacts.png"
NTSCArtifactSampler_linear = true
shadow = ../crt/shaders/phosphorlut/luts/shadowmask.png
aperture = ../crt/shaders/phosphorlut/luts/aperture-grille.png
slot = ../crt/shaders/phosphorlut/luts/slotmask.png