[osg-users] Force redraw of PagedLOD nodes

Robert Osfield robert.osfield at gmail.com
Mon Aug 1 08:16:07 PDT 2016


Hi Simone,

The way I would implement a feature like this would be to use a shader
that computes the the colour per vertex, using a uniform value to tell
the vertex shader whether to use the intensity or the elevation as the
input to the colour.  To change colour you would simply change a
single osg::Uniform that you would attach to the view's master
Camera's StateSet.

This approach doesn't require any modifications to the scene graph and
works with paged and non paged databases. It also allows you to have
multiple views each with their own preference for how the scene should
be rendered.

Robert.

On 1 August 2016 at 16:07, Simone Rapposelli
<simone.rapposelli at gmail.com> wrote:
> First of all thank you for your reply.
>
> I have a point cloud structured in octree, where each node (PagedLOD) of the scene contains a part of the cloud which show points colored by their intensities using a gray scale (0: black --> 1: white).
> What I need is to let the user to show points colored by their elevation (z value) when he push a button in a toolbar.
>
> Nodes are loaded using osgDB::readNodeFile(path, myOptions), where myOptions is an object of a class I have derived from osgDB::Options and in which I have included some parameters that allow to set the color mode (elevation color or gray scale).
> So, when I need to switch to the evelation view mode, I update some parameters in node options using setDatabaseOptions method of my PagedLOD node and this works fine.
>
> The problem is that the colors on the scene are updated only when I move from the current position, while I need to automatically refresh colors from the same camera position.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68237#68237
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list