diff options
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/bloom2.fragment | 3 | ||||
-rw-r--r-- | shaders/final.fragment | 12 | ||||
-rw-r--r-- | shaders/final.vertex | 7 | ||||
-rw-r--r-- | shaders/ntsc.fragment | 7 |
4 files changed, 16 insertions, 13 deletions
diff --git a/shaders/bloom2.fragment b/shaders/bloom2.fragment index ac18124..aa69f0f 100644 --- a/shaders/bloom2.fragment +++ b/shaders/bloom2.fragment | |||
@@ -51,9 +51,10 @@ void main() | |||
51 | } | 51 | } |
52 | 52 | ||
53 | vec3 bloom_c = (sum / vec4(NUM_TAPS)).rgb; | 53 | vec3 bloom_c = (sum / vec4(NUM_TAPS)).rgb; |
54 | bloom_c *= bloom_c; | ||
54 | //bloom_c = vec3(bloom_c.r*bloom_c.r, bloom_c.g*bloom_c.g, bloom_c.b*bloom_c.b); | 55 | //bloom_c = vec3(bloom_c.r*bloom_c.r, bloom_c.g*bloom_c.g, bloom_c.b*bloom_c.b); |
55 | //bloom_c = vec3(bloom_c.r*bloom_c.r, bloom_c.g*bloom_c.g, bloom_c.b*bloom_c.b); | 56 | //bloom_c = vec3(bloom_c.r*bloom_c.r, bloom_c.g*bloom_c.g, bloom_c.b*bloom_c.b); |
56 | bloom_c = max(bloom_c - 0.25, vec3(0,0,0)); | 57 | //bloom_c = max(bloom_c - 0.25, vec3(0,0,0)); |
57 | 58 | ||
58 | color = texture(screenTex, UV).rgb + bloom_c; | 59 | color = texture(screenTex, UV).rgb + bloom_c; |
59 | } | 60 | } |
diff --git a/shaders/final.fragment b/shaders/final.fragment index 5feccb9..7eeb78e 100644 --- a/shaders/final.fragment +++ b/shaders/final.fragment | |||
@@ -15,14 +15,14 @@ const vec2 UVScalar = vec2(1.0, 1.0); | |||
15 | const vec2 UVOffset = vec2(0.0, 0.0); | 15 | const vec2 UVOffset = vec2(0.0, 0.0); |
16 | const vec2 CRTMask_Scale = vec2(85.0, 153.6)*4.0; | 16 | const vec2 CRTMask_Scale = vec2(85.0, 153.6)*4.0; |
17 | const vec2 CRTMask_Offset = vec2(0.0, 0.0); | 17 | const vec2 CRTMask_Offset = vec2(0.0, 0.0); |
18 | const float Tuning_Overscan = 1.0; | 18 | const float Tuning_Overscan = 1.08; |
19 | const float Tuning_Dimming = 0.0; | 19 | const float Tuning_Dimming = 0.0; |
20 | const float Tuning_Satur = 1.35; | 20 | const float Tuning_Satur = 1.0; |
21 | const float Tuning_ReflScalar = 0.3; | 21 | const float Tuning_ReflScalar = 0.3; |
22 | const float Tuning_Barrel = 0; //0.12; | 22 | const float Tuning_Barrel = 0; //0.12; |
23 | const float Tuning_Scanline_Brightness = 0.5; | 23 | const float Tuning_Scanline_Brightness = 0.45; |
24 | const float Tuning_Scanline_Opacity = 0.5; | 24 | const float Tuning_Scanline_Opacity = 0.5; |
25 | const float Tuning_Diff_Brightness = 0.5; | 25 | const float Tuning_Diff_Brightness = 0.75; |
26 | const float Tuning_Spec_Brightness = 0.35; | 26 | const float Tuning_Spec_Brightness = 0.35; |
27 | const float Tuning_Spec_Power = 50.0; | 27 | const float Tuning_Spec_Power = 50.0; |
28 | const float Tuning_Fres_Brightness = 1.0; | 28 | const float Tuning_Fres_Brightness = 1.0; |
@@ -86,7 +86,7 @@ void main() | |||
86 | vec4 emissive = sampleCRT(UV); | 86 | vec4 emissive = sampleCRT(UV); |
87 | 87 | ||
88 | vec4 nearfinal = colorfres + colordiff + colorspec + emissive; | 88 | vec4 nearfinal = colorfres + colordiff + colorspec + emissive; |
89 | vec4 final = nearfinal * mix(vec4(1,1,1,1), vec4(0,0,0,0), Tuning_Dimming); | 89 | //vec4 final = nearfinal * mix(vec4(1,1,1,1), vec4(0,0,0, 0), Tuning_Dimming); |
90 | 90 | ||
91 | color = final.rgb; | 91 | color = nearfinal.rgb; |
92 | } | 92 | } |
diff --git a/shaders/final.vertex b/shaders/final.vertex index dda8626..4c5b1d5 100644 --- a/shaders/final.vertex +++ b/shaders/final.vertex | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | layout(location = 0) in vec3 vertexPosition_modelspace; | 3 | layout(location = 0) in vec3 vertexPosition_modelspace; |
4 | layout(location = 1) in vec3 vertexNormal; | 4 | layout(location = 1) in vec3 vertexNormal; |
5 | layout(location = 2) in vec2 vertexUV; | ||
5 | 6 | ||
6 | out vec2 UV; | 7 | out vec2 UV; |
7 | out vec3 normIn; | 8 | out vec3 normIn; |
@@ -12,18 +13,18 @@ out vec3 lightDirIn; | |||
12 | uniform mat4 MVP; | 13 | uniform mat4 MVP; |
13 | uniform mat4 worldMat; | 14 | uniform mat4 worldMat; |
14 | 15 | ||
15 | const vec3 Tuning_LightPos = vec3(1, 1, 1.0); | 16 | const vec3 Tuning_LightPos = vec3(1, 1, -1.0); |
16 | 17 | ||
17 | void main() | 18 | void main() |
18 | { | 19 | { |
19 | gl_Position = MVP * vec4(vertexPosition_modelspace,1); | 20 | gl_Position = MVP * vec4(vertexPosition_modelspace,1); |
20 | UV = (vertexPosition_modelspace.xy+vec2(1,1))/2.0; | 21 | UV = vertexUV; |
21 | normIn = vertexNormal; | 22 | normIn = vertexNormal; |
22 | 23 | ||
23 | mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz)); | 24 | mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz)); |
24 | //mat3 invWorldRot = mat3(1.0f); | 25 | //mat3 invWorldRot = mat3(1.0f); |
25 | vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz; | 26 | vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz; |
26 | camDirIn = invWorldRot * (vec3(0,0,1) - worldPos); | 27 | camDirIn = invWorldRot * (vec3(2,0,0) - worldPos); |
27 | //camDir = worldPos; | 28 | //camDir = worldPos; |
28 | lightDirIn = invWorldRot * (Tuning_LightPos - worldPos); | 29 | lightDirIn = invWorldRot * (Tuning_LightPos - worldPos); |
29 | //vec4 vertPos4 = vec4(vertexPosition_modelspace,1); | 30 | //vec4 vertPos4 = vec4(vertexPosition_modelspace,1); |
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; | |||
8 | uniform sampler2D NTSCArtifactSampler; | 8 | uniform sampler2D NTSCArtifactSampler; |
9 | uniform sampler2D prevFrameSampler; | 9 | uniform sampler2D prevFrameSampler; |
10 | 10 | ||
11 | const float Tuning_Sharp = 0.8; | 11 | const float Tuning_Sharp = 0.25; |
12 | const vec4 Tuning_Persistence = vec4(0.7,0.7,0.7,0.7); | 12 | const vec4 Tuning_Persistence = vec4(1.0) * 0.5; |
13 | const float Tuning_Bleed = 0.5; | 13 | const float Tuning_Bleed = 0.5; |
14 | const float Tuning_NTSC = 0.35; | 14 | const float Tuning_NTSC = 0.35; |
15 | uniform float NTSCLerp; | 15 | uniform 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; |