Browse Source

adopt new naming scheme per @mrdoob's recommendation.

Ben Houston 9 years ago
parent
commit
94eca51d6d

+ 7 - 7
src/Three.js

@@ -308,10 +308,10 @@ THREE.TriangleFanDrawMode = 2;
 
 
 // Texture Encodings
 // Texture Encodings
 
 
-THREE.Linear = 3000; // No encoding at all.
-THREE.sRGB = 3001; // AKA gamma 2.2.
-THREE.RGBE = 3002; // AKA Radiance
-//THREE.LogLuv = 3003; TODO
-THREE.RGBM7 = 3004;
-THREE.RGBM16 = 3005;
-//THREE.RGBD = 3006; TODO
+THREE.LinearEncoding = 3000; // No encoding at all.
+THREE.sRGBEncoding = 3001; // AKA gamma 2.2.
+THREE.RGBEEncoding = 3002; // AKA Radiance
+//THREE.LogLuvEncoding = 3003; TODO
+THREE.RGBM7Encoding = 3004;
+THREE.RGBM16Encoding = 3005;
+//THREE.RGBDEncoding = 3006; TODO

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -1962,7 +1962,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 		}
 		}
 
 
 		uniforms.envMap.value = material.envMap;
 		uniforms.envMap.value = material.envMap;
-		uniforms.envMapEncoding.value = ( material.envMap ? material.envMap.encoding : THREE.Linear );
+		uniforms.envMapEncoding.value = ( material.envMap ? material.envMap.encoding : THREE.LinearEncoding );
 		uniforms.flipEnvMap.value = ( material.envMap instanceof THREE.WebGLRenderTargetCube ) ? 1 : - 1;
 		uniforms.flipEnvMap.value = ( material.envMap instanceof THREE.WebGLRenderTargetCube ) ? 1 : - 1;
 
 
 		uniforms.reflectivity.value = material.reflectivity;
 		uniforms.reflectivity.value = material.reflectivity;

+ 1 - 1
src/renderers/shaders/ShaderChunk/encodings.glsl

@@ -1,6 +1,6 @@
 // For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/
 // For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/
 
 
-// These encodings should have the same integer values as THREE.Linear, THREE.sRGB, etc...
+// These encodings should have the same integer values as THREE.LinearEncoding, THREE.sRGBEncoding, etc...
 #define ENCODING_Linear 3000
 #define ENCODING_Linear 3000
 #define ENCODING_sRGB   3001
 #define ENCODING_sRGB   3001
 #define ENCODING_RGBE   3002
 #define ENCODING_RGBE   3002

+ 2 - 2
src/renderers/shaders/UniformsLib.js

@@ -16,7 +16,7 @@ THREE.UniformsLib = {
 		"alphaMap": { type: "t", value: null },
 		"alphaMap": { type: "t", value: null },
 
 
 		"envMap": { type: "t", value: null },
 		"envMap": { type: "t", value: null },
-		"envMapEncoding" : { type: "i", value: THREE.Linear },
+		"envMapEncoding" : { type: "i", value: THREE.LinearEncoding },
 		"flipEnvMap": { type: "f", value: - 1 },
 		"flipEnvMap": { type: "f", value: - 1 },
 		"reflectivity": { type: "f", value: 1.0 },
 		"reflectivity": { type: "f", value: 1.0 },
 		"refractionRatio": { type: "f", value: 0.98 }
 		"refractionRatio": { type: "f", value: 0.98 }
@@ -40,7 +40,7 @@ THREE.UniformsLib = {
 	emissivemap: {
 	emissivemap: {
 
 
 		"emissiveMap": { type: "t", value: null },
 		"emissiveMap": { type: "t", value: null },
-		"emissiveMapEncoding": { type: "i", value: THREE.Linear }
+		"emissiveMapEncoding": { type: "i", value: THREE.LinearEncoding }
 
 
 	},
 	},
 
 

+ 1 - 1
src/textures/Texture.js

@@ -36,7 +36,7 @@ THREE.Texture = function ( image, mapping, wrapS, wrapT, magFilter, minFilter, f
 	this.premultiplyAlpha = false;
 	this.premultiplyAlpha = false;
 	this.flipY = true;
 	this.flipY = true;
 	this.unpackAlignment = 4;	// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
 	this.unpackAlignment = 4;	// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
-	this.encoding = THREE.Linear;	// Values !== THREE.Linear only supported on envMap and emissiveMap (as these maps regularly have unbounded intensity values, i.e. via an *.hdr or *.exr image.)
+	this.encoding = THREE.LinearEncoding;	// Values !== THREE.LinearEncoding only supported on envMap and emissiveMap (as these maps regularly have unbounded intensity values, i.e. via an *.hdr or *.exr image.)
 
 
 	this.version = 0;
 	this.version = 0;
 	this.onUpdate = null;
 	this.onUpdate = null;