Jump to content

  • Log In with Google      Sign In   
  • Create Account


Image space occlusion culling and occluder clipping


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 belfegor   Crossbones+   -  Reputation: 2362

Like
0Likes
Like

Posted 02 April 2013 - 09:13 AM

I am trying to use this library ISOCE to help my scene culling. So i generated my occluder (just one quad for test) and everything culls correct if whole occlusion quad is in view:

full.png

but getting incorrect results if it crosses screen boundaries:

partial.png

There is mention about that in librarys documentation:

The occluder Data contains the Quads that represent the virtual occluders.
The quads expected must:

        Be in Screen Space:

The x and y coordinates should be between 0 and BufferSizeX - 1. If the Occlusion Buffer is downsampled, then you should scale the points too.

        Have a Correct Depth Value:
        The depth should be a value between 0 and 1 (inclusive). If Occluder Boxes lay behind the near plane, clip the quads manually.



Since i am not math wizard i have tried and found some article with source about polygon clipping which might suit my need.

http://www.codeguru.com/cpp/misc/misc/graphics/article.php/c8965/Polygon-Clipping.htm

polygonclipdemo.jpg

Now i can obtain clipped vertices but don't know how to obtain depth data for those since i need that also? Please, any help?

Thank you for your time.

Sponsor:

#2 belfegor   Crossbones+   -  Reputation: 2362

Like
0Likes
Like

Posted 03 April 2013 - 12:07 AM

If something is unclear or you need more info please tell.

 

Bump.



#3 belfegor   Crossbones+   -  Reputation: 2362

Like
1Likes
Like

Posted 03 April 2013 - 03:10 PM

Solved.

Found some C# demo (with code) in their download package which does the job. I needed to clip polygons in "world space" against frustum planes and then transform to "screen space".

 

good.png


Edited by belfegor, 03 April 2013 - 03:13 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS