[osg-users] Get current Billboard ModelView matrix?

Robert Osfield robert.osfield at gmail.com
Thu Jun 30 03:40:49 PDT 2016


Hi Philip,

In your scene graph are there dynamic transforms or is it just the
changes in the camera's view matrix that is altering the accumulated
modelview matrix?

Robert.

On 30 June 2016 at 09:44, Philipp Meyer <philipp.meyer at fh-bielefeld.de> wrote:
> My goal is to create a fragment shader that computes the delta distance to each fragment compared to the previous frame.
>
> In the shader, I can easily calculate the current distance to a fragment by using built in functions, the problem is that I also need access to the fragment position in the PREVIOUS frame in order to compute the delta and generate the output.
>
> As the vertex and fragment shaders have no native access to data of the previous frame my idea was to use uniform variables to pass the viewMatrix and the modelMatrix of the PREVIOUS frame to the vertex shader.
>
> I can easily retrieve old viewMatrix by setting a uniform variable in the program main render loop after the current frame completed.
> However, it is very difficult to obtain the old modelMatrix because the modelMatrix is unique to every primitive in the scene (or in other words, there are many modelView matrices and not just one).
>
> So, the only solution I found was to attach a uniform to every transform node in my scene graph and store the previous modelMatrix in it.
> This is very CPU intensive but works okay, unfortunately I do not yet take Billboards into account and this is why I need to calculate the modelMatrix of a Billboard.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67926#67926
>
>
>
>
>
> _______________________________________________
> 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