[osg-users] Seeking advice: Efficient method for large grid rendering (terrain) with unique state per grid square

John Peterson halalkitty at gmail.com
Fri Sep 11 08:00:23 PDT 2015


Okay. Let me step back a bit and attempt to explain what I'd like to do without tying it to any particular OSG or scene graph concepts as much as possible. I'll let those more experienced than I suggest what might be the best approach to achieve this.

So I'm a roads enthusiast, and I've always wanted to create an application that allows me to design a network of roads and virtually drive it. Several years ago, I created a number of 2D tiles, basically square images that have an overhead view of different types of road segments on them. For instance, one set of those tiles are straight road segments of various widths and painted lines. Another set expands on that by adding intersections. Some of the road segments curve to one of the corners, etc. The idea was then I could put these 2D tiles together in a large grid and voila, I've created a map. It's an overhead view of a map, however--not terribly suitable for simulating a Sunday drive.

What I want to do is take these tiles and use them in a 3D application where I get that first-person drive-like experience by moving my camera along the grid. Now a flat terrain would be somewhat boring, so I wrote an application that generates a reasonable-looking random terrain (in the sense that it outputs an array of height values; it doesn't actually do any rendering at this point). Each of the squares in this grid, I'm hoping, can be textured with these tiles I've already created, such that the road network of my design is projected on my terrain. From there, I can add road signs, traffic lights, light standards, etc. etc.

Hopefully that gives you a better picture of what I'd like to ultimately do.

I was concerned that as my world size grows, I'd hamper the rendering performance despite the fact that I'm not showing large portions of my terrain a lot of the time (everything not in my field of view, for instance). At the same time, however, if I have a large mountainous feature in the background, I would think it should still be visible as it would be in real-life.

Thanks again for reading.

Best regards,
John

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65117#65117








More information about the osg-users mailing list