[osg-users] VPB and terrain normals

Robert Osfield robert.osfield at gmail.com
Thu Nov 24 07:49:59 PST 2016


On 24 November 2016 at 14:32, Trajce Nikolov NICK
<trajce.nikolov.nick at gmail.com> wrote:
> anyone with a knowledge if VPB is generating normals for the terrain skin
> and can point me to the code snippet where these normals are being
> calculated?

By default VirtualPlanetBuilder creates paged databases that use
osgTerrain::TerrainTile for the representation and rendering of the
individual terrain tiles. The height field component
(HeightFieldLayer) is uses an osg::HeightField internally to store all
the heights, no normals are stored.

The normals used for rendering at created by the TerrainTechnique, if
you use the default osgTerrain::GeometryTechnhique then it'll create
an osg::Geometry with vertices, normals and texcoords to do the
rendering.  If you use the DisplacementMappingTechnique then it'll be
the shaders that that will compute the normals in the vertex shader.

Robert.



More information about the osg-users mailing list