- Home /
Geomorphing terrain with a vertex shader (custom vertex data maybe?+
Hello everyone, I'm trying to get geomorphing working (better) in my planetary terrain engine. Geomorphing is where you morph from a lower resolution mesh to a higher one, in this case to reduce "popping" you see in the terrain. I want to be able to do it in the vertex shader, by passing a couple floats, rather then sending new mesh data every frame.
What I currently have is the main terrain stored in vertices, colors, and normals of the mesh, and then the collapsed vertices are stored in mesh.tangents. I then lerp between them based on a float value passed to the vertex shader. However, I soon realized that I also need to store the collapsed colors and normals as well. I could use the two texture coordinate's but I still wouldn't have enough room.
So I'm wondering if anyone has any ideas on how better pack data into the mesh class somehow, or if there's a way to send custom data to the vertex shader (didn't seem possible with Unity meshes), or just a different better way to do this. This is a pretty specific subject it seems, but hopefully some shader experts can help me out, Thanks!
You might get a better response to this kind of question on Unity Forums.
Very cool idea. Haven't the foggiest, though I don't recall ever seeing a way to add arbitrary data to a mesh beyond what you're already doing. Guess you could pack data into helper textures? I'm curious to hear what you come up with. How about sharing that shader when it's finished? /shameless beggar
Thanks for the responses, friends. Ya maybe I will try posting in the main forums, I didn't realize those were a different section. If I get things working I will for sure post it somewhere! Probably r/Unity3D or r/gamedev.
Your answer
Follow this Question
Related Questions
Odd lighting effects to dynamically created tree prefab 2 Answers
Transform all Terrain Vertices to Map to Sphere 0 Answers
Unity overlapping transparent spheres 1 Answer
Strange shading on procedural mesh 0 Answers
Getting Mesh from Terrain 1 Answer