- Home /
Is it possible to use Multiple Materials on a single mesh?
I have recently switched from using individual cubes to creating a single mesh, generated at run-time, to represent blocks in my game. I have run into a bit of an issue. I have too many blocks to use a single texture atlas, since the max is 4096x4096 I will need to use ~4.
I was wondering if there was a way to use more than one material for this.
I would prefer to be able to use the Materials I was using previously if at all possible. That way I don't have to attempt to do the normals and such on more atlas...
So, My question is, can you use more than on Material to UV a mesh, and if so how?
So, Can anyone help me?
Sure, just change the size of the material array in the $$anonymous$$esh Renderer Component of the object.
How would I go about using them to do the UV for my $$anonymous$$esh?
You'd most likely need to unwrap your 3D model in the external application you used to model the mesh, then just export multiple versions of your UV map. $$anonymous$$ake a separate material for each map. You may need to use a transparent shader depending on your needs.
I might not have been clear above. I am generating the mesh at runtime.
You need to learn about submeshes.
http://answers.unity3d.com/questions/312492/submesh-creation-from-script.html
I am not sure Sub$$anonymous$$eshes would work in this case. I am using a modified version of the ChunkRenderer from BlockStory's Tutorials. Any Ideas?