ashwin.sudhir Posted May 11, 2012 Posted May 11, 2012 Suppose we have a huge map made up of a large mesh for the terrain. Would it help performance in any way if we cut the mesh into smaller pieces, but still have the origins of each mesh piece at the same spot? Thanks.
unclebob Posted May 12, 2012 Posted May 12, 2012 Hi, The better way is to use ObjectTerrain node. It's highly optimized for large scenes and handles surface operations by itself. But you can also use your approach by setting multiple ObjectMeshes in the world. Please read this topics about visible distance: https://developer.unigine.com/en/docs/1.0/code/scripting/library/objects/class.object#setMaxVisibleDistance_float_int https://developer.unigine.com/en/docs/1.0/code/scripting/library/objects/class.object#setMinVisibleDistance_float_int
ashwin.sudhir Posted May 14, 2012 Author Posted May 14, 2012 Sorry, but ObjectTerrain is not an option for us at this stage. Maybe I should make my question clearer. Fade distances are useful only in the case where the mesh is inside the view frustum, am I right? Suppose I have a large terrain mesh, in which case some part of the mesh will almost always be in the view frustum. I'd imagine this would not allow Unigine to cull the mesh away in the scene graph, consequently eating up some GPU bandwidth because of all vertices being sent to the GPU all the time. ( Ours is an RTS game with a Starcraft 2 style fixed camera. ) On the other hand, suppose we cut up the big terrain mesh into lots of smaller pieces. Got two questions here : 1. Will this enable early view frustum culling of smaller mesh pieces, thereby saving some GPU bandwidth? 2. If so, is this culling in anyway negatively affected by the fact that *all* the chunks have their origins at the world origin? We have the same questions about how ObjectWaterMesh is culled, too. What would be Team Unigine's recommendations in this scenario? Thanks.
unclebob Posted May 15, 2012 Posted May 15, 2012 Hi Ashwin, ObjectTerrain _is not_ single mesh solution. Its internall structure consist of surfaces which in their turn consist of patches (16x16 mesh grid). All this stuff are culled properly. I can't really see main reason why not to use ObjectTerrain. By the way, you can split your big mesh to smaller ones. 1. Yes, smaller meshes will be culled if they'll not be in view frustum 2. Culling is done via bounds check which are not related to the object's origin point I strongly recommend you to use ObjectTerrain.
ashwin.sudhir Posted May 16, 2012 Author Posted May 16, 2012 Hi unclebob, Thanks for your reply, your culling mechanism is clearer now. About ObjectTerrain, it was the artists' call choosing meshes for terrain, since they found it to be more flexible. This is not a problem for us because we do not need a dynamic LoD terrain since our camera is fixed, top down - you never see the horizon. Can we assume that the same culling behaviour applies for water meshes too? Thanks.
ulf.schroeter Posted May 16, 2012 Posted May 16, 2012 Can we assume that the same culling behaviour applies for water meshes too? Yes, all meshes/surfaces will we culled in the same way based on bounding box intersection with frustum.
Recommended Posts