knightcrawler25 / Optix-PathTracer

Simple physically based path tracer based on Nvidia's Optix Ray Tracing Engine
317 stars 36 forks source link

How to load a scene #6

Closed straaljager closed 5 years ago

straaljager commented 5 years ago

Hi,

can you briefly explain how to load the scenes after extracting data.rar into src/data?

Thanks!

knightcrawler25 commented 5 years ago

Hey!

Once you've built the solution navigate to the bin/release folder then you can use:

optixPathTracer -scene ../../../src/data/coffee.scene or any of the other scene files available. Make sure the data.rar you extract isn't in another data/data subfolder.

Also, right now most of the folders etc are hard coded in the code so it should be simpler to modify the src/optixPathTracer.cpp file since you would need to build the code anyways to run it.

You can browse to line 651 in src/OptixPathTracer.cpp and change the scene file from there: scene_file = sutil::samplesDir() + std::string("/data/spaceship.scene");

straaljager commented 5 years ago

Thanks for your help. However, I'm having an issue compiling your code on Windows. Although the installation instructions for Windows (https://github.com/knightcrawler25/Optix-PathTracer/blob/master/INSTALL-WIN.txt) are very clear, I got stuck at this step: "Select the "src" directory from optix_advanced_samples as the source file location."

I have looked in my Optix install folder but cannot find the optix_advanced_samples directory. Can you let me know where to find this "src" directory?

Thanks in advance

knightcrawler25 commented 5 years ago

Oh the instructions were from here: https://github.com/nvpro-samples/optix_advanced_samples. As I mentioned in the readme, almost all of the base code is from the advanced samples (specifically the optixGlass sample) and I haven't modified the install instructions so it still says optix_advanced_samples there.

After you select the src and bin folders in cmake, you would have to manually set the OptiX_INCLUDE and OptiX_INSTALL_DIR like so:

image

Then click on configure again and generate. That should work.

straaljager commented 5 years ago

Thanks a lot for the quick reply. Generating the project works, but compilation with VS 2017 produced some new errors (Building NVCC ptx file lib/ptx/optixPathTracer_generated_path_trace_camera.cu.ptx nvcc fatal : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier)

I will give this another try tomorrow.

knightcrawler25 commented 5 years ago

What version of visual studio did you build it for? Also, what CUDA and Optix versions do you have installed?

straaljager commented 5 years ago

We were able to build and run it on Ubuntu after making some changes. It looks awesome, thanks for sharing this project.

knightcrawler25 commented 5 years ago

I only added small additions to the existing code so can't take much credit there. By the way, are you Sam Lapere from raytracey.blogspot.com?

straaljager commented 5 years ago

It's the first open sourced Optix project with an advanced material system that I could find.

I am indeed the author behind Ray Tracey blog :)

knightcrawler25 commented 5 years ago

Your blog is a gold mine! In fact another project of mine: https://github.com/knightcrawler25/GLSL-PathTracer has Nvidia's SBVH from your last tutorial (modified to work with GLSL). Learnt a lot from your blog posts over the years and in fact I got interested in graphics due to your earlier Brigade posts. Thanks a lot :D

straaljager commented 5 years ago

Glad my blog helped! I'm quite new to Optix, and I wasn't very convinced of its speed/quality until trying your modified Optix path tracer.

BTW, I tried you GLSL path tracer as well. The quality and speed is really nice, on par with the Optix version.

knightcrawler25 commented 5 years ago

Thanks :) Not sure if this info would help you since you are just investigating the framework, but there are a few other really nice Optix based projects on GitHub that might also interest you:

https://github.com/shocker-0x15/VLR (Full spectral) https://github.com/NVlabs/fermat (PT/BDPT/MLT/PSSMLT)

straaljager commented 5 years ago

Cool, I already discovered Fermat two weeks ago, but hadn't seen the Spectral path tracer before. That one could be quite useful actually. Cheers.