Sign in to follow this  

Line rendering on terrain

Recommended Posts

Hi! I'm working on a earth map using a LOD algoritm with matching texturing (quad-tree) and everything is working fine so far. I would like to add the possibility to view grid lines and country border lines on top of the already rendered 3d map - with the lines following the height of the map. I've googled a lot to find a suitable approach, and so far the only option I've found is to render the lines to a texture and then render the map again with the new texture. Anyone know an alternativ approach because the map is HUGE and I don't want to be limited to the size of the texture I render the lines to. Is it possible to render lines "looking down" on the map to already rendered depth etc? In the future it may be needed to render other "effects" (with textures) on the map and it would be nice if the sollution above could cover that aswell. Thanks, Eitraz

Share this post

Link to post
Share on other sites
An alternate method is outlined in this paper.

The idea borrows from the shadow volume technique for creating shadows. Create a long thin box that represents your line where the line is to be drawn. The bottom of the box is below the terrain and the top is above; ensure that this is true for all of you terrain levels of detail. The box is analogous to a shadow volume. Color the terrain where the shadow is cast, i.e., the terrain that is contained within the box.

The advantages of this method is that the line is independent of terrain level of detail and does not require texture modification.

The disadvantages of this algorithm is that you will notice the line break up here and there depending on the view angle, the line will smear down the steep inclines as with mountainsides, the method tends to become fill rate limited in the way shadow volumes do, and the paper does not describe how to control line widths.

Where I work, we independently designed and implemented this method a few years ago for our product. We also wrote a vertex shader to modify the box vertices based on view distance and angle to control the line width in pixels.

As the paper describes, the method is also good for rendering filled areas. Instead of a long thin box, create a closed mesh that follows the boundary of your area, e.g., a country. Again, color the terrain inside the mesh. We have implemented that some time ago too with texturing.

I am currently working on a new method that creates lines that do not break up or smear down steep inclines and has the same advantages as the previous method. It works in its current form, but I need to do more testing. Hopefully, I'll describe this method in the future.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this