- Home /
Correctly applying materials to procedural meshes
Hey,
I have a tool that creates randomly generated low poly meshes, and I have a material of a stone wall. When I apply the material to a standard Unity cube, I see all the bricks as expected, but when I apply it to my procedural mesh, the bricks don't show up, the mesh has 1 consistent color.
What is the issue here and in what direction should I look to solve this?
Alex
Answer by Bunny83 · Apr 15, 2017 at 11:49 AM
You have to generate UV coordinates for every vertex in your mesh. There is no "correct way" how those should look like since it entirely depends on your mesh. UV unwrapping is usually done manually by an artist for modelled objects. When you generate your meshes procedurally you have to take care of generating the UVs procedurally so the texture looks the way you want it to look.
See UV mapping. Here's a blog post that explains UV coordinates briefly
edit
I've once written an UVViewer editor window which allows you to view the UV unwrap of an object in the scene inside Unity. Just place this script into an "editor" folder in your project and open it via: "Tools --> B83 --> UVViewer" from the menu
Thanks! I want to apply a texture that is just a plain color with some moss on it. The meshes are rocks so I shouldn't really matter where these moss spots are. Thanks for the links, I'll check them out.
Edit damn that tool looks amazing!
Your answer
Follow this Question
Related Questions
Update a texture at runtime using UV 0 Answers
uv Tiling y error 2 Answers
Procedural Mesh UV Problem (UVs 'mirrored' instead of 'repeating') 0 Answers
Normal maps not applying to certain faces of a mesh 2 Answers
Polygon buffering/offsetting? 1 Answer