[osg-users] Visualization of billboards depending on pre-conditions

tianzjyh tianzjyh at 126.com
Sat Jan 7 18:02:38 PST 2017


Hi, Hartwig,
    I think you have to use multi-pass rendering to make this special depth test work. 
    
Here is my idea, 
    pass 1:  render foot separately to a texture without depth test, and writes only 1 or 0 to the texture, 1 while the pixel is part of foot, 0 otherwise. 
    pass 2:  render foot separately to a texture with depth test, and also writes only 1 or 0 to the texture, 1 while the pixel is part of foot, 0 otherwise. 
    pass 3:  read these two textures back to your client memory from GPU, and compare whether these two textures are the same. If are the same, render the whole billboard, otherwise depends on your decision.


   You can set the view-port smaller but with the same width-height ratio when rendering the first two passes, so the texture size will be small enough to be efficiently. 


    Idea above is based on rasterization and should work conditionlessly.


    I think another idea is to use ray-intersect-test. Let's say your foot is a rectangle geometry with a texture, then you can cast a ray to the camera from each point of the four corners(if four is not enough, cast more), and see if any ray hit something. It is also an easy way to see if the foot is hidden by other items. 


Cheers, 
---
TianZJ



At 2017-01-08 02:39:18, "Hartwig Wiesmann" <hartwig.wiesmann at skywind.eu> wrote:
>Hi,
>
>I would like to show a complete billboard when a certain part of the billboard is visible. Although other parts may be (partially) hidden by other items.
>
>Example: assume that the billboard is a sign consisting out of a foot, pole and the sign itself. Whenever the foot is visible (depth test passes for the whole foot) I would like to show the complete sign. Even if the depth test for the sign fails for certain parts of the sign (but not for the foot).
>
>Does anybody have any ideas how to set up such a test and following visualisation efficiently?
>
>Thank you!
>
>Cheers,
>Hartwig
>
>------------------
>Read this topic online here:
>http://forum.openscenegraph.org/viewtopic.php?p=69920#69920
>
>
>
>
>
>_______________________________________________
>osg-users mailing list
>osg-users at lists.openscenegraph.org
>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170108/e6a8c2f9/attachment-0002.htm>


More information about the osg-users mailing list