# Why does my material look blotchy on this mesh?

This is a generative mesh - wireframe looks like this

Here's the material

But the shaded object looks like a tie dye tshirt

I've no idea what settings are causing it to look like this. These are the settings of the mesh renderer

• How did you set up the UV map for that mesh? If you didn't, then that's what you need to do. – Philipp Dec 17 '20 at 11:30
• There isn't one - that sounds like a good lead, thanks – Tom Dec 17 '20 at 11:46
• I'd also be curious how you've generated the mesh normals. We're seeing very strange interpolation artifacts between the vertices, which can happen if your normals are seriously warped around compared to the surface. – DMGregory Dec 17 '20 at 12:59
• Quick correction: your second image shows a texture not a material. Materials can use textures, but the two are separate things. – jhocking Dec 17 '20 at 16:38

So when you generate a mesh using the Mesh class, make sure that you don't just fill the .vertices array but also the .uv array with one Vector2 for each Vector3 in your vertices array.
• I've no clue how to do this - is it as simple as mesh.SetUVs(0, vertices) or do I need to do a more complex process? I also ran mesh.RecalculateNormals() to get the normals, but this doesn't seem to have made any difference to the rendering. – Tom Dec 17 '20 at 15:13
• @Tom every Every Vector3 in your vertices array needs a corresponding Vector2 in your uv array. These Vector2's are pixel-coordinates on your texture and are used to determine which part of the texture is visible on which polygon. So the values depend on how exactly you want to apply your texture. There is no simple one-line shortcut for this. You will have to think about this for a bit. – Philipp Dec 17 '20 at 15:41