Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why does binbuffer store each primitives' bounding boxes' minimum and maximum separately? #14

Closed
regrow1123 opened this issue Sep 6, 2017 · 3 comments

Comments

@regrow1123
Copy link

regrow1123 commented Sep 6, 2017

on 1114 th line,

There are 2 integers, left and right.
Inside the for loop, based on each cell's right side we increase the left and decrease the right by one.
The left integer will increase if the primitives' bounding box's minimum exists left to the cut position,
however, the right integer will decrease if the maximum of it exists left to the cut position.

If there happens to be a triangle existing across the cut position, which means the primitive's bounding box's minimum is located left to the cut position and the maximum of it is located right to the cut position.

Then the summation of the left and the right must not be same to the total number of primitives, since
this triangle belongs to the both left and right.

I think this is able to harm the right computation of SAH value and make it difficult to decide a good cut position although the building of child nodes is working well because the primitive's will be classified by its center.

@syoyo
Copy link
Contributor

syoyo commented Sep 6, 2017

The code is based on binned SAH(I forgot the precise title of the paper I referred) and IIRC it computes SAH based on primitive's bbox.

Recently, some paper(I guess HPG 2015 ~ 2017 papers) shows using primitive's bbox work well for constructing BVH. Also, we are better to support spatial split BVH.

Contribution is always welcome!

@regrow1123
Copy link
Author

I guess the paper is
Stich, Martin, Heiko Friedrich, and Andreas Dietrich. "Spatial splits in bounding volume hierarchies." Proceedings of the Conference on High Performance Graphics 2009. ACM, 2009.

After reading this paper, I understand why we need this kind of construction of spatial split BVH.
Thank you for your comment.

@syoyo
Copy link
Contributor

syoyo commented Sep 7, 2017

#15

@syoyo syoyo closed this as completed Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants