From c834cdf9fbd3be79da20f609ea13778d5a05ce09 Mon Sep 17 00:00:00 2001 From: tony056 <ytung@mozilla.com> Date: Thu, 5 Jul 2018 18:15:48 -0700 Subject: [PATCH] moved two tunnels closer to each other and combined left and right vignette effect before applying to the renderTarget. --- src/systems/shaderlib/VignetteShader.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/systems/shaderlib/VignetteShader.js b/src/systems/shaderlib/VignetteShader.js index efcf78efc..997d4711b 100644 --- a/src/systems/shaderlib/VignetteShader.js +++ b/src/systems/shaderlib/VignetteShader.js @@ -31,8 +31,8 @@ THREE.VignetteShader = { "void main() {", "vec4 texel = texture2D( tDiffuse, vUv);", - "vec2 uvLeft = (vUv.xy) - vec2(0.25, 0.5);", - "vec2 uvRight = (vUv.xy) - vec2(0.75, 0.5);", + "vec2 uvLeft = (vUv.xy) - vec2(0.3, 0.5);", + "vec2 uvRight = (vUv.xy) - vec2(0.7, 0.5);", "float ratio = resolution.x / resolution.y;", "uvLeft.x *= ratio;", "uvRight.x *= ratio;", @@ -40,8 +40,8 @@ THREE.VignetteShader = { "float lenRight = length(uvRight);", "float vignetteLeft = smoothstep(radius, radius-softness, lenLeft);", "float vignetteRight = smoothstep(radius, radius-softness, lenRight);", - "vec3 final = mix (texel.rgb, texel.rgb * vignetteLeft, opacity);", - "final += mix(texel.rgb, texel.rgb * vignetteRight, opacity);", + "float vignette = vignetteLeft + vignetteRight;", + "vec3 final = mix (texel.rgb, texel.rgb * vignette, opacity);", "gl_FragColor = vec4(final.rgb, 1.0);", "}" -- GitLab