Ver código fonte

rename texture uniform

aardgoose 6 anos atrás
pai
commit
f2f69a3c08
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      examples/webgl_custom_attributes.html

+ 4 - 4
examples/webgl_custom_attributes.html

@@ -38,7 +38,7 @@
 			varying vec2 vUv;
 
 			uniform vec3 color;
-			uniform sampler2D texture;
+			uniform sampler2D colorTexture;
 
 			void main() {
 
@@ -47,7 +47,7 @@
 
 				float dProd = dot( vNormal, light ) * 0.5 + 0.5;
 
-				vec4 tcolor = texture2D( texture, vUv );
+				vec4 tcolor = texture2D( colorTexture, vUv );
 				vec4 gray = vec4( vec3( tcolor.r * 0.3 + tcolor.g * 0.59 + tcolor.b * 0.11 ), 1.0 );
 
 				gl_FragColor = gray * vec4( vec3( dProd ) * vec3( color ), 1.0 );
@@ -94,11 +94,11 @@
 
 					"amplitude": { value: 1.0 },
 					"color": { value: new Color( 0xff2200 ) },
-					"texture": { value: new TextureLoader().load( "textures/water.jpg" ) }
+					"colorTexture": { value: new TextureLoader().load( "textures/water.jpg" ) }
 
 				};
 
-				uniforms[ "texture" ].value.wrapS = uniforms[ "texture" ].value.wrapT = RepeatWrapping;
+				uniforms[ "colorTexture" ].value.wrapS = uniforms[ "colorTexture" ].value.wrapT = RepeatWrapping;
 
 				var shaderMaterial = new ShaderMaterial( {