Changing Optix Basic Examples

Hello,

If I make a change to the code of optixTriangle.cpp and I wanted to test my new triangle code do I have to build the hole optix again? Can’t I just build the triangle example and make the binary?

Thank you,

Rafael Scatena
Doc. Student University of São Paulo

Hi @rafael.o.scatena,

You can just build the example. Is that not working? Would you like to describe what you tried and what unexpected result happened? On Linux you can “make <sample_name>”. On Windows with Visual Studio, you can set individual samples as your “startup project”.


David.

I don’t know If I am doing things correctly, but when I try to configure only one sample I get:

CMake Error at CMakeLists.txt:29 (OPTIX_add_sample_executable):
Unknown CMake command "OPTIX_add_sample_executable".
Configuring incomplete, errors occurred

Oh there’s no need to configure a single sample, you don’t need to change anything. Just configure everything normally, then instead of “make”, which will build everything, use “make optixTriangle”, or whatever sample you’d like to compile.

The CMake configure and generate steps always need to be done with the top-most CMakeLists.txt inside the OptiX SDK folder.
That defines the environment and macros used in the subdirectories’ CMakeLists.txt for the individual examples.
The individual CMakeLists.txt inside the OptiX SDK example folder won’t work standalone.
You’ll then configure and generate a solution which contains all OptiX SDK examples as individual projects and can then select which projects you want to build.