PhongMaterial Lookes Difference between old package and new package

This is used version “three”: “^0.96.0”,

This is used version “three”: “^0.167.1”,

why both phongMaterial looks differenece

It probably lookes difference because over 6 years of development and bug fixes happened between those two releases.

You could start here, work backwards through the releases and find the change that made the material looke difference.

So, Now what is the solutions?

can you help me in this?

Try increasing the light intensity.

addLight() {
var light;
this.scene.add(new THREE.AmbientLight(0x404040, 0.5));
var lightobjgeo = new THREE.SphereGeometry(0.3, 4, 2);
var material = new THREE.MeshPhongMaterial({
color: new THREE.Color().setHSL(Math.random(), 1, 0.75),
flatShading: true,
specular: 0x111111,
shininess: 0
});
this.lightobj = new THREE.Mesh(lightobjgeo, material);
this.lightobj.position.set(2, 8, 4);
this.lightobj.name = ‘light’;

light = new THREE.DirectionalLight(0xffffff, 1);
light.position.copy(this.lightobj.position);
light.castShadow = true;
light.shadow.mapSize.width = 1500;
light.shadow.mapSize.height = 1500;
light.shadow.camera.near = 0.5;
light.shadow.camera.far = 500;

this.lightobj.add(light);
this.scene.add(this.lightobj);
this.updateObjectList();

}

how many increase?

Increase it to Math.PI

1 Like

addLight() {
var light;
this.scene.add(new THREE.AmbientLight(0x666666));

var lightobjgeo = new THREE.SphereGeometry(0.3, 4, 2);
var material = new THREE.MeshPhongMaterial({
    color: new THREE.Color().setHSL(Math.random(), 1, 0.75),
    flatShading: true,
    specular: 0x111111,
    shininess: 0
});

this.lightobj = new THREE.Mesh(lightobjgeo, material);
this.lightobj.position.set(2, 8, 4);
this.lightobj.name = 'light';

light = new THREE.DirectionalLight(0xdfebff, Math.PI);
light.position.copy(this.lightobj.position);
light.castShadow = true;
light.shadow.mapSize.width = 1500;
light.shadow.mapSize.height = 1500;
light.shadow.camera.near = 0.5;
light.shadow.camera.far = 500;

this.lightobj.add(light);
this.scene.add(this.lightobj);
this.updateObjectList();

}

Is it correct if not then please help me to .

You have to tell if it’s correct… i cannot see it!
Codewise it’s what i meant yes

1 Like

My means My Light Code Intensity increased with Math.PI is correct below

addLight() {
    var light;
    this.scene.add(new THREE.AmbientLight(0x666666));
    
    var lightobjgeo = new THREE.SphereGeometry(0.3, 4, 2);
    var material = new THREE.MeshPhongMaterial({
        color: new THREE.Color().setHSL(Math.random(), 1, 0.75),
        flatShading: true,
        specular: 0x111111,
        shininess: 0
    });
    
    this.lightobj = new THREE.Mesh(lightobjgeo, material);
    this.lightobj.position.set(2, 8, 4);
    this.lightobj.name = 'light';

    light = new THREE.DirectionalLight(0xdfebff, Math.PI);
    light.position.copy(this.lightobj.position);
    light.castShadow = true;
    light.shadow.mapSize.width = 1500;
    light.shadow.mapSize.height = 1500;
    light.shadow.camera.near = 0.5;
    light.shadow.camera.far = 500;

    this.lightobj.add(light);
    this.scene.add(this.lightobj);
    this.updateObjectList();
}

Output look like

Need like this type of output

I think you’ll have a very difficult time exactly reproducing exact lighting after jumping ahead 70+ versions at once. There were some important changes in r152 and r155, perhaps check in r151 and see if things look “as expected” there? If you can narrow it down to a specific version, or smaller range of versions, we might be able to suggest solutions, but without that I probably cannot.

2 Likes

I dont think that such a big version jump is detrimental. You could have easily jumped 50 versions with no issues. Its within the last 10 or so versions that things changed.

If it worked, then sure, and I agree that it’s probably either color management in r152 or lighting in r155 yes. But I am not really interested in guessing and explaining all possible causes and all possible solutions to those causes … it will save everyone a lot of time to narrow the range of possibilities down.

1 Like

The specular highlight in the second picture looks white, but the UI shows black.
Not sure what’s going on there?