Selaa lähdekoodia

physicalLights -> physicallyCorrect, PHYSICAL_LIGHTS -> PHYSICALLY_CORRECT, update documentation.

Ben Houston 9 vuotta sitten
vanhempi
commit
bca32d50e9

+ 1 - 1
docs/api/lights/AmbientLight.html

@@ -44,7 +44,7 @@ scene.add( light );</code>
 		<h3>[property:Float intensity]</h3>
 		<div>
 			Light's intensity.<br />
-			In "physical lights" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
+			In "physically correct" mode, the product of color * intensity is interpreted as luminous irradiance measured in lux at the material surface.<br/>
 			Default — *1.0*.
 		</div>
 

+ 1 - 1
docs/api/lights/DirectionalLight.html

@@ -60,7 +60,7 @@ scene.add( directionalLight );</code>
 		<h3>[property:Float intensity]</h3>
 		<div>
 			Light's intensity.<br />
-			In "physical lights" mode, the product of intensity * color is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
+			In "physically correct" mode, the product of intensity * color is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
 			Default — *1.0*.
 		</div>
 

+ 1 - 1
docs/api/lights/HemisphereLight.html

@@ -47,7 +47,7 @@ scene.add( light );</code>
 		<h3>[property:Float intensity]</h3>
 		<div>
 			Light's intensity.<br />
-			In "physical lights" mode, the product of intensity * color (or intensity * groundColor) is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
+			In "physically correct" mode, the product of intensity * color (or intensity * groundColor) is interpreted as luminous irradiance measured in lux at the material's surface.<br/>
 			Default — *1.0*.
 		</div>
 

+ 3 - 3
docs/api/lights/PointLight.html

@@ -55,14 +55,14 @@ scene.add( light );</code>
 		<h3>[property:Float intensity]</h3>
 		<div>
 			Light's intensity.<br />
-			In "physical lights" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
+			In "physically correct" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
 			Default - *1.0*.
 		</div>
 
 		<h3>[property:Float power]</h3>
 		<div>
 			Light's power.<br />
-			In "physical lights" mode, the luminous power of the light measured in lumens.<br/>
+			In "physically correct" mode, the luminous power of the light measured in lumens.<br/>
 			Default - *4PI*.
 		</div>
 
@@ -75,7 +75,7 @@ scene.add( light );</code>
 		<h3>[property:Float decay]</h3>
 		<div>
 			The amount the light dims along the distance of the light<br />
-			In "physical lights" mode, decay = 2 leads to physically realistic light falloff.<br/>
+			In "physically correct" mode, decay = 2 leads to physically realistic light falloff.<br/>
 			Default — *1*.
 		</div>
 

+ 3 - 3
docs/api/lights/SpotLight.html

@@ -77,14 +77,14 @@
 		<h3>[property:Float intensity]</h3>
 		<div>
 			Light's intensity.<br />
-			In "physical lights" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
+			In "physically correct" mode, the product of color * intensity is interpreted as luminous intensity measured in candela.<br/>
 			Default — *1.0*.
 		</div>
 
 		<h3>[property:Float power]</h3>
 		<div>
 			Light's power.<br />
-			In "physical lights" mode, the luminous power of the light measured in lumens.<br/>
+			In "physically correct" mode, the luminous power of the light measured in lumens.<br/>
 			Default - *4PI*.
 		</div>
 
@@ -109,7 +109,7 @@
 		<h3>[property:Float decay]</h3>
 		<div>
 			The amount the light dims along the distance of the light<br />
-			In "physical lights" mode, decay = 2 leads to physically realistic light falloff.<br/>
+			In "physically correct" mode, decay = 2 leads to physically realistic light falloff.<br/>
 			Default — *1*.
 		</div>
 

+ 1 - 1
examples/webgl_lights_physical.html

@@ -222,7 +222,7 @@
 				scene.add( boxMesh );
 
 				renderer = new THREE.WebGLRenderer();
