top of page
Search

Week 8: Shading again

  • Writer: Karinne Lorig
    Karinne Lorig
  • Jul 11, 2019
  • 2 min read

The tasks for this week were to get both a reflection and lighting system up and running and also to investigate the way Falcor builds up its top and bottom level acceleration structures.


Acceleration structures are bounding volume heirarchies used by the DXR ray tracing API to speed up collision checks by grouping nearby objects together and checking for collision with the group before checking against any of the objects individually. Falcor builds the bottom level acceleration structure when a given model is first loaded. It's worth noting that this bottom-level acceleration structure groups together all instances of that particular model though, so if you have a model with instances scattered over a large area, you may consider subdividing the instances to mitigate the risk of your acceleration structures becoming useless. As for the top-level one, it's done at the scene level and created whenever the first thing that needs it is called. In my program, this was creating the program variables, but calling 'Render scene' will also create it if it hasn't already been created.


As for the reflection and lighting systems, they both work very similarly to the systems built for the CPU renderer, with the exception that unlike before, I can now specifically query the materials for information about color and roughness to give different surfaces different appearances. I used a slightly different strategy for reflections as well, employing Oren-Nayar to calculate how much of the reflected light from a surface would reach the camera given the roughness and normal of the surface, and the incident angles of the reflection and the view direction. After some iteration, I was able to start getting images like this.

The last thing I attempted to do this week was to use a different model than the arcade that's served me thus far. Here, I ran into a spot of trouble. It turns out, however, that because I was unable to use instancing, as discussed last week, I'm able to load in models .obj or .fbx files and construct a scene from them, which prevents me from building up scenes by building up model instances. A quick dive into Nvidia's forums lead me to believe there wasn't a converter between .obj and .fbx files, but that turned out to not quite be true.

Included as a utility with Falcor is something called the Scene Editor, which allows you to load in models, create instances of them, add lights, and save the whole thing off as a .fscene. After some screwing around, I was able to create a prove that I could put .objs into a format I could load into my ray tracer and render, like so.


 
 
 

Comments


© 2018 by Karinne Lorig

bottom of page