Hey!
I am very new to 3D-Programming, so sorry if that question sounds stupid but ...
whats the best way to load large scenes with thousands of static objects (like rocks, trees etc) ?
Can I simply import an .irr scene and the engine is smart enough to not care about that rock thousands of meters away?
If not, is there a builtin-mechanism to use that fog, that many games use to limit the range of view, ergo limit the amount of loaded meshes and especially rendered meshes?
Well, the amount of rendered meshes is limited, you can activate that fog if you want to, otherwise you have some hard clipping. But out-of-the-box Irrlicht does not support any mechanism to only load the parts of the scene that are visible, you'd have to implement somthing like that youself.
Well, we have octree scene management (only working of the scene is one large mesh, though), simple frustum culling (almost always active, but works only after loading the data to the GPU) and occlusion culling (working also on near objects, but same drawback as frustum culling). What you need is a sector management or so which handles several scenes or zones.
So I guess I will divide the map into areas and hold information of the current area and all neighbour areas in a list with a seperate list of already loaded objects. Then I'll check every x frames if new objects shall be loaded or objects should be unloaded (with a huge tolerance for unloading). The fog shall be close enough to make areas more far away invisible.
What do you think about that attempt?
you can activate that fog if you want to
Can you give me hint 'how' ? The only thing I found about fog is stuff about particle systems, which probably is the manual way ... but I guess Irrlicht can do it automatically for me?
Regards,
Ethon.
(Im Übrigen könnt ihr mir auch deutsch antworten wenn euch das lieber ist, dachte nur dass Englisch besser in ein internationales Forum passt )
Yeah, this is the international forum, so unless you are communicating in off-topic about personal things, all communication should be kept English
The zone approach should work quite good. You can use several scene managers to handle the scene parts, just some dummy nodes, or simply add and remove the whole part completely. Depends on how often you get back to the previous zones, and how much overhead the additional (non-visible) scene nodes add.
Fog is enabled via materials for nodes. You need to enable fog in all nodes which shall be affected by the fog. The fog color and other parameters are configured in the scene manager.
So to ask another valid question on top of the OPs, has anyone written a stream loader for scenes? I am sure I'll need one eventually so I figure I would ask.
Tangential, if you load a lot, the O(n^2) addition of the caches might bite you. I have patches to turn that to O(n*logn), see the patch tracker if interested.
Thanks for your answers.
But I start struggling at something way more primitive.
I am creating the terrain of my landscape via heightmap and ISceneManager::addTerrainSceneNode.
Whats the preferred way to texture different parts of the terrain differently? For example I'd like to texture the top of an mountain with a rock-like texture and texture a road with a sand-like texture.