1/** 2 * @author felixturner / http://airtight.cc/ 3 * 4 * RGB Shift Shader 5 * Shifts red and blue channels from center in opposite directions 6 * Ported from http://kriss.cx/tom/2009/05/rgb-shift/ 7 * by Tom Butterworth / http://kriss.cx/tom/ 8 * 9 * amount: shift distance (1 is width of input) 10 * angle: shift angle in radians 11 */ 12 13THREE.RGBShiftShader = { 14 15 uniforms: { 16 17 "tDiffuse": { value: null }, 18 "amount": { value: 0.005 }, 19 "angle": { value: 0.0 } 20 21 }, 22 23 vertexShader: [ 24 25 "varying vec2 vUv;", 26 27 "void main() {", 28 29 "vUv = uv;", 30 "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", 31 32 "}" 33 34 ].join( "\n" ), 35 36 fragmentShader: [ 37 38 "uniform sampler2D tDiffuse;", 39 "uniform float amount;", 40 "uniform float angle;", 41 42 "varying vec2 vUv;", 43 44 "void main() {", 45 46 "vec2 offset = amount * vec2( cos(angle), sin(angle));", 47 "vec4 cr = texture2D(tDiffuse, vUv + offset);", 48 "vec4 cga = texture2D(tDiffuse, vUv);", 49 "vec4 cb = texture2D(tDiffuse, vUv - offset);", 50 "gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);", 51 52 "}" 53 54 ].join( "\n" ) 55 56};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.