- Home /
External terrain renderer
Hi
I have been using Unity's terrain system to render paged terrains that are loaded asynchronously. Terrains are generated in Worldmachine 2 and look fantastic. Terrain scenes are saved as assetbundles. However a 50km by 50km patch results in about 120 MB of data. My app is actually a flight simulator for android. It already integrates JSBSIM flight dynamics model for simulation.
I was hoping if I could procedurally generate planetary scale terrain like this from C++ plugin that would generate a continuous LOD mesh and render it externally using OpenGL (though I have little OpenGL knowledge). I've tried running libnoise in a separate thread to generate heighmaps but assigning it to Unity terrain results in a momentary glitch. So I decided to render it externally. My questions are -
1) I know how UnityRenderEvent works on desktop but there is no explanation on how to do it from mobile. Do we need to call native render functions directly from a Camera's OnPreRender/OnPostRender ? And how?
2) How will I create shaders for that mesh.
3) How will render queue be defined for this native mesh? or is render queues a Unity specific thing.
4) Are render settings like fog set to OpenGL ES context by Unity or do I have to set them manually from plugin.
5) Is this all even possible or is there a simpler way of doing this?
Thanks a lot
A long time has passed since this, but I'd like to know if you managed to do what you wanted. By the time you asked this, I know you needed Unity Pro to be able to make it possible, now with Unity 5 it should be easier, but I'm lost, never used Pro features before and I'd like to do the same thing you try (tried?) to do for very extensive terrains. I'd be happy to do it only for PC, but if it can be done with OpenGL ES 3.1 (with tessellation support) for Android, that'd be great.
If you actually could do something regarding your original post, can you please answer yourself here for others to see?
Thanks in advance! best regards!