summary refs log tree commit diff stats
path: root/shaders/ntsc.fragment
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-02-19 20:10:11 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-02-19 20:10:11 -0500
commitcd48894563052baeddff64f6bbc13ccc7fa6e081 (patch)
treec7ab2a9b4cbb7ac0d921cf486aef00c5b5623144 /shaders/ntsc.fragment
parentc1b1558256997df22678f6405ea320ae454ad5b4 (diff)
downloadtherapy-cd48894563052baeddff64f6bbc13ccc7fa6e081.tar.gz
therapy-cd48894563052baeddff64f6bbc13ccc7fa6e081.tar.bz2
therapy-cd48894563052baeddff64f6bbc13ccc7fa6e081.zip
Added CRT mesh!
Also a character sprite, changed up the map file format, fixed some shader bugs
Diffstat (limited to 'shaders/ntsc.fragment')
-rw-r--r--shaders/ntsc.fragment7
1 files changed, 4 insertions, 3 deletions
diff --git a/shaders/ntsc.fragment b/shaders/ntsc.fragment index 12d6873..ceab64d 100644 --- a/shaders/ntsc.fragment +++ b/shaders/ntsc.fragment
@@ -8,8 +8,8 @@ uniform sampler2D curFrameSampler;
8uniform sampler2D NTSCArtifactSampler; 8uniform sampler2D NTSCArtifactSampler;
9uniform sampler2D prevFrameSampler; 9uniform sampler2D prevFrameSampler;
10 10
11const float Tuning_Sharp = 0.8; 11const float Tuning_Sharp = 0.25;
12const vec4 Tuning_Persistence = vec4(0.7,0.7,0.7,0.7); 12const vec4 Tuning_Persistence = vec4(1.0) * 0.5;
13const float Tuning_Bleed = 0.5; 13const float Tuning_Bleed = 0.5;
14const float Tuning_NTSC = 0.35; 14const float Tuning_NTSC = 0.35;
15uniform float NTSCLerp; 15uniform float NTSCLerp;
@@ -29,6 +29,7 @@ void main()
29 vec4 NTSCArtifact1 = texture(NTSCArtifactSampler, UV); 29 vec4 NTSCArtifact1 = texture(NTSCArtifactSampler, UV);
30 vec4 NTSCArtifact2 = texture(NTSCArtifactSampler, UV + RcpScrHeight); 30 vec4 NTSCArtifact2 = texture(NTSCArtifactSampler, UV + RcpScrHeight);
31 vec4 NTSCArtifact = mix(NTSCArtifact1, NTSCArtifact2, NTSCLerp); 31 vec4 NTSCArtifact = mix(NTSCArtifact1, NTSCArtifact2, NTSCLerp);
32 vec4 TunedNTSC = NTSCArtifact * Tuning_NTSC;
32 33
33 vec2 LeftUV = UV - RcpScrWidth; 34 vec2 LeftUV = UV - RcpScrWidth;
34 vec2 RightUV = UV + RcpScrWidth; 35 vec2 RightUV = UV + RcpScrWidth;
@@ -41,7 +42,7 @@ void main()
41 vec4 Prev_Local = texture(prevFrameSampler, UV); 42 vec4 Prev_Local = texture(prevFrameSampler, UV);
42 vec4 Prev_Right = texture(prevFrameSampler, RightUV); 43 vec4 Prev_Right = texture(prevFrameSampler, RightUV);
43 44
44 Cur_Local = clamp(Cur_Local + (((Cur_Left - Cur_Local) + (Cur_Right - Cur_Local)) * Tuning_NTSC), vec4(0,0,0,0), vec4(1,1,1,1)); 45 Cur_Local = clamp(Cur_Local + (((Cur_Left - Cur_Local) + (Cur_Right - Cur_Local)) * TunedNTSC), vec4(0,0,0,0), vec4(1,1,1,1));
45 46
46 float curBrt = Brightness(Cur_Local); 47 float curBrt = Brightness(Cur_Local);
47 float offset = 0; 48 float offset = 0;