prideout / svg3d

generate 3D wireframes as vector art
https://prideout.net/blog/svg_wireframes/
MIT License
353 stars 29 forks source link

back-to-front sort should use occlusion ordering #1

Open prideout opened 5 years ago

prideout commented 5 years ago

The current "sort by centroids" strategy is not robust, instead we should use a BSP as described in RTR 3rd ed section 14.1. This is what the old-school games like Doom did instead of z-buffering.

See this screenshot for an example of an issue that this will fix (gltf branch).

Screen Shot 2019-07-09 at 8 29 26 PM
prideout commented 5 years ago

The main problem with a BSP approach is that splitting is inevitable for scenes like this. Splitting might be acceptable for fill-only styles, but we'd like to allow clients to use stroke.

Instead of a BSP, it would be great to use a non-splitting visibility sorting algorithm, such as the one described in Visibility Sorting and Compositing for Image-Based Rendering by Snyder and Lengyel (attached).

VisibilitySorting.pdf NoSplitting.pdf