-				renderer.physicalLights = true;
+				renderer.physicallyCorrect = true;
 				renderer.gammaInput = true;
 				renderer.gammaOutput = true;
 				renderer.shadowMap.enabled = true;

+ 2 - 2
src/renderers/WebGLRenderer.js

@@ -57,8 +57,8 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	// physical lights
 
-	this.physicalLights = false;
-	
+	this.physicallyCorrect = false;
+
 	// tone mapping
 
 	this.toneMapping = THREE.LinearToneMapping;

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

@@ -2,7 +2,7 @@ uniform vec3 ambientLightColor;
 
 vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
 
-#if defined ( PHYSICAL_LIGHTS )
+#if defined ( PHYSICALLY_CORRECT )
 
 	return ambientLightColor;
 

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

@@ -8,7 +8,7 @@ float punctualLightIntensityToIrradianceFactor( const in float lightDistance, co
 
 		if( decayExponent > 0.0 ) {
 
-#if defined ( PHYSICAL_LIGHTS )
+#if defined ( PHYSICALLY_CORRECT )
 
 			// based upon Frostbite 3 Moving to Physically-based Rendering
 			// http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf

+ 2 - 2
src/renderers/shaders/ShaderChunk/lights_pars.glsl

@@ -107,7 +107,7 @@
 			float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );
 
 			directLight.color = spotLight.color;
-			directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );
+			directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );
 
 			directLight.visible = true;
 
@@ -140,7 +140,7 @@
 		float dotNL = dot( geometry.normal, hemiLight.direction );
 		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
 
-	#if defined( PHYSICAL_LIGHTS )
+	#if defined( PHYSICALLY_CORRECT )
 
 		return mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
 

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

@@ -26,7 +26,7 @@ void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in Geometri
 
 	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
 
-#if defined ( PHYSICAL_LIGHTS )
+#if defined ( PHYSICALLY_CORRECT )
 
 	vec3 irradiance = dotNL * directLight.color;
 

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

@@ -10,7 +10,7 @@ void RE_Direct_Standard( const in IncidentLight directLight, const in GeometricC
 
 	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );
 
-#if defined ( PHYSICAL_LIGHTS )
+#if defined ( PHYSICALLY_CORRECT )
 
 	vec3 irradiance = dotNL * directLight.color;
 

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

@@ -87,7 +87,7 @@ IncidentLight directLight;
 
 	#ifdef USE_LIGHTMAP
 
-		#if defined ( PHYSICAL_LIGHTS )
+		#if defined ( PHYSICALLY_CORRECT )
 
 			irradiance += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;
 

+ 1 - 1
src/renderers/webgl/WebGLProgram.js

@@ -518,7 +518,7 @@ THREE.WebGLProgram = ( function () {
 
 				parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : '',
 
-				parameters.physicalLights ? "#define PHYSICAL_LIGHTS" : '',
+				parameters.physicallyCorrect ? "#define PHYSICALLY_CORRECT" : '',
 
 				parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
 				parameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '',

+ 2 - 2
src/renderers/webgl/WebGLPrograms.js

@@ -23,7 +23,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
 		"maxBones", "useVertexTexture", "morphTargets", "morphNormals",
 		"maxMorphTargets", "maxMorphNormals", "premultipliedAlpha",
 		"numDirLights", "numPointLights", "numSpotLights", "numHemiLights",
-		"shadowMapEnabled", "pointLightShadows", "toneMapping", 'physicalLights',
+		"shadowMapEnabled", "pointLightShadows", "toneMapping", 'physicallyCorrect',
 		"shadowMapType",
 		"alphaTest", "doubleSided", "flipSided"
 	];
@@ -176,7 +176,7 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
 			shadowMapType: renderer.shadowMap.type,
 
 			toneMapping: renderer.toneMapping,
-			physicalLights: renderer.physicalLights,
+			physicallyCorrect: renderer.physicallyCorrect,
 
 			premultipliedAlpha: ( material.blending === THREE.PremultipliedAlphaBlending ),
 			alphaTest: material.alphaTest,