How can I modify a simple example?

I can run the OptiX samples, and I have read the quick start guide. But how to modify a simple or how to build a new OptiX project?
For example,I want to create a optixHello from scratch, then I copy the .cpp,.cu and .h files. It could be run but I found my .cu file in this project do not be used to produce a ptx file. Then I found my .cu file’s properties says “Non-participation in Generation”.
And I search your docs in Optix SDK, there is no help about build a new OptiX project,or modify a simple example.
So how can I modify a simple example?

1 Like

Please read through the OptiX 6.0.0 SDK\SDK\INSTALL-.txt files.
They describe how to build the OptiX SDK samples yourself.
The top-level CMakeList.txt files describe how to add new examples.

If you’re starting to learn OptiX, please watch the OptiX Introduction presentation and work through the initial examples.
Links here: [url][/url]

Check this thread for how to build them with MSVS 2017:

Those examples are written against OptiX 5.1.0, but work just fine with OptiX 6.0.0.

I made the OptiX Introduction examples self-contained. Each new example just adds or changes files. Means a simple source diff between two example folder shows exactly what changes were required for a feature addition or architecture change.

Adding a new example is very simple:

  • Copy one of the optixIntro_01 (this is effectively optixHello) to optixIntro_10 folders,
  • rename it,
  • rename the project name in its copied CMakeLists.txt,
  • add your new subdirectory in the CMakeLists.txt one folder above,
  • rebuild the solution with CMake GUI. Done.
    Your new project appears and would do the same thing as the example you copied it from.
    Now change it as you like.

This works similarly for the OptiX SDK examples and the other OptiX Advanced Samples.

1 Like