From 1e8de01d3704c584e43e1b84947487c2aaddb7d7 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 4 Feb 2018 21:57:24 -0500 Subject: Made some fixes to rendering I guess This is pretty old so I'm not exactly sure what it does but without it, the monitor gets rendered upside down. --- shaders/bloom2.fragment | 12 ++++++------ shaders/final.fragment | 9 +++++---- shaders/final.vertex | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'shaders') diff --git a/shaders/bloom2.fragment b/shaders/bloom2.fragment index da44ea1..4c50e86 100644 --- a/shaders/bloom2.fragment +++ b/shaders/bloom2.fragment @@ -16,18 +16,18 @@ float nrand(vec2 n) void main() { color = vec3(0.0); - //color += texture(tex2, UV).rgb / 2.0; + color += texture(clearTex, UV).rgb / 2.0; color += texture(blurTex, UV).rgb; color = max(vec3(0.0), color - 0.5); - //color *= color; + color *= color; - //float flicker = 0.5 + nrand(vec2(iGlobalTime)); - //flicker *= (flicker); + float flicker = 0.5 + nrand(vec2(iGlobalTime)); + flicker *= (flicker); //flicker = sqrt(flicker); //flicker = pow(flicker, 1.0/8.0); //color *= flicker; - //color *= mix(vec3(0.0), color, flicker); + color *= mix(vec3(0.0), color, flicker); color += texture(clearTex, UV).rgb; - //color = clamp(color, vec3(0.0), vec3(1.0)); + color = clamp(color, vec3(0.0), vec3(1.0)); } diff --git a/shaders/final.fragment b/shaders/final.fragment index b6c49a8..a3ee243 100644 --- a/shaders/final.fragment +++ b/shaders/final.fragment @@ -15,14 +15,15 @@ const float Tuning_Dimming = 0.0; const float Tuning_Satur = 1.13; const float Tuning_ReflScalar = 0.3; const float Tuning_Barrel = 0;//0.12; -const float Tuning_Scanline_Brightness = 0.45; -const float Tuning_Scanline_Opacity = 0.55; +const float Tuning_Scanline_Brightness = 0.5;//0.45; +const float Tuning_Scanline_Opacity = 0.75;//0.55; const float Tuning_Diff_Brightness = 0.75; -const float Tuning_Spec_Brightness = 0.35; +const float Tuning_Spec_Brightness = 0.5;//0.35; const float Tuning_Spec_Power = 50.0; -const float Tuning_Fres_Brightness = 1.0; +const float Tuning_Fres_Brightness = 0.0;//1.0; uniform vec2 resolution; +uniform vec3 frameColor; vec4 sampleCRT(vec2 uv) { diff --git a/shaders/final.vertex b/shaders/final.vertex index ed6079f..adf266d 100644 --- a/shaders/final.vertex +++ b/shaders/final.vertex @@ -23,6 +23,6 @@ void main() mat3 invWorldRot = transpose(mat3(worldMat[0].xyz, worldMat[1].xyz, worldMat[2].xyz)); vec3 worldPos = (worldMat * vec4(vertexPosition_modelspace,1)).xyz; - camDirIn = invWorldRot * (vec3(2,0,0) - worldPos); + camDirIn = invWorldRot * (vec3(3.75,0,0) - worldPos); lightDirIn = invWorldRot * (Tuning_LightPos - worldPos); } -- cgit 1.4.1