Skip to content

Commit

Permalink
Refactor insertion into BSP tree.
Browse files Browse the repository at this point in the history
Before this commit, inserting into BSP tree could easily overflow
the stack because we allocate very large stack frames and, on
convex geometries (e.g. a sphere), the BSP tree degenerates into
a "BSP list", thus requiring one large stack frame per triangle.
This can be reproduced by exporting a 2d shaded view of sphere.

After this commit, the stack frames only contan a pointer to
a supplementary data structure, and moreover it only allocates
its fields on demand, conserving heap memory as well.

As a side effect, an arbitrary classifier limit of 50 vertices
is removed.
  • Loading branch information
Evil-Spirit authored and whitequark committed Nov 27, 2016
1 parent d37f53e commit 7681f6d
Show file tree
Hide file tree
Showing 2 changed files with 299 additions and 197 deletions.

0 comments on commit 7681f6d

Please sign in to comment.