-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Closed
Labels
Description
Description
When not using legacy lighting model, the HemisphereLightProbe
intensity is wrong, the light created this way is about 3 times (or pi times, this is hard tell) brighter than it should be.
Reproduction steps
- create a simple scene with
HemisphereLight
with intensity3
- display the scene
- replace the light with
HemisphereLightProbe
- display the scene and notice it is much brighter
- set
HemisphereLightProbe
intensity to1
- display the scene and notice it is the original brightness
- use
useLegacyLights = true
- set
HemisphereLightProbe
intensity to3
- display the scene and notice it is the original brightness
Code
// Initialize scene, camera, and renderer
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
renderer.useLegacyLights = false;
// Add HemisphereLight
const hemiLight = new THREE.HemisphereLightProbe(0xffffff, 0x444444, 3);
hemiLight.position.set(0, 20, 0);
scene.add(hemiLight);
// Add a cube
const geometry = new THREE.BoxGeometry();
const material = new THREE.MeshStandardMaterial({ color: 0x00ff00 });
const cube = new THREE.Mesh(geometry, material);
scene.add(cube);
camera.position.z = 5;
// Animation loop
const animate = function () {
requestAnimationFrame(animate);
cube.rotation.x += 0.01;
cube.rotation.y += 0.01;
renderer.render(scene, camera);
};
animate();
Live example
Screenshots
Note the cube being so bright it looks flat:
Version
r155
Device
Desktop
Browser
Chrome
OS
Windows
Mugen87