Browse Source

Examples: Removed redundant shader

Mugen87 8 years ago
parent
commit
42dda19e1b

+ 0 - 49
examples/js/shaders/GrayScaleShader.js

@@ -1,49 +0,0 @@
-/**
- * @author Mugen87 / https://github.com/Mugen87
- *
- * see https://en.wikipedia.org/wiki/Grayscale
- *
- */
-
-THREE.GrayScaleShader = {
-
-	uniforms: {
-
-		"tDiffuse": { value: null }
-
-	},
-
-	vertexShader: [
-
-		"varying vec2 vUv;",
-
-		"void main() {",
-
-			"vUv = uv;",
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
-
-		"}"
-
-	].join( "\n" ),
-
-	fragmentShader: [
-
-		"uniform sampler2D tDiffuse;",
-
-		"varying vec2 vUv;",
-
-		"void main() {",
-
-			"const vec3 weight = vec3( 0.2126, 0.7152, 0.0722 );",
-
-			"vec3 color = texture2D( tDiffuse, vUv ).rgb;",
-
-			"float luminance = dot( color, weight );",
-
-			"gl_FragColor = vec4( vec3( luminance ), 1 );",
-
-		"}"
-
-	].join( "\n" )
-
-};

+ 2 - 2
examples/webgl_postprocessing_edgedetection.html

@@ -37,7 +37,7 @@
 		<script src="js/libs/dat.gui.min.js"></script>
 
 		<script src="js/shaders/CopyShader.js"></script>
-		<script src="js/shaders/GrayScaleShader.js"></script>
+		<script src="js/shaders/LuminosityShader.js"></script>
 		<script src="js/shaders/SobelOperatorShader.js"></script>
 
 		<script src="js/postprocessing/EffectComposer.js"></script>
@@ -105,7 +105,7 @@
 
 				// color to grayscale conversion
 
-				var effectGrayScale = new THREE.ShaderPass( THREE.GrayScaleShader );
+				var effectGrayScale = new THREE.ShaderPass( THREE.LuminosityShader );
 				composer.addPass( effectGrayScale );
 
 				// you might want to use a gaussian blur filter before