OptiX是英伟达专为光线追踪打造的SDK,但是他的官方案例都比较复杂,包含了大量初始化相关的代码,初学容易一头雾水。
本人跟着Github上的optiX7course一步步学习才算入门。这个课程是Siggraph 2019/2020上的OptiX课程,有源码,有PDF讲义,通过12个案例逐步搭建起optiX的框架,非常适合初学者。
考虑到国内访问Github速度较慢,我已将课程相关全部资料移植到Gitee和百度云。
【国内版】课程讲义+测试数据,提取码:kadz
Examples Overview
Example 1: Hello World
This is simplest example, that only initializes the OptiX Library, prints "hello world", and exits. It's pretty much testing only whether your SDK, driver, and PATH/LD_LIBRARY_PATH are properly set up to build, link, and run this tutorial.
This is how this should look like in Linux:
And here, in Windows:
Note: if you do not see this output file, you may have a driver that does not work properly with OptiX 7 or some other cause. Normally the console window will disappear before you can see the error. To run and see the console window's messages, use the Visual Studio option "Start Without Debugging" (or hit Ctrl+F5), which will keep the console window visible after exit. The other option (or for Linux) is to run the program in a console window, e.g., run build\Debug\ex01_helloOptix.exe
Example 2: First Pipeline Setup and Raygen Program
This is the first "real" OptiX example, and maybe somewhat surprisingly, the biggest "step" in all the examples.
The actual raygen program