-
Notifications
You must be signed in to change notification settings - Fork 192
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
New ray masking and backface culling implementation #184
Merged
Conversation
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
…e list is empty because it has no associated GPU devices. All platforms with no associated devices are now deleted from the platforms vector before commencing the unit tests. Furthermore the test now throws an exception if the list of platforms is empty.
The test was failing if ray masking support was enabled because it didn't force the usage of the 2-level BVH which, at the moment, is the only BVH that supports ray masking.
…ernels. The remnants of the deprecated ray masking implementation have been removed. The new ray masking implementation uses the mesh/shape id to distinguish whether a shape is masked or not on a per ray basis. With this new implementation, each ray can only ignore one specific mesh per call to the intersection kernel. However, the number of unique shapes that can be ignored is only limited by the positive range of a signed integer (MAX_INT - 1). When ray masking is disabled through the CMake config switch all ray masking checks in the intersection kernels are disabled at compile time to make sure that there is no performance impact when not using the feature.
This implementation utilises the order of the vertices of each triangle to determine whether the side facing the direction of the ray is the front or back side. The front side is defined as the side where all vertices of the triangle are defined in clockwise order. The implementation makes use of one of the two integer padding fields of the ray data structure to declare whether the ray needs to cull backfaces or not. Thus to enable backface culling for a ray, the new member variable "int doBackfaceCulling;" needs to be set to true/1 either manually or by using the new method "void SetDoBackfaceCulling(bool _bDoBackfaceCulling)". If backface culling is disabled via the CMake config switch (RR_ENABLE_BACKFACE_CULL; off by default) all backface culling checks in the intersection kernels are disabled at compile time to make sure that there is no performance impact when not using the feature.
…on non Visual Studio compilers.
Fixed warnings in x64 as well as x86 on visual studio platforms. Some improvements to the code to make use of C++11 features. (e.g. std::make_unique, = default/delete for constructors and destructors, override, etc.)
Some minor changes were reverted due to GCC compilation errors in linux. (g++ 7.3.0)
@scschaefer thanks a lot for your contribution! I will review and merge PR early next week |
@yozhijk Great! Looking forward to your feedback 😃 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
these commits contain a new ray masking implementation (for all OpenCL intersection kernels) as well as a backface culling implementation (also for all OpenCL intersection kernels).
These new features are optional and are off by default. If either feature is disabled in CMake all code related to them is disabled at compile time to make sure that there is no performance impact.
For a more detailed description of the new features' implementation, please have a look at the commit messages.
I'd love to hear what you think, and if you have any feedback or would like something changed, please let me know.
Cheers,
Sebastian