Procházet zdrojové kódy

TiledLightsNode: Fix light intensity (#29723)

* TiledLightsNode: Fix light intensity

* Update webgpu_lights_tiled.jpg
sunag před 1 rokem
rodič
revize
68ea403185

+ 3 - 3
examples/jsm/tsl/lighting/TiledLightsNode.js

@@ -94,9 +94,9 @@ class TiledLightsNode extends THREE.LightsNode {
 			data[ offset + 2 ] = _vector3.z;
 			data[ offset + 3 ] = light.distance;
 
-			data[ lineSize + offset + 0 ] = light.color.r;
-			data[ lineSize + offset + 1 ] = light.color.g;
-			data[ lineSize + offset + 2 ] = light.color.b;
+			data[ lineSize + offset + 0 ] = light.color.r * light.intensity;
+			data[ lineSize + offset + 1 ] = light.color.g * light.intensity;
+			data[ lineSize + offset + 2 ] = light.color.b * light.intensity;
 			data[ lineSize + offset + 3 ] = light.decay;
 
 		}

binární
examples/screenshots/webgpu_lights_tiled.jpg


+ 1 - 1
examples/webgpu_lights_tiled.html

@@ -79,7 +79,7 @@
 				lights = new THREE.Group();
 				scene.add( lights );
 
-				const addLight = ( hexColor, power = 10000, distance = 3 ) => {
+				const addLight = ( hexColor, power = 10, distance = 3 ) => {
 
 					const light = new THREE.PointLight( hexColor, 1, distance );
 					light.position.set( Math.random() * 300 - 150, 1, Math.random() * 300 - 150 );

粤ICP备19079148号