-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ecere/gfx/3D: Proper implementation of Painter's algorithm for sortin…
…g translucent primitives - First, primitives are sorted by their mid point Z coordinates. If `maxFullSort` is set to 0, the sorting is done, otherwise the full sorting proceeds. - The default value for `maxFullSort` is 3000, fully sorting the 3000 primitives closest to the camera. - Further comparisons have no total order, therefore a topological sort must be used. - An XY overlap test (in normalized screen coordinates) uses a MinMax tree to quickly locate overlapping polygon pairs on which further tests must be performed. - The next check performed is whether all points of either primitive fall completely on the other side of the other primitive's plane compared to the camera, therefore one could never obscure the other. - A Z overlap check is then performed to see if one primitive could possibly obscur the other. - If `fullProjCheck` is set to true, a full check is done to see if either primitive obscurs the other once projected. - The full projection check determines whether one primitive intersects the tetrahedron formed by the camera and the points of a triangle being obscured. - Using new corrected Matrix::InverseTransposeTransform() method to compute full inverse transpose matrix and doing full plane transform with Plane::MultMatrix(). - This should correctly handle most cases except intersecting and cyclic overlaps.
- Loading branch information
1 parent
e851001
commit f298ea9
Showing
10 changed files
with
1,629 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.