Hello,
As combined, I have made some improvements on the code (based on Vasco’s
feedback) and implemented an overlap handler to resolve the issue of
overlapping partitions, completing the rt_boolfinal kernel and submitted an
initial version of the code: the patch was created against the opencl code
branch and can be found here https://sourceforge.net/p/brlcad/patches/472/
<https://sourceforge.net/p/brlcad/patches/472/>.
As I state in the ticket, the patch 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:
Incorrect shading for some partitions (some normals seem to be off)
Some more complex scenes have less partitions evaluated than expected. (I
believe this issue comes from some partitions reporting overlap when they
shouldn’t, but still have to further investigate what is causing that)
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
<https://brlcad.org/wiki/User:Marco-domingues/GSoC17/Log#12_-_14_July>
Right now, I am using a bitarray to represent the regions involved in each
partition, and this seems to be an inefficient solution, because of the high
number of regions that some complex scenes have (to evaluate one partition and
to resolve any overlap that may occur, I have to iterate over all the regions
and test the bits, which can be very slow for some scenes).
The ‘share/db/goliath.g’ scene has a total of 1447 regions, and despite that,
the max number of regions involved in one partition is 15 (from some profiling
I made over the ansi c code).
In the next days I’m planning to work on replacing the bitarray to a solution
that uses a list to represent the regions involved in each partition
(regiontable), which despite using more memory, should be considerably faster.
Cheers,
Marco
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel