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:
but getting incorrect results if it crosses screen boundaries:
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.
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.