Skip to content

HemisphereLightProbe intensity wrong #26668

@OndrejSpanel

Description

@OndrejSpanel

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

  1. create a simple scene with HemisphereLight with intensity 3
  2. display the scene
  3. replace the light with HemisphereLightProbe
  4. display the scene and notice it is much brighter
  5. set HemisphereLightProbe intensity to 1
  6. display the scene and notice it is the original brightness
  7. use useLegacyLights = true
  8. set HemisphereLightProbe intensity to 3
  9. 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:
image

Version

r155

Device

Desktop

Browser

Chrome

OS

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions