提交 8bf4f292 编写于 作者: G Garrett Johnson

Fix some indents

上级 24dc17b2
......@@ -23,9 +23,9 @@ THREE.BrightnessContrastShader = {
"void main() {",
"vUv = uv;",
" vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
......@@ -41,15 +41,15 @@ THREE.BrightnessContrastShader = {
"void main() {",
"gl_FragColor = texture2D( tDiffuse, vUv );",
" gl_FragColor = texture2D( tDiffuse, vUv );",
"gl_FragColor.rgb += brightness;",
" gl_FragColor.rgb += brightness;",
"if (contrast > 0.0) {",
"gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;",
"} else {",
"gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;",
"}",
" if (contrast > 0.0) {",
" gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;",
" } else {",
" gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;",
" }",
"}"
......
......@@ -21,9 +21,9 @@ THREE.ColorCorrectionShader = {
"void main() {",
"vUv = uv;",
" vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
......@@ -40,8 +40,8 @@ THREE.ColorCorrectionShader = {
"void main() {",
"gl_FragColor = texture2D( tDiffuse, vUv );",
"gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );",
" gl_FragColor = texture2D( tDiffuse, vUv );",
" gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );",
"}"
......
......@@ -19,8 +19,8 @@ THREE.ColorifyShader = {
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
" vUv = uv;",
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
......@@ -35,12 +35,12 @@ THREE.ColorifyShader = {
"void main() {",
"vec4 texel = texture2D( tDiffuse, vUv );",
" vec4 texel = texture2D( tDiffuse, vUv );",
"vec3 luma = vec3( 0.299, 0.587, 0.114 );",
"float v = dot( texel.xyz, luma );",
" vec3 luma = vec3( 0.299, 0.587, 0.114 );",
" float v = dot( texel.xyz, luma );",
"gl_FragColor = vec4( v * color, texel.w );",
" gl_FragColor = vec4( v * color, texel.w );",
"}"
......
......@@ -31,8 +31,8 @@ THREE.ConvolutionShader = {
"void main() {",
"vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
" vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;",
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
......@@ -49,17 +49,17 @@ THREE.ConvolutionShader = {
"void main() {",
"vec2 imageCoord = vUv;",
"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
" vec2 imageCoord = vUv;",
" vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",
"for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {",
" for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {",
"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
"imageCoord += uImageIncrement;",
" sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
" imageCoord += uImageIncrement;",
"}",
" }",
"gl_FragColor = sum;",
" gl_FragColor = sum;",
"}"
......
......@@ -19,8 +19,8 @@ THREE.CopyShader = {
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
" vUv = uv;",
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
......@@ -36,8 +36,8 @@ THREE.CopyShader = {
"void main() {",
"vec4 texel = texture2D( tDiffuse, vUv );",
"gl_FragColor = opacity * texel;",
" vec4 texel = texture2D( tDiffuse, vUv );",
" gl_FragColor = opacity * texel;",
"}"
......
......@@ -31,8 +31,8 @@ THREE.DigitalGlitch = {
"varying vec2 vUv;",
"void main() {",
"vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
" vUv = uv;",
" gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
......@@ -55,47 +55,47 @@ THREE.DigitalGlitch = {
"float rand(vec2 co){",
"return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);",
" return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);",
"}",
"void main() {",
"if(byp<1) {",
"vec2 p = vUv;",
"float xs = floor(gl_FragCoord.x / 0.5);",
"float ys = floor(gl_FragCoord.y / 0.5);",
//based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch
"vec4 normal = texture2D (tDisp, p*seed*seed);",
"if(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {",
"if(seed_x>0.){",
"p.y = 1. - (p.y + distortion_y);",
"}",
"else {",
"p.y = distortion_y;",
"}",
"}",
"if(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {",
"if(seed_y>0.){",
"p.x=distortion_x;",
"}",
"else {",
"p.x = 1. - (p.x + distortion_x);",
"}",
"}",
"p.x+=normal.x*seed_x*(seed/5.);",
"p.y+=normal.y*seed_y*(seed/5.);",
//base from RGB shift shader
"vec2 offset = amount * vec2( cos(angle), sin(angle));",
"vec4 cr = texture2D(tDiffuse, p + offset);",
"vec4 cga = texture2D(tDiffuse, p);",
"vec4 cb = texture2D(tDiffuse, p - offset);",
"gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);",
//add noise
"vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);",
"gl_FragColor = gl_FragColor+ snow;",
"}",
"else {",
"gl_FragColor=texture2D (tDiffuse, vUv);",
"}",
" if(byp<1) {",
" vec2 p = vUv;",
" float xs = floor(gl_FragCoord.x / 0.5);",
" float ys = floor(gl_FragCoord.y / 0.5);",
//based on staffantans glitch shader for unity https://github.com/staffantan/unityglitch
" vec4 normal = texture2D (tDisp, p*seed*seed);",
" if(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {",
" if(seed_x>0.){",
" p.y = 1. - (p.y + distortion_y);",
" }",
" else {",
" p.y = distortion_y;",
" }",
" }",
" if(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {",
" if(seed_y>0.){",
" p.x=distortion_x;",
" }",
" else {",
" p.x = 1. - (p.x + distortion_x);",
" }",
" }",
" p.x+=normal.x*seed_x*(seed/5.);",
" p.y+=normal.y*seed_y*(seed/5.);",
//base from RGB shift shader
" vec2 offset = amount * vec2( cos(angle), sin(angle));",
" vec4 cr = texture2D(tDiffuse, p + offset);",
" vec4 cga = texture2D(tDiffuse, p);",
" vec4 cb = texture2D(tDiffuse, p - offset);",
" gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);",
//add noise
" vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);",
" gl_FragColor = gl_FragColor+ snow;",
" }",
" else {",
" gl_FragColor=texture2D (tDiffuse, vUv);",
" }",
"}"
].join( "\n" )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册