Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status of Multiple Materials #12000

Closed
cybafelo opened this issue Aug 21, 2017 · 3 comments
Closed

Status of Multiple Materials #12000

cybafelo opened this issue Aug 21, 2017 · 3 comments
Labels

Comments

@cybafelo
Copy link

I don't know if multiple materials is now supported in any way?

MultiMaterial has been deprecated - but I cannot find any documentation or help on how to create a custom mesh (NOT a CUBE) with multiple materials - or how my faceVertexUvs structure has to look or how to get this working..

Any help or links please?

@imjasonmiller
Copy link

I might not understand correctly what you are trying to achieve, but supplying an array should work? Upon using THREE.MultiMaterial a warning should be logged to console, which reads:

THREE.MultiMaterial has been removed. Use an Array instead.

Example:

const geo = new THREE.BoxGeometry( 1, 1, 1 );
const mat = [
    new THREE.MeshBasicMaterial({ color: 0xFF00FF }),
    new THREE.MeshBasicMaterial({ color: 0x00FF00 }),
    new THREE.MeshBasicMaterial({ color: 0xFF00FF }),
    new THREE.MeshBasicMaterial({ color: 0x00FF00 }),
    new THREE.MeshBasicMaterial({ color: 0xFF00FF }),
    new THREE.MeshBasicMaterial({ color: 0x00FF00 }),
];
const mesh = new THREE.Mesh( geo, mat ); 

I'm using this for my own custom mesh.

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 22, 2017

As @imjasonmiller said, the only difference should be the usage of a plain array object instead of an instance of THREE.MultiMaterial. The setup of material indices in the geometries has not changed.

@Mugen87 Mugen87 closed this as completed Aug 22, 2017
@cybafelo
Copy link
Author

alright thanks - all good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants