Menu

#472 CSG boolean evaluation with OpenCL

Incomplete
closed-accepted
None
5
2017-08-23
2017-07-17
No

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:

  • Incorrect shading for some partitions (some normals seem to be off)
  • Some more complex scenes have less partitions evaluated than expected

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

1 Attachments

Related

Patches: #472

Discussion

  • Vasco Alexandre da Silva Costa

    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
  • Vasco Alexandre da Silva Costa

    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.

     
    • Marco da Silva Domingues

      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

       
      • Sean Morrison

        Sean Morrison - 2017-07-18

        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.

         
  • Marco da Silva Domingues

    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

     
  • Marco da Silva Domingues

    Fixed the issue that was causing some interior normals to be wrongly represented.

     
  • Marco da Silva Domingues

    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.

     
  • Vasco Alexandre da Silva Costa

    • status: open --> closed-accepted
     

Log in to post a comment.