I want to have an effect similar to this question, in Aframe, to have layered swappable textures on a single model:
I am wondering if there is a standard process I have missed in Threejs so that I can continue to use the standard shader; or do I have to fork it and add the multi-texture capability myself in a custom shader?
Thanks!
You want to layer materials or textures using three.js.
Here is a pattern that currently works:
var geometry = new THREE.BoxGeometry( 10, 10, 10 );
geometry.clearGroups();
geometry.addGroup( 0, Infinity, 0 );
geometry.addGroup( 0, Infinity, 1 );
geometry.addGroup( 0, Infinity, 2 );
geometry.addGroup( 0, Infinity, 3 );
var materials = [ material0, material1, material2, material3 ];
// mesh
mesh = new THREE.Mesh( geometry, materials );
scene.add( mesh );
three.js r.144
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With