This patch contains an initial version of the code to perform boolean evaluation of CSG scenes in OpenCL and was created against the opencl code branch.
It contains the code to weave segments into partitions (rt_boolweave), the code to evaluate partitions (rt_boolfinal) and the shading of the evaluated partitions.
There are still some bugs in the code as:
Apart from that, the results look promising and ok for most scenes I have tested (this includes the scenes 'share/db/operators.g' and 'share/db/boolean-ops.g'). Some images can be found here: https://brlcad.org/wiki/User:Marco-domingues/GSoC17/Log#12_-_14_July
You aren't indenting the code properly. You have to use indent with 4
spaces, not 8 space tabs.
See the HACKING document for more details.
Last edit: Vasco Alexandre da Silva Costa 2017-07-18
This has some nasty bugs when run over a GPU. Look at this:
http://imgur.com/a/bgLK2
I'll commit it to the BRL-CAD opencl SVN branch nonetheless (this rendering mode is optional) so we can better keep track of it. But we need to fix these bugs.
Please update your sources and develop from the opencl branch now.
It looks like this bug occurs when drawing the geometry with the command: 'e *'. For my tests I was drawing the geometry via the 'Geometry Browser' (Edit-> Browse Geometry). Will investigate
You almost never want "e " as that will draw every object and every primitive used to construct objects. If you run the "tops" command, you'll see the top-level geometry objects that you will usually want to draw.
Fixed the issue of adjacent partitions writing to same position of the bit arrays.
Optimized the process of iterating over bit arrays.
Fixed the weird results when drawing geometry with the command 'e *' .
Changed the code to use 1 regiontable per ray instead of 1 regiontable per partition
Fixed the issue that was causing some interior normals to be wrongly represented.
Optimization on the process of building the regiontable, by precomputing the regions involved in each primitive instead of calculating this for each partition inside the rt_boolfinal kernel.