
▲ 1 r/threejs
Need help understanding and implementing specular color (node material)
Hello. I have been trying to add specular color to my mesh. From what I understand (which could be wrong), it should add a tint to shiny/reflective areas of the surface. However, it does not seem to have any effect. Here is is an example:
let geometry = new THREE.BoxGeometry(100, 100, 100).toNonIndexed();
let sampleCube = new THREE.Mesh(geometry);
sampleCube.position.set(0, 0, -100);
let material = new WebGPU.MeshPhysicalNodeMaterial({
color: 0xFFFFFF,
roughness: 0.0,
metalness: 0.75
});
material.specularColorNode = TSL.vec3(1, 0, 0);
sampleCube.material = material;
scene.add(sampleCube);
This makes a white cube which I think should have a red specular color. However, when I render the cube I get no red: https://imgur.com/a/aleascH
I have tried adjusting the roughness and metalness from 0 - 1 but I never get any red color appearing. I have also tried different combinations of ambient, hemisphere, and directional lighting but that also never gives any red color.
Does anyone have any ideas of what I'm doing wrong? Any help would be appreciated.
u/GoGoGadgetTotems — 5 days ago