So now I’ve got the basics down for actually using the engine, and i’m working on implementing some of the visualization strategy for my simulation. This is a general question about handling procedural world data and map building, so let me know if it’s not engine-specific enough and/or steer me towards an appropriate place to find the answer.
I’ve got code already that builds a large-ish (currently testing around 200x200, would like to support up to ~500x500) tilemap of interior space (rooms, walls, doors, hallways, etc), and i’m slowly building up low-poly 3d assets for furnishings and decorations. Ideally i’d like to use some LOD substitutions to allow continuous zoom from the full map size down to individual rooms (omitting details in favor of general floorplan model at distance zoom), although this has been a struggle in every visualization implementation i’ve tried (2d, 3d, whatever). My question is two parts:
i think i can build room meshes dynamically either using ground/plane, simple assets (e.g. doors, windows, etc) and mergemesh or by constructing vertices arrays from scratch, but i’m unclear on how to optimize multimaterial and uv mapping to skin the final room interior mesh… do all vertices needing a particular submaterial need to be grouped or can i add those material mappings on a face-by-face basis? these individual room meshes would then be added to the scene octree, and should (hopefully) allow the full map to be rendered at a distance, only rendering the few dozen room meshes themselves, instead of the many thousand individual ground/plane instances i’m toying with now. TiledGround seems out of the question as any large amount of subdivision (>~32) will freeze the system during generation, and while using an intermediate array of say 10x10 TiledGround might be workable i’d really rather have meshes-per-room for things like selection outlining if possible. is my plan a viable way to handle the data or are there smarter tactics others have used?
when using LOD, i’m guessing that objects with a null setting (to not render) at a certain distance still need to be checked every frame, which might become untenable with thousands of objects (furniture, decoration) at a distance view. i know there are renderGroupIds available, is there a switch to turn these groups on/off wholesale so that say an ‘object’ layer can be disabled at a certain zoom distance to avoid even looking through this list at all? and how would this affect a scene octree? can multiple octrees be used and again turned on/off in a single stroke?
These are some initial questions coming up for me as i try to plan out my visualization code; I’m sure i’m missing a million other questions i should be asking as well, and i’m sure i’ll have many more, so feel free to point me in another direction or share any indirectly related advice on the subject that might be relevant. I’m an old hand at programming in general and have played with graphics programming many times, but this is my first real foray into serious 3d engine work, so any and all advice is appreciated.