Tweak the map rendering based on camera position

classic Classic list List threaded Threaded
3 messages Options
GameCodingNinja GameCodingNinja
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Tweak the map rendering based on camera position

I'm not sure if I'm asking this question correctly so allow me to paint a picture of what I'm asking.

At a given camera position away from the terrain, I can see the level of detail gets courser as it gets further away from the camera. Is there a way to change this so that the coarseness of the detail is less extreme? In other words, the current level of detail goes farther into view and not quickly replaced with a lower resolution. Hopefully this makes sense.
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tweak the map rendering based on camera position

You can change the min_tile_range_factor setting to be larger than the default of 6.  (http://docs.osgearth.org/en/latest/references/drivers/terrain/mp.html?highlight=min_tile_range)
Or if you want to do it at runtime you can adjust the lod scale of the main camera.  In osgearth_viewer you can hit * to increase the lod scale (less detailed) or / to reduce the lod scale (more detailed).
You can do this in code in your app by doing:
viewer.getCamera()->setLODScale( myLODScale );

Hope that helps!

Jason

On Wed, May 24, 2017 at 12:33 PM GameCodingNinja [via osgEarth] <[hidden email]> wrote:
I'm not sure if I'm asking this question correctly so allow me to paint a picture of what I'm asking.

At a given camera position away from the terrain, I can see the level of detail gets courser as it gets further away from the camera. Is there a way to change this so that the coarseness of the detail is less extreme? In other words, the current level of detail goes farther into view and not quickly replaced with a lower resolution. Hopefully this makes sense.


If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/Tweak-the-map-rendering-based-on-camera-position-tp7590913.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
GameCodingNinja GameCodingNinja
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tweak the map rendering based on camera position

Thanks! That's exactly what I was looking for! I'm glad you were able to understand what I was asking.

I was able to change the setting in a slightly different way. I posted the code here in the event it might help someone else.

    osgEarth::MapNodeOptions map_node_options;
    map_node_options.enableLighting() = false;

    auto terrainOptions = map_node_options.getTerrainOptions();
    terrainOptions.minTileRangeFactor() = 12;
    map_node_options.setTerrainOptions(terrainOptions);

    mMapNode = new osgEarth::MapNode( mMap, map_node_options );

Loading...