Is it possible to relax UVs on a terrain patch?
I’d like to code a relax tool that does just that: relax areas of the uvlayout that got way too many stretched triangles. But I could not find any information about properties or functions exposing the UVs of a Terrain or TerrainData object.
So, any chance to do what I want? Or am I stuck to making soft rolling hills with mesh standins for steep mountains?
There aren’t any UVs in a terrain object, it’s a heightmap. I seem to recall someone had a triplanar projection shader which works on the terrain, so you could try looking for that.
–Eric
There need to be UVs somewhere. Otherwise you wouldn’t be able to texture it. The question is: is there an API call that exposes the UVs of a terrain?
It’s actually not necessary to have UVs for texturing, depending on what you’re doing with the shader. But again, there are no UVs in a terrain object, it’s a heightmap. There might be UVs in the meshes generated by the terrain, but if so there’s no way to access them, since they only exist at runtime and change constantly.
–Eric
Thx, that’s what I wanted to know.
Edit: Since you edited your post, I might do so, too.
So what you say is: Unity does some kind of orthographic camera projection mapping with the terrain. It renders the terrain to a hidden (aka non-exposed) renderTarget and samples the final colors according to the splat prototype data?
That triplanar shader you mentioned is something that came up in my search before I went down the route of posting my question here. That shader is out of reach for the moment. So thx again for posting your insights.
I guess you had good timing and managed to catch the original for the 15 seconds that it existed.
No, that’s not necessary; it’s a shader and can use the splatmaps directly. If you download the shader source, look in Default Resources/Terrain Shaders.
–Eric