- Home /
Can I Assign Different Material To Each Quad In A Mesh?
Basically, I have a 2D level map I'm building procedurally for a Match 3 type game. I have the data structure for the grid and path the user will take. I also have a method that builds a mesh based on the existing grid and path data structure.
unfortunately, there's a gap in my knowledge. I can make a single material span the entire mesh properly but I can't figure out how to make a single tile span only one quad on the mesh. The idea being that I have a tilemap spritesheet that has tiles, each representing something different(tree, path, grass, rock, etc.).
I understand that I can do some math to figure out the range and size the quad spans relative to the mesh, however, how do I actually change the material that should be painted to the specific quad?
Answer by Eric5h5 · Mar 15, 2015 at 12:20 AM
You'd need to make a submesh for each material, however that's not a good way to do it. Instead use a texture atlas and UV mapping.
Texture Atlas is exactly what I was looking for, thank you.
Your answer
Follow this Question
Related Questions
Whats causing this weird texture stretching on my mesh? 1 Answer
Generate mesh based on 3d array. 1 Answer
Sphere made of cubes algorithm 4 Answers
Cant put material of Unity on mesh created with C4D 1 Answer
mesh deformation to a shape ,how do i found that my mesh is deformed to a specific shape 0 Answers