NVIDIA / VisRTX

NVIDIA OptiX based implementation of ANARI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Caustics?

opened this issue · comments

Great Project!

How many frames are required for clean (non-noisy) caustics?
I would think that the glass material should look like in the visRtxSampleVolume, why its different in visRtxSampleMDL ?

test1

I had some install problems (which are solved now):
CMAKE 3.14.4 GUI selecting VS2019 Community x64 gives:

[..]The CUDA compiler identification is unknown[..]
CMAKE_CUDA_COMPILER could be found.[..]

manually adding
set(CMAKE_CUDA_COMPILER "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/bin/nvcc.exe")
gives:
fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions between 2013 and 2017 (inclusive) are supported! [\VisRTX\build\CMakeFiles\CMakeTmp\cmTC_e93ed.vcxproj]

So I used VS2017 Community:
CMAKE 3.14.4 GUI selecting VS2017 x64 toolset v141 CUDA 10.0 gives:
OptiX library not found. Please set OptiX_INSTALL_DIR to locate it automatically.
(although I specified it in the json file)
same for the MDL; I had to specify both in CMAKE manually, but then it succeeded.

But I also had to copy some files manually to the "Debug" folder:

optix.6.0.0.dll
optix_denoiser.6.0.0.dll
cudnn64_7.dll
libmdl_sdk.dll
nv_freeimage.dll
dds.dll
cow.obj

Then I successfully could build and run the samples.

I use Win10PRO 64bit v1809 CUDA 10.0

Thanks a lot for your feedback!

Depending on your scene, it usually takes a few hundred samples for caustics to converge to an acceptable degree.

Note that in your screenshots you have always used a highly glossy material for the ground plane, which prevents you from actually seeing any caustics.

Please run your tests again with a diffuse ground material, e.g., using ./visRtxSampleMeshViewer.exe ::Glass cow.obj ::OBJMaterial --plane.

See the following screenshot which nicely shows the resulting caustics underneath the cow.

cow caustics

Also make sure that you actually have area lights in your scene that can produce caustics. You can't have caustics from non-area light sources such as point lights with zero radius or directional lights with zero angular diameter.

Regarding CMake, I'm not using VS Community Edition, but VisRTX works fine with both VS 2017 and VS 2019 Professional.
I do however use CUDA 10.1, that might be the culprit here.

Are you sure you have correctly specified OptiX_INSTALL_DIR to the root folder of the installed OptiX 6 SDK?

It definitely makes sense that you need to copy the runtime DLLs, if you haven't added the directory containing them to the PATH environment variable.

It's however unusual that you need to copy cow.obj. That one should be automatically copied to the build directory.

Thank you very much for your answer. Great! I got it work with the area light and the diffuse plane like you said.
Do you plan to support volume scattering / subsurface scattering in your renderer?

That’s definitely on the radar! Can’t promise on any timeline right now, however. Thanks!

Is it possible to upload the VS 2017 or VS 2019 solution file for this? I am having a heck of a time trying to get this to work!

Is it possible to upload the VS 2017 or VS 2019 solution file for this? I am having a heck of a time trying to get this to work!

@JonathanVQP Please try the following instructions, which I just verified to work correctly:

Install CUDA 10.1 (default: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1)

Download OptiX 6.5: https://developer.nvidia.com/designworks/optix/downloads/6.5.0/win64 (https://developer.nvidia.com/designworks/optix/download)

Install (default: C:\ProgramData\NVIDIA Corporation\OptiX SDK 6.5.0)

Download MDL SDK 2020.0.2: https://developer.nvidia.com/designworks/dl/mdl-sdk-2020.0.2 (https://developer.nvidia.com/nvidia-mdl-sdk-get-started)

Extract (C:\Development\Libraries\mdl-sdk-327300.6313)

Clone VisRTX master (C:\Development\VisRTX)

Create CMakeSettings.json in VisRTX directory with these contents:

    "configurations": [
      {
        "name": "x64-Release",
        "generator": "Ninja",
        "configurationType": "Release",
        "inheritEnvironments": [
          "msvc_x64_x64"
        ],
        "buildRoot": "C:\\Development\\VisRTX\\build\\${name}",
        "installRoot": "C:\\Development\\VisRTX\\install",
        "cmakeCommandArgs": "",
        "buildCommandArgs": "-v",
        "ctestCommandArgs": "",
        "variables": [
          { "name": "OptiX_INSTALL_DIR", "value": "C:\\ProgramData\\NVIDIA Corporation\\OptiX SDK 6.5.0" },
          { "name": "MDL_INSTALL_DIR", "value": "C:\\Development\\Libraries\\mdl-sdk-327300.6313" },
          { "name": "VISRTX_BUILD_SAMPLE", "value": "ON" },
          { "name": "VISRTX_SAMPLE_USE_DYNAMIC_LOADING", "value": "ON" },
          { "name": "VISRTX_USAGE_REPORT_VERBOSITY", "value": "0" },
          { "name": "VISRTX_USE_DEBUG_EXCEPTIONS", "value": "OFF" }
        ]
      }
    ]
  }

In VS 2019, open VisRTX\CMakeLists.txt via File -> Open -> CMake...

CMake generation is triggered automatically

Build -> Build all (F7)

Important: Make sure to have the OptiX and MDL shared libs in your PATH!

  • C:\ProgramData\NVIDIA Corporation\OptiX SDK 6.5.0\bin64
  • C:\Development\Libraries\mdl-sdk-327300.6313\nt-x86-64\lib

Launch VisRTX\build\x64-Release\visRtxSampleBasic.exe

Note that this does not generate VS solution files, but will make use of the Ninja build system shipped with VS 2019's built-in CMake support.

Thanks for your help! I was able to get it running!! I am very impressed by these examples!!!! I had to correct my path etc... Now, how do you create the VS solutions files? Do I have to configure CMAKE-GUI or can the solutions files be generated within VS 2019 after it successfully executes the cmake file? And another thing, how did you get all those Star Wars Tie fighters to show up in your demo (which demo is it?).

To generate VS 2019 solution files instead of Ninja build files, in CMakeSettings.json you need to set:

  • "generator": "Visual Studio 16 2019 Win64"
  • "buildCommandArgs": "" (-v in this form is only understood by Ninja, msbuild requires a different syntax to specify the verbosity level)

Note that when using this generator, the built binaries are in the build\x64-Release\Release subdirectory.

To reproduce the tie fighter scene, simply save this file as build\x64-Release\Release\cow.obj and start visRtxSampleMDL.exe. Then adjust material parameters on the left and remember to recompile them.

Enable the AI denoiser in the render settings to get rid of noise and fireflies quickly.

I can see why "Ninja" is the preferred choice in generating from the cmake file! When I switched over to the "Visual Studio 16 2019 Win64" generator and no verbosity level, I get a whole list of errors. It appears that it keeps wanting to target to CUDA 11.0.targets even though I switched all paths to CUDA 10.1. How do I switch target to CUDA 10.1 only? I don't get this issue using Ninja.

I'm afraid I don't have any experience with CMake in combination with the VS 16 generator and CUDA 11 on Windows.

I suggest you first try to reproduce the issue with a minimal CUDA hello world example.

If I may ask, why is the working Ninja path not acceptable? You only need this to compile VisRTX, which results in some shared libraries. For your own code you can still use Visual Studio, you don't even need CMake. In the project settings, just set the include and library search paths, and link the VisRTX libs.

Thanks Tim for your response. Working with Ninja is acceptable, I was just investigating other options to build the VS 2019 solutions files. You have been extremely helpful and I am looking forward to your future demos!