Editing User:Caio/GSoC2023/FinalReport

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
<h1>Final Report</h1>
 
<h1>Final Report</h1>
  
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 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 was 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.
+
The final report presents how to load and render a VDB object, lists the functions and structures that were implemented and features that could be implemented in the future.
  
 
Branch: https://github.com/cjsb/brlcad/tree/vdb
 
Branch: https://github.com/cjsb/brlcad/tree/vdb
Line 9: Line 9:
 
<h2>Usage</h2>
 
<h2>Usage</h2>
  
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.
+
To load a VDB object, the user must use the ''in'' command. After that, the user interface will ask for 3 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.
 
The application ''mged'' was used to load and visualize a VDB object, as can be seen in the image below.
  
[[File:MgedVDBnew.PNG]]
+
[[File: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.
 
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.
Line 19: Line 19:
 
[[File:SphereVDB.png|300px]]
 
[[File:SphereVDB.png|300px]]
  
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 [https://www.openvdb.org/download/ OpenVDB website].
+
Note that the user must change the ''# of Processors'' to 1 in ''Advanced Settings'' since the parallel operations for VDB ray intersector is not implemented. Also, the vdb primitive support only ray tracing of level set VDB objects. Several samples can downloaded in the [https://www.openvdb.org/download/ OpenVDB website].
  
 
<h2>Implemented functions and structures</h2>
 
<h2>Implemented functions and structures</h2>
Line 25: Line 25:
  
 
* rt_vdb_internal: structure that stores the name of the VDB file and a pointer to the grid handle of the VDB object.
 
* 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.  
+
* vdb_specific: structure that is prepared before the ray tracing and stores a pointer to the VDB grid.
  
 
<h3>Functions</h3>
 
<h3>Functions</h3>
  
* rt_vdb_plot: Plot VDB's bounding box
+
*A
* rt_vdb_import5: Import VDB from the database format to the internal structure.
+
*B
* 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.
 
  
 
<h2>Results</h2>
 
<h2>Results</h2>
Several renderings of VDB objects can be found below.
+
Several rendering of VDB objects can be found below.
  
 
[[File:TorusVDB.png|450px]]  [[File:DragonVDB.png|450px]]
 
[[File:TorusVDB.png|450px]]  [[File:DragonVDB.png|450px]]
Line 44: Line 39:
 
[[File:BuddhaVDB.png|450px]] [[File:BunnyVDB.png|450px]]
 
[[File:BuddhaVDB.png|450px]] [[File:BunnyVDB.png|450px]]
  
Note that the red square is due to the bounding box visualization.  
+
Note that the red square is due the bounding box visualization.  
  
 
<h2>Future Work</h2>
 
<h2>Future Work</h2>
* 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 different VDB scenes, being able to render 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 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.
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)