I'm trying to build an adequate axis aligned BSP tree for my raytracer that
only uses triangles. Usually the stop criteria for the build is when the
amount of triangles is less than a number (usually 2 or 3) or when the
maximum depth is reached. The problem is with triangles that share verices the build will only stop when reached maximum depth which is very sub-optimal. Usually one vertex is shared by 5 or 6 triangles which is
usually higher that you want in a node. The nodes that contains vertices
seem impossible to decompose any further.
I'm trying to solve this by with either when a node contains one or more
vertices recursion stops. Or, if a node contains only one vertex, set split
plane at the vertex and look at the other vertices to see what side the
triangle is on.
Do you have any better way to solve this? Because this is for a raytracer I
don't have to care about splitting the triangles.
only uses triangles. Usually the stop criteria for the build is when the
amount of triangles is less than a number (usually 2 or 3) or when the
maximum depth is reached. The problem is with triangles that share verices the build will only stop when reached maximum depth which is very sub-optimal. Usually one vertex is shared by 5 or 6 triangles which is
usually higher that you want in a node. The nodes that contains vertices
seem impossible to decompose any further.
I'm trying to solve this by with either when a node contains one or more
vertices recursion stops. Or, if a node contains only one vertex, set split
plane at the vertex and look at the other vertices to see what side the
triangle is on.
Do you have any better way to solve this? Because this is for a raytracer I
don't have to care about splitting the triangles.