One side of the model is completely dark

Hello everyone, everything good?
I have a doubt, because in my model one side is with the light wall and the other is dark. How could I leave both sides lit?

Hello! Good. Increase ambient intensity.

Unfortunately it doesn’t work, I’ll post here my complete lighting function for you to take a look at how it is

  sceneHandleAmbientLight = () => {
    const ambientLight = new THREE.AmbientLight('white', 1);
    ambientLight.position.set(10, 10, 10);

    const hemisphereLight = new THREE.HemisphereLight(0xffffff, 0xffffff, 0.1);
    hemisphereLight.color.setHSL(0, 0, 1);
    hemisphereLight.groundColor.setHSL(0.095, 0.5, 0.5);
    hemisphereLight.position.set(0, 500, 0);

    const dirLight = new THREE.DirectionalLight(0xffffff, 2.5);
    dirLight.position.set(-1, 0.75, 1);
    dirLight.color.setHSL(0, 0, 0.5);
    dirLight.position.multiplyScalar(50);
    dirLight.name = 'dirlight';

    this.scene.add(ambientLight, hemisphereLight, dirLight);

    //Shadow targeting
    const shadowDir = 300;
    dirLight.shadow.mapSize.width = 2048;
    dirLight.shadow.mapSize.height = 2048;

    dirLight.shadow.camera.far = shadowDir;
    dirLight.shadow.camera.near = -0.0001;

  };

I've tried everything and it doesn't work

My solution was a little more aggressive to correct this, however it worked very, very well.

As I am using a class I created a variable this.dirlight (TypeScript - Dirlight: Three.directionalLight | UNDEFINED;)

And I created it in yielding a copy, then applied the camera’s look. It was like this:

    if (this.dirLight) {
      this.dirLight.position.copy(this.camera.position);
      this.dirLight.lookAt(this.camera.getWorldDirection(new THREE.Vector3()).negate());
    }

in addition, by default the position of my light is at 45 degrees

    this.dirLight = new THREE.DirectionalLight(0xffffff, 1.5);
    this.dirLight.position.set(Math.sin(45), Math.cos(45), 0);
    this.dirLight.color.setHSL(0, 0, 0.5);
    this.dirLight.position.multiplyScalar(50);
    this.dirLight.name = 'dirlight';
    this.scene.add(ambientLight, hemisphereLight, this.dirLight);
1 Like