Skip to content
Snippets Groups Projects
Commit c834cdf9 authored by tony056's avatar tony056
Browse files

moved two tunnels closer to each other and combined left and right vignette...

moved two tunnels closer to each other and combined left and right vignette effect before applying to the renderTarget.
parent 22bcc2f5
No related branches found
No related tags found
No related merge requests found
...@@ -31,8 +31,8 @@ THREE.VignetteShader = { ...@@ -31,8 +31,8 @@ THREE.VignetteShader = {
"void main() {", "void main() {",
"vec4 texel = texture2D( tDiffuse, vUv);", "vec4 texel = texture2D( tDiffuse, vUv);",
"vec2 uvLeft = (vUv.xy) - vec2(0.25, 0.5);", "vec2 uvLeft = (vUv.xy) - vec2(0.3, 0.5);",
"vec2 uvRight = (vUv.xy) - vec2(0.75, 0.5);", "vec2 uvRight = (vUv.xy) - vec2(0.7, 0.5);",
"float ratio = resolution.x / resolution.y;", "float ratio = resolution.x / resolution.y;",
"uvLeft.x *= ratio;", "uvLeft.x *= ratio;",
"uvRight.x *= ratio;", "uvRight.x *= ratio;",
...@@ -40,8 +40,8 @@ THREE.VignetteShader = { ...@@ -40,8 +40,8 @@ THREE.VignetteShader = {
"float lenRight = length(uvRight);", "float lenRight = length(uvRight);",
"float vignetteLeft = smoothstep(radius, radius-softness, lenLeft);", "float vignetteLeft = smoothstep(radius, radius-softness, lenLeft);",
"float vignetteRight = smoothstep(radius, radius-softness, lenRight);", "float vignetteRight = smoothstep(radius, radius-softness, lenRight);",
"vec3 final = mix (texel.rgb, texel.rgb * vignetteLeft, opacity);", "float vignette = vignetteLeft + vignetteRight;",
"final += mix(texel.rgb, texel.rgb * vignetteRight, opacity);", "vec3 final = mix (texel.rgb, texel.rgb * vignette, opacity);",
"gl_FragColor = vec4(final.rgb, 1.0);", "gl_FragColor = vec4(final.rgb, 1.0);",
"}" "}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment