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 Mesh Renderer Component of the object.
How would I go about using them to do the UV for my Mesh?
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. Make 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.
Well I thank you for attempting to help me.
You need to learn about submeshes.
I am not sure SubMeshes would work in this case. I am using a modified version of the ChunkRenderer from BlockStory's Tutorials. Any Ideas?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
17 People are following this question.
Texture on Unity Meshes
Normalizing mesh UVS?
How to create a procedural mesh with multiple materials?
Custom Mesh UV Problem
Combining meshes with correct tiling