ray-tracing-renderer
ray-tracing-renderer copied to clipboard
Mesh material array
For a cube I am currently using an array of MeshStandardMaterial and feeding it to the box mesh like this:
const matBFront = new THREE.MeshStandardMaterial({
....
});
const matBLeft = new THREE.MeshStandardMaterial({
....
});
...
...
....
const matBox = [
matBLeft,
matBRight,
matBBottom,
matBTop,
matBFront,
matBBack
];
const boxObject = new THREE.Mesh(geomBComplete, matBox);
This works in threejs but not when the raytracing renderer is turned on. The object just disappears. What is the best way to approach this problem ? Thanks!
The ray tracing renderer only expects a single material for each mesh. I didn't even know an array of materials was possible in Three.js!
https://threejs.org/docs/#api/en/objects/Mesh I'm looking at the documentation here and I see it can accepts an array. But what does an array of materials do exactly?
Duplicate of #241