- Home /
How to set up a world map texture on a series of individual country meshes?
I'm trying to texture my country shaped meshes with an equirectangular map projection of the world. The country shaped meshes were made using a equirectangular map projection, and curved along a sphere. I'm using the same material for all country meshes, i.e. their meshRenderer.sharedMaterial is one linked from the project.
As shown in the video, the texture just doesn't sit nicely with the meshes, no matter how I modify the tiling and the offset. Even if the texture somewhat fits in North America, it is completely off in South America. I have a hunch that I might be incorrectly using the equirectangular map projection as the texture, because the meshes have been curved along a sphere(i.e. that I would need to curve the projection in a similar fashion for the texture coordinates to align with the mesh coordinates). I'm not sure about the aforementioned hypothesis because of how a texture nicely wraps around a sphere(also shown in the image).
Before I start fixing my problem, it would be very helpful to know what I'm doing wrong. Any information, insight or hints are welcome.
Answer by dorusoftware · Jul 24, 2020 at 09:11 PM
the material uses the UV0 map to put the texture on the mesh.
so to have this work correctly you need to map the each country points/polygons to be in the correct location with the correct distortion .
and don't forget that UV maps are squared while your world map have a 2 to 1 ratio, so you need to take that in account
it would had probably worked quick and dirty if unity had UV sphere projection, which I think they don't have
Is there a way to easily fix UV0's inside of unity, or should I really look into creating my meshes in a 3d modeling program like blender?
Honestly I don't know. I didn't see an option in unity to deal with UVs. $$anonymous$$aybe there is some asset store item who can do this but I suggest following the usual workflow of preparing the mesh in a dedicated 3D app like Blender.
Now that you have asked maybe you can give a try to ProBuilder package. If you convert your mesh to be a pro builder maybe you can play with the UVs
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
Best way for creating a high quality world map 0 Answers
Building Unity map best practises 0 Answers
Stopping overlapping textures from flickering? 7 Answers
Open World RPG Project 5 Answers