Currently, I'm delving into a basic demo using three.js
and finding myself perplexed by the way THREE.MeshPhongMaterial
behaves, especially since I come from a background working with the Unity Game Engine.
create_ring() {
// creates a ring mesh based on provided class data
const material = new THREE.MeshPhongMaterial({
color: this.color,
emissive: this.color,
emissiveIntensity: 1.6
});
const ring_geo = new THREE.TorusGeometry(this.radius, this.thickness, 16, 100);
// Move in space
ring_geo.translate(5, 5, 0)
// apply texture to mesh and return
const ring_mesh = new THREE.Mesh(ring_geo, material);
ring_mesh.receiveShadow = true;
ring_mesh.castShadow = true;
ring_mesh.name = "ring";
return ring_mesh
}
I originally thought that the materials would create a soft pool of light on the floor geometry, but after some research, it seems like I might need guidance on how to achieve this as a shader feature? Or maybe I am just not grasping the constraints and behavior of materials in three.js
? Below is an example showcasing what can be done with a material's emissive option in Unity.