Difference between revisions of "User:Caio/GSoC2023/FinalReport"

From BRL-CAD
Line 51: Line 51:
 
* Add support to multithreading in the ray tracing which would allow faster image generation.
 
* Add support to multithreading in the ray tracing which would allow faster image generation.
 
* Add support to load nanovdb file.
 
* Add support to load nanovdb file.
 +
 +
<h2>Final Remarks</h2>
 +
I think that the GSoC experience was great. I was able to contribute to BRL-CAD and also learn about OpenVDB which is an established library used in feature film production. I would like to thank BRL-CAD for the opportunity to do this project. And I also would like to thank my mentor and developers of BRL-CAD as they were always there to help me with any question or problem.

Revision as of 17:31, 3 October 2023

Final Report

The main goal of this project is to add support for VDB in BRL-CAD. To achieve this goal, the open source C++ library called OpenVDB library was used and a VDB object is stored into a new primitive called vdb. In order to visualize the object, the necessary functions to ray trace a VDB object were added.

The final report presents how to load and render a VDB object, lists the functions and structures that were implemented and presents features that could be implemented in the future.

Branch: https://github.com/cjsb/brlcad/tree/vdb

Usage

To load a VDB object, the user must use the in command. After that, the user interface will ask for 3 pieces of information: 1) The name of the object; 2) The type of the object (The user must type vdb); 3) The path for the VDB file.

The application mged was used to load and visualize a VDB object, as can be seen in the image below.

MgedVDB.PNG

Once the object is loaded, the bounding box of the object will appear in the preview interface. After that, the user can perform a ray tracing of the scene and the object will be renderer, as can be seen below.

SphereVDB.png

Note that the user must change the # of Processors to 1 in Advanced Settings since the parallel ray intersection of VDB ray is not implemented. Also, the vdb primitive supports only ray tracing of level-set VDB objects. Several samples can downloaded in the OpenVDB website.

Implemented functions and structures

Structures

  • rt_vdb_internal: structure that stores the name of the VDB file and a pointer to the grid handle of the VDB object.
  • vdb_specific: structure that is prepared before the ray tracing. It stores a pointer to the VDB grid and stores the normal and world position of a hit.

Functions

  • rt_vdb_plot: Plot VDB's bounding box
  • rt_vdb_import5: Import VDB from the database format to the internal structure.
  • rt_vdb_export5: Export VDB.
  • rt_vdb_bbox: Compute the VDB's bounding box (max and min points).
  • rt_vdb_prep: Prepare the data for the ray tracing.
  • rt_vdb_shot: Intersect a ray with a VDB.
  • rt_vdb_norm: Compute the normal if a ray intersects a VDB.

Results

Several renderings of VDB objects can be found below.

TorusVDB.png DragonVDB.png

BuddhaVDB.png BunnyVDB.png

Note that the red square is due to the bounding box visualization.

Future Work

  • Add support to Linux build.
  • Add support to different VDB scenes, being able to support VDB files with fully volumetric scenes and point cloud.
  • Add support to multithreading in the ray tracing which would allow faster image generation.
  • Add support to load nanovdb file.

Final Remarks

I think that the GSoC experience was great. I was able to contribute to BRL-CAD and also learn about OpenVDB which is an established library used in feature film production. I would like to thank BRL-CAD for the opportunity to do this project. And I also would like to thank my mentor and developers of BRL-CAD as they were always there to help me with any question or problem.