That would work, but I can't really afford the per-frame cost - I'm trying
to only pay for picking when it's actually being used (in which case a
pretty high lag is fine). Maybe I should be asking this differently -
what's the best way to render one frame of a small portion of my scene
graph off screen and read back the results?

Max


On Fri, Sep 27, 2013 at 5:19 PM, Aurelien Albert <
[email protected]> wrote:

> Hi,
>
> I've got the same picking problem with several mesh (which use vertex
> displacement or tesselation).
>
> To solve that, I always render my scene in a FBO, with 2 color
> attachements :
> - first draw buffer is a regular color texture
> - second draw buffer is a texture with only 1 channel, in "int" format
>
> My shaders always write an "objectId" value in the second buffer. Then I
> can pick a pixel at anytime. You can also get the 3D world position of the
> pixel using its window coordinates, its depth value and the camera matrices.
>
> This not ideal picking, it consume a lot of GPU memory bandwitdh (but on
> modern GPUs it's not a problem), but it's easy to setup and for
> applications which need exact picking it may be the best solution.
>
>
> Cheers,
> Aurelien
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=56528#56528
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to