top of page
Search

Week 2: Working with Falcor

  • Writer: Karinne Lorig
    Karinne Lorig
  • Jun 2, 2019
  • 2 min read

With Falcor up and running, my next order of business was to be able to load and render models onto the screen. The first step of doing this was to comb through the provided sample code and begin to build up a working knowledge of Falcor’s rendering processes and pipeline. I compiled these into a document and, once I felt like I knew enough to render a simple model, I wrote the code to load in one of the models used in the sample code and a shader that returned a single color from the constant buffer, ran it and… immediately got a crash when it tried to run ModelRenderer::render(). The crash itself happened deep inside vkCreateGraphicsPipelines and claimed to be the result of a particular pointer called “pCreateInfos[0].renderPass” being null.


In the process of experimenting to find out what might be wrong, I switched the compilation mode from Vulkan to DirectX only to find that it actually ran in DirectX. However, it didn’t display the color passed into the shader anywhere. After fussing around some, I determined that although the comments I found stepping through Falcor’s shader program generation implied that Falcor generated a vertex shader for you automatically if you didn’t provide them, it required that the pixel shader have the line “__import DefaultVS” in order to actually load that properly. With that remedied, the model began to display properly and after setting the camera’s default position, I finally got an image like this:

The model itself is actually concave, but that doesn't come across because there's no shading.

Moving on from here, the real ray tracing begins: By this time next week, I should be able to create rays from the camera and render a similar image by tracing them to look for collisions.

 
 
 

Comentários


© 2018 by Karinne Lorig

bottom of page