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" <[email protected]> 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
>[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