├── README.md
├── SDK
├── CMake
│ ├── CompilerInfo.cmake
│ ├── ConfigCompilerFlags.cmake
│ ├── CopyDLL.cmake
│ ├── FindCUDA.cmake
│ ├── FindCUDA
│ │ ├── make2cmake.cmake
│ │ ├── parse_cubin.cmake
│ │ ├── run_nvcc.cmake
│ │ └── select_compute_arch.cmake
│ ├── FindDX.cmake
│ ├── FindOpenEXR.cmake
│ ├── FindOptiX.cmake
│ ├── FindZlibStatic.cmake
│ ├── LinuxCPUInfo.cmake
│ ├── Macros.cmake
│ ├── ptx2cpp.cmake
│ ├── sse_support.h.in
│ └── testmain.c
├── CMakeLists.txt
├── INSTALL-LINUX.txt
├── INSTALL-WIN.txt
├── cuda
│ ├── BufferView.h
│ ├── GeometryData.h
│ ├── Light.h
│ ├── LocalGeometry.h
│ ├── MaterialData.h
│ ├── ao.cu
│ ├── ao.h
│ ├── ao_cuda.h
│ ├── curve.h
│ ├── direct.cu
│ ├── direct.h
│ ├── direct_cuda.h
│ ├── helpers.h
│ ├── path.cu
│ ├── path.h
│ ├── path_cuda.h
│ ├── random.h
│ ├── sampler.h
│ ├── sphere.cu
│ ├── sphere.h
│ ├── util.h
│ ├── whitted.cu
│ ├── whitted.h
│ └── whitted_cuda.h
├── data
│ ├── Scripts
│ │ ├── breakdown_table.py
│ │ ├── copy.sh
│ │ ├── parse_logs.py
│ │ ├── process_images.py
│ │ ├── run_tests.py
│ │ └── supplementary_images.py
│ ├── chess
│ │ ├── README
│ │ ├── bishop1.white.obj
│ │ ├── bishop2.white.obj
│ │ ├── black_pawn.bump0000.exr
│ │ ├── black_pawn.diffuse0000.exr
│ │ ├── black_pawn.glossiness0000.exr
│ │ ├── black_pawn.specularity0000.exr
│ │ ├── black_pawn3.obj
│ │ ├── black_queen.bump0000.exr
│ │ ├── black_queen.diffuse0000.exr
│ │ ├── black_queen.glossiness0000.exr
│ │ ├── black_queen.specularity0000.exr
│ │ ├── black_queen3.obj
│ │ ├── black_squares.diffuse0000.exr
│ │ ├── black_squares2.obj
│ │ ├── chess.env
│ │ ├── chess.gltf
│ │ ├── chessboard.sides.obj
│ │ ├── king.white.obj
│ │ ├── pawn1.white.obj
│ │ ├── pawn2.white.obj
│ │ ├── queen.white.obj
│ │ ├── white_squares.diffuse0000.exr
│ │ └── white_squares2.obj
│ ├── cornell-box
│ │ ├── CornellBox-Original.mtl
│ │ ├── CornellBox-Original.obj
│ │ ├── cornell-box.env
│ │ ├── cornell-box.gltf
│ │ ├── light.gltf
│ │ ├── light.mtl
│ │ └── light.obj
│ └── pool
│ │ ├── 1.exr
│ │ ├── 2.exr
│ │ ├── 5.exr
│ │ ├── 6.exr
│ │ ├── 8.exr
│ │ ├── README
│ │ ├── back.obj
│ │ ├── ball.obj
│ │ ├── ball1.gltf
│ │ ├── ball2.gltf
│ │ ├── ball5.gltf
│ │ ├── ball8.gltf
│ │ ├── balle.gltf
│ │ ├── ballw.gltf
│ │ ├── ballws.gltf
│ │ ├── hole.obj
│ │ ├── pool.env
│ │ ├── table.exr
│ │ ├── table.gltf
│ │ ├── table.obj
│ │ ├── table2.mtl
│ │ ├── table2.obj
│ │ └── wood.obj
├── lib
│ ├── DemandLoading
│ │ ├── CMakeLists.txt
│ │ ├── CheckerBoardImage.cpp
│ │ ├── CheckerBoardImage.h
│ │ ├── DemandTexture.h
│ │ ├── DemandTextureContext.h
│ │ ├── DemandTextureImpl.cpp
│ │ ├── DemandTextureImpl.h
│ │ ├── DemandTextureInfo.h
│ │ ├── DemandTextureManager.h
│ │ ├── DemandTextureManagerImpl.cpp
│ │ ├── DemandTextureManagerImpl.h
│ │ ├── EXRReader.cpp
│ │ ├── EXRReader.h
│ │ ├── Exception.h
│ │ ├── ExtensibleArray.h
│ │ ├── ImageReader.cpp
│ │ ├── ImageReader.h
│ │ ├── Math.h
│ │ ├── PageTableManager.h
│ │ ├── SparseTexture.cpp
│ │ ├── SparseTexture.h
│ │ ├── Tex2D.h
│ │ ├── TextureDescriptor.h
│ │ ├── TextureInfo.cpp
│ │ ├── TextureInfo.h
│ │ ├── TileIndexing.h
│ │ ├── TilePool.cpp
│ │ ├── TilePool.h
│ │ └── include
│ │ │ └── DemandLoading
│ │ │ ├── CheckerBoardImage.h
│ │ │ ├── DemandTexture.h
│ │ │ ├── DemandTextureContext.h
│ │ │ ├── DemandTextureInfo.h
│ │ │ ├── DemandTextureManager.h
│ │ │ ├── EXRReader.h
│ │ │ ├── ImageReader.h
│ │ │ ├── Tex2D.h
│ │ │ ├── TextureDescriptor.h
│ │ │ ├── TextureInfo.h
│ │ │ └── TileIndexing.h
│ ├── mdas
│ │ ├── CMakeLists.txt
│ │ ├── aabb.h
│ │ ├── buffer.h
│ │ ├── kdgrid.cu
│ │ ├── kdgrid.h
│ │ └── point.h
│ └── optixPaging
│ │ ├── CMakeLists.txt
│ │ ├── include
│ │ └── optixPaging
│ │ │ └── optixPaging.h
│ │ ├── optixPaging.cu
│ │ ├── optixPaging.h
│ │ └── optixPagingImpl.cpp
├── optixAmbientOcclusion
│ ├── CMakeLists.txt
│ └── optixAmbientOcclusion.cpp
├── optixBoundValues
│ ├── CMakeLists.txt
│ ├── optixBoundValues.cpp
│ ├── optixBoundValues.cu
│ ├── optixBoundValues.h
│ └── optixBoundValues_ch.cu
├── optixCallablePrograms
│ ├── CMakeLists.txt
│ ├── optixCallablePrograms.cpp
│ ├── optixCallablePrograms.cu
│ └── optixCallablePrograms.h
├── optixCurves
│ ├── CMakeLists.txt
│ ├── optixCurves.cpp
│ ├── optixCurves.cu
│ └── optixCurves.h
├── optixCutouts
│ ├── CMakeLists.txt
│ ├── optixCutouts.cpp
│ ├── optixCutouts.cu
│ └── optixCutouts.h
├── optixDemandPaging
│ ├── CMakeLists.txt
│ ├── CheckerBoardImage.cpp
│ ├── CheckerBoardImage.h
│ ├── DemandTexture.cpp
│ ├── DemandTexture.h
│ ├── DemandTextureManager.cpp
│ ├── DemandTextureManager.h
│ ├── ImageReader.h
│ ├── README.txt
│ ├── optixDemandPaging.cpp
│ ├── optixDemandPaging.cu
│ └── optixDemandPaging.h
├── optixDemandTexture
│ ├── CMakeLists.txt
│ ├── README.txt
│ ├── optixDemandTexture.cpp
│ ├── optixDemandTexture.cu
│ └── optixDemandTexture.h
├── optixDenoiser
│ ├── CMakeLists.txt
│ ├── OptiXDenoiser.h
│ └── optixDenoiser.cpp
├── optixDepthOfField
│ ├── CMakeLists.txt
│ └── optixDepthOfField.cpp
├── optixDirectLighting
│ ├── CMakeLists.txt
│ └── optixDirectLighting.cpp
├── optixDynamicGeometry
│ ├── CMakeLists.txt
│ ├── optixDynamicGeometry.cpp
│ ├── optixDynamicGeometry.cu
│ ├── optixDynamicGeometry.h
│ ├── vertices.cu
│ └── vertices.h
├── optixDynamicMaterials
│ ├── CMakeLists.txt
│ ├── optixDynamicMaterials.cpp
│ ├── optixDynamicMaterials.cu
│ └── optixDynamicMaterials.h
├── optixHair
│ ├── CMakeLists.txt
│ ├── Hair.cpp
│ ├── Hair.h
│ ├── Head.cpp
│ ├── Head.h
│ ├── ProgramGroups.cpp
│ ├── ProgramGroups.h
│ ├── README.TXT
│ ├── Renderers.cpp
│ ├── Renderers.h
│ ├── Util.h
│ ├── optixHair.cpp
│ ├── optixHair.cu
│ └── optixHair.h
├── optixHello
│ ├── CMakeLists.txt
│ ├── draw_solid_color.cu
│ ├── optixHello.cpp
│ └── optixHello.h
├── optixMeshViewer
│ ├── CMakeLists.txt
│ └── optixMeshViewer.cpp
├── optixMotionBlur
│ ├── CMakeLists.txt
│ └── optixMotionBlur.cpp
├── optixMultiGPU
│ ├── CMakeLists.txt
│ ├── optixMultiGPU.cpp
│ ├── optixMultiGPU.cu
│ ├── optixMultiGPU.h
│ └── optixMultiGPU_kernels.cu
├── optixNVLink
│ ├── CMakeLists.txt
│ ├── nvml_configure.h.in
│ ├── optixNVLink.cpp
│ ├── optixNVLink.cu
│ ├── optixNVLink.h
│ └── optixNVLink_kernels.cu
├── optixPathTracer
│ ├── CMakeLists.txt
│ └── optixPathTracer.cpp
├── optixRaycasting
│ ├── CMakeLists.txt
│ ├── optixRaycasting.cpp
│ ├── optixRaycasting.cu
│ ├── optixRaycasting.h
│ ├── optixRaycastingKernels.cu
│ └── optixRaycastingKernels.h
├── optixSimpleMotionBlur
│ ├── CMakeLists.txt
│ ├── optixSimpleMotionBlur.cpp
│ ├── optixSimpleMotionBlur.cu
│ └── optixSimpleMotionBlur.h
├── optixSimplePathTracer
│ ├── CMakeLists.txt
│ ├── optixSimplePathTracer.cpp
│ ├── optixSimplePathTracer.cu
│ └── optixSimplePathTracer.h
├── optixSphere
│ ├── CMakeLists.txt
│ ├── optixSphere.cpp
│ ├── optixSphere.cu
│ └── optixSphere.h
├── optixTriangle
│ ├── CMakeLists.txt
│ ├── optixTriangle.cpp
│ ├── optixTriangle.cu
│ └── optixTriangle.h
├── optixWhitted
│ ├── CMakeLists.txt
│ ├── camera.cu
│ ├── geometry.cu
│ ├── helpers.h
│ ├── optixWhitted.cpp
│ ├── optixWhitted.h
│ ├── random.h
│ └── shading.cu
├── sampleConfig.h.in
├── support
│ ├── CMakeLists.txt
│ ├── GLFW
│ │ ├── .appveyor.yml
│ │ ├── .travis.yml
│ │ ├── CMake
│ │ │ ├── MacOSXBundleInfo.plist.in
│ │ │ ├── amd64-mingw32msvc.cmake
│ │ │ ├── i586-mingw32msvc.cmake
│ │ │ ├── i686-pc-mingw32.cmake
│ │ │ ├── i686-w64-mingw32.cmake
│ │ │ ├── modules
│ │ │ │ ├── FindMir.cmake
│ │ │ │ ├── FindVulkan.cmake
│ │ │ │ ├── FindWaylandProtocols.cmake
│ │ │ │ └── FindXKBCommon.cmake
│ │ │ └── x86_64-w64-mingw32.cmake
│ │ ├── CMakeLists.txt
│ │ ├── COPYING.txt
│ │ ├── README.md
│ │ ├── cmake_uninstall.cmake.in
│ │ ├── deps
│ │ │ ├── KHR
│ │ │ │ └── khrplatform.h
│ │ │ ├── getopt.c
│ │ │ ├── getopt.h
│ │ │ ├── glad.c
│ │ │ ├── glad
│ │ │ │ └── glad.h
│ │ │ ├── linmath.h
│ │ │ ├── mingw
│ │ │ │ ├── _mingw_dxhelper.h
│ │ │ │ ├── dinput.h
│ │ │ │ └── xinput.h
│ │ │ ├── tinycthread.c
│ │ │ ├── tinycthread.h
│ │ │ └── vulkan
│ │ │ │ ├── vk_platform.h
│ │ │ │ └── vulkan.h
│ │ ├── include
│ │ │ └── GLFW
│ │ │ │ ├── glfw3.h
│ │ │ │ └── glfw3native.h
│ │ └── src
│ │ │ ├── CMakeLists.txt
│ │ │ ├── cocoa_init.m
│ │ │ ├── cocoa_joystick.h
│ │ │ ├── cocoa_joystick.m
│ │ │ ├── cocoa_monitor.m
│ │ │ ├── cocoa_platform.h
│ │ │ ├── cocoa_time.c
│ │ │ ├── cocoa_window.m
│ │ │ ├── context.c
│ │ │ ├── egl_context.c
│ │ │ ├── egl_context.h
│ │ │ ├── glfw3.pc.in
│ │ │ ├── glfw3Config.cmake.in
│ │ │ ├── glfw_config.h.in
│ │ │ ├── glx_context.c
│ │ │ ├── glx_context.h
│ │ │ ├── init.c
│ │ │ ├── input.c
│ │ │ ├── internal.h
│ │ │ ├── linux_joystick.c
│ │ │ ├── linux_joystick.h
│ │ │ ├── mir_init.c
│ │ │ ├── mir_monitor.c
│ │ │ ├── mir_platform.h
│ │ │ ├── mir_window.c
│ │ │ ├── monitor.c
│ │ │ ├── nsgl_context.h
│ │ │ ├── nsgl_context.m
│ │ │ ├── posix_time.c
│ │ │ ├── posix_time.h
│ │ │ ├── posix_tls.c
│ │ │ ├── posix_tls.h
│ │ │ ├── vulkan.c
│ │ │ ├── wgl_context.c
│ │ │ ├── wgl_context.h
│ │ │ ├── win32_init.c
│ │ │ ├── win32_joystick.c
│ │ │ ├── win32_joystick.h
│ │ │ ├── win32_monitor.c
│ │ │ ├── win32_platform.h
│ │ │ ├── win32_time.c
│ │ │ ├── win32_tls.c
│ │ │ ├── win32_window.c
│ │ │ ├── window.c
│ │ │ ├── wl_init.c
│ │ │ ├── wl_monitor.c
│ │ │ ├── wl_platform.h
│ │ │ ├── wl_window.c
│ │ │ ├── x11_init.c
│ │ │ ├── x11_monitor.c
│ │ │ ├── x11_platform.h
│ │ │ ├── x11_window.c
│ │ │ ├── xkb_unicode.c
│ │ │ └── xkb_unicode.h
│ ├── KHR
│ │ └── khrplatform.h
│ ├── glad
│ │ ├── glad.c
│ │ └── glad.h
│ ├── imgui
│ │ ├── CMakeLists.txt
│ │ ├── LICENSE.txt
│ │ ├── imconfig.h
│ │ ├── imgui.cpp
│ │ ├── imgui.h
│ │ ├── imgui_demo.cpp
│ │ ├── imgui_draw.cpp
│ │ ├── imgui_impl_glfw.cpp
│ │ ├── imgui_impl_glfw.h
│ │ ├── imgui_impl_opengl3.cpp
│ │ ├── imgui_impl_opengl3.h
│ │ ├── imgui_internal.h
│ │ ├── imgui_widgets.cpp
│ │ ├── imstb_rectpack.h
│ │ ├── imstb_textedit.h
│ │ └── imstb_truetype.h
│ ├── tinyexr
│ │ └── tinyexr.h
│ └── tinygltf
│ │ ├── LICENSE
│ │ ├── json.hpp
│ │ ├── stb_image.h
│ │ ├── stb_image_write.h
│ │ └── tiny_gltf.h
└── sutil
│ ├── Aabb.h
│ ├── CMakeLists.txt
│ ├── CUDAOutputBuffer.h
│ ├── Camera.cpp
│ ├── Camera.h
│ ├── Denoiser.h
│ ├── Environment.cpp
│ ├── Environment.h
│ ├── Exception.h
│ ├── Frame.h
│ ├── GLDisplay.cpp
│ ├── GLDisplay.h
│ ├── Matrix.h
│ ├── PPMLoader.cpp
│ ├── PPMLoader.h
│ ├── Parallelogram.h
│ ├── Preprocessor.h
│ ├── Quaternion.h
│ ├── Record.h
│ ├── Scene.cpp
│ ├── Scene.h
│ ├── Trackball.cpp
│ ├── Trackball.h
│ ├── WorkDistribution.h
│ ├── sutil.cpp
│ ├── sutil.h
│ ├── sutilapi.h
│ └── vec_math.h
├── doc
├── OptiX_API_Reference_7.2.0.pdf
├── OptiX_EndUserLicense.pdf
├── OptiX_Programming_Guide_7.2.0.pdf
└── OptiX_ThirdParty_Licenses.txt
└── include
├── internal
├── optix_7_device_impl.h
├── optix_7_device_impl_exception.h
└── optix_7_device_impl_transformations.h
├── optix.h
├── optix_7_device.h
├── optix_7_host.h
├── optix_7_types.h
├── optix_denoiser_tiling.h
├── optix_device.h
├── optix_function_table.h
├── optix_function_table_definition.h
├── optix_host.h
├── optix_stack_size.h
├── optix_stubs.h
└── optix_types.h
/README.md:
--------------------------------------------------------------------------------
1 | # Lightweight Multidimensional Adaptive Sampling for GPU Ray Tracing
2 | Sources codes of the Lightweight Multidimensional Adaptive Sampling for GPU Ray Tracing project.
3 | We extended Optix samples to support the proposed parallel multidimensional sampling and reconstruction. In particular, we added five new samples: optixMotionBlur, optixDepthOfField, optixAmbientOcclusion, optixPathTracer, and optixDirectLighting.
4 |
5 | ## Compilation
6 | We compiled the project with Visual Studio 2019 (x64), but it should work also with other compilers using CMake.
7 |
8 | ## Usage
9 | There are three sample scenes in SDK/data: pool, cornell-box, and chess. We use env file format for the configuration. Besides scene configuration, we can also configure sampling:
10 | ```
11 | Sampler {
12 | mdas true # use mdas or qmc
13 | samples 8 # number of saples
14 | }
15 |
16 | Mdas { # mdas parameters (see paper for details)
17 | scaleFactor 1
18 | alpha 0.25
19 | bitsPerDim 1
20 | extraImgBits 8
21 | }
22 | ```
23 |
24 | We simply use the env file as argument to run the sample:
25 | ```
26 | ./optixMotionBlur.exe ../../../data/pool/pool.env
27 | ./optixDepthOfField.exe ../../../data/chess/chess.env
28 | ./optixPathTracer.exe ../../../data/cornell-box/cornell-box.env
29 | ```
30 |
31 | There test scripts in SDK/data/Scripts that we used to generate the paper results.
32 |
33 | ## License
34 | The additional code is released into the public domain.
35 |
36 | ## Citation
37 | If you use this code, please cite the paper:
38 | ```
39 | @Article{Meister2022,
40 | author = {Daniel Meister and Toshiya Hachisuka},
41 | title = {{Lightweight Multidimensional Adaptive Sampling for GPU Ray Tracing}},
42 | journal = {Journal of Computer Graphics Techniques (JCGT)},
43 | volume = {11},
44 | number = {3},
45 | pages = {46--64},
46 | year = {2022},
47 | }
48 | ```
49 |
--------------------------------------------------------------------------------
/SDK/CMake/FindDX.cmake:
--------------------------------------------------------------------------------
1 | IF (WIN32 AND MSVC_VERSION LESS 1700)
2 | # Starting with Windows 8, the DirectX SDK is included as part of the Windows SDK
3 | # (http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx)
4 | # and, in turn, Visual Studio 2012 (even Express) includes the appropriate components of the Windows SDK
5 | # (http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx)
6 | # so we don't need a DX include path if we're targeting VS2012+
7 |
8 | FIND_PATH(DX9_INCLUDE_PATH d3d9.h
9 | HINTS
10 | "$ENV{DXSDK_DIR}/Include"
11 | "$ENV{PROGRAMFILES}/Microsoft DirectX SDK/Include"
12 | DOC "The directory where d3d9.h resides")
13 | FIND_PATH(DX10_INCLUDE_PATH D3D10.h
14 | HINTS
15 | "$ENV{DXSDK_DIR}/Include"
16 | "$ENV{PROGRAMFILES}/Microsoft DirectX SDK/Include"
17 | DOC "The directory where D3D10.h resides")
18 | FIND_PATH(DX11_INCLUDE_PATH D3D11.h
19 | HINTS
20 | "$ENV{DXSDK_DIR}/Include"
21 | "$ENV{PROGRAMFILES}/Microsoft DirectX SDK/Include"
22 | DOC "The directory where D3D11.h resides")
23 |
24 | IF (DX9_INCLUDE_PATH)
25 | SET( DX9_FOUND 1 )
26 | ELSE (DX9_INCLUDE_PATH)
27 | SET( DX9_FOUND 0 )
28 | ENDIF (DX9_INCLUDE_PATH)
29 |
30 | IF (DX10_INCLUDE_PATH)
31 | SET( DX10_FOUND 1 )
32 | ELSE (DX10_INCLUDE_PATH)
33 | SET( DX10_FOUND 0 )
34 | ENDIF (DX10_INCLUDE_PATH)
35 |
36 | IF (DX11_INCLUDE_PATH)
37 | SET( DX11_FOUND 1 )
38 | ELSE (DX11_INCLUDE_PATH)
39 | SET( DX11_FOUND 0 )
40 | ENDIF (DX11_INCLUDE_PATH)
41 | ENDIF (WIN32 AND MSVC_VERSION LESS 1700)
42 |
43 |
--------------------------------------------------------------------------------
/SDK/CMake/LinuxCPUInfo.cmake:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
4 | #
5 | # NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6 | # rights in and to this software, related documentation and any modifications thereto.
7 | # Any use, reproduction, disclosure or distribution of this software and related
8 | # documentation without an express license agreement from NVIDIA Corporation is strictly
9 | # prohibited.
10 | #
11 | # TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12 | # AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13 | # INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14 | # PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15 | # SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16 | # LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17 | # BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 | # INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19 | # SUCH DAMAGES
20 | #
21 |
22 | IF(EXISTS "/proc/cpuinfo")
23 |
24 | FILE(READ /proc/cpuinfo PROC_CPUINFO)
25 |
26 | SET(VENDOR_ID_RX "vendor_id[ \t]*:[ \t]*([a-zA-Z]+)\n")
27 | STRING(REGEX MATCH "${VENDOR_ID_RX}" VENDOR_ID "${PROC_CPUINFO}")
28 | STRING(REGEX REPLACE "${VENDOR_ID_RX}" "\\1" VENDOR_ID "${VENDOR_ID}")
29 |
30 | SET(CPU_FAMILY_RX "cpu family[ \t]*:[ \t]*([0-9]+)")
31 | STRING(REGEX MATCH "${CPU_FAMILY_RX}" CPU_FAMILY "${PROC_CPUINFO}")
32 | STRING(REGEX REPLACE "${CPU_FAMILY_RX}" "\\1" CPU_FAMILY "${CPU_FAMILY}")
33 |
34 | SET(MODEL_RX "model[ \t]*:[ \t]*([0-9]+)")
35 | STRING(REGEX MATCH "${MODEL_RX}" MODEL "${PROC_CPUINFO}")
36 | STRING(REGEX REPLACE "${MODEL_RX}" "\\1" MODEL "${MODEL}")
37 |
38 | SET(FLAGS_RX "flags[ \t]*:[ \t]*([a-zA-Z0-9 _]+)\n")
39 | STRING(REGEX MATCH "${FLAGS_RX}" FLAGS "${PROC_CPUINFO}")
40 | STRING(REGEX REPLACE "${FLAGS_RX}" "\\1" FLAGS "${FLAGS}")
41 |
42 | # Debug output.
43 | IF(LINUX_CPUINFO)
44 | MESSAGE(STATUS "LinuxCPUInfo.cmake:")
45 | MESSAGE(STATUS "VENDOR_ID : ${VENDOR_ID}")
46 | MESSAGE(STATUS "CPU_FAMILY : ${CPU_FAMILY}")
47 | MESSAGE(STATUS "MODEL : ${MODEL}")
48 | MESSAGE(STATUS "FLAGS : ${FLAGS}")
49 | ENDIF(LINUX_CPUINFO)
50 |
51 | ENDIF(EXISTS "/proc/cpuinfo")
52 |
--------------------------------------------------------------------------------
/SDK/CMake/ptx2cpp.cmake:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
4 | #
5 | # NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6 | # rights in and to this software, related documentation and any modifications thereto.
7 | # Any use, reproduction, disclosure or distribution of this software and related
8 | # documentation without an express license agreement from NVIDIA Corporation is strictly
9 | # prohibited.
10 | #
11 | # TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12 | # AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13 | # INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14 | # PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15 | # SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16 | # LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17 | # BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 | # INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19 | # SUCH DAMAGES
20 | #
21 |
22 | # This script produces a string variable from the contents of a ptx
23 | # script. The variable is defined in the .cc file and the .h file.
24 |
25 | # This script excepts the following variable to be passed in like
26 | # -DVAR:TYPE=VALUE
27 | #
28 | # CPP_FILE
29 | # PTX_FILE
30 | # VARIABLE_NAME
31 | # NAMESPACE
32 | # CUDA_BIN2C_EXECUTABLE
33 |
34 | # message("PTX_FILE = ${PTX_FILE}")
35 | # message("CPP_FILE = ${C_FILE}")
36 | # message("VARIABLE_NAME = ${VARIABLE_NAME}")
37 | # message("NAMESPACE = ${NAMESPACE}")
38 |
39 | execute_process( COMMAND ${CUDA_BIN2C_EXECUTABLE} -p 0 -st -c -n ${VARIABLE_NAME}_static "${PTX_FILE}"
40 | OUTPUT_VARIABLE bindata
41 | RESULT_VARIABLE result
42 | ERROR_VARIABLE error
43 | )
44 | if(result)
45 | message(FATAL_ERROR "bin2c error:\n" ${error})
46 | endif()
47 |
48 | set(BODY
49 | "${bindata}\n"
50 | "namespace ${NAMESPACE} {\n\nstatic const char* const ${VARIABLE_NAME} = reinterpret_cast(&${VARIABLE_NAME}_static[0]);\n} // end namespace ${NAMESPACE}\n")
51 | file(WRITE ${CPP_FILE} "${BODY}")
52 |
--------------------------------------------------------------------------------
/SDK/CMake/sse_support.h.in:
--------------------------------------------------------------------------------
1 | #cmakedefine SSE_41_AVAILABLE
2 |
--------------------------------------------------------------------------------
/SDK/CMake/testmain.c:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved.
4 | *
5 | * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6 | * rights in and to this software, related documentation and any modifications thereto.
7 | * Any use, reproduction, disclosure or distribution of this software and related
8 | * documentation without an express license agreement from NVIDIA Corporation is strictly
9 | * prohibited.
10 | *
11 | * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12 | * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13 | * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14 | * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15 | * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16 | * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17 | * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 | * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19 | * SUCH DAMAGES
20 | */
21 |
22 | int main()
23 | {
24 | return 0;
25 | }
26 |
--------------------------------------------------------------------------------
/SDK/INSTALL-LINUX.txt:
--------------------------------------------------------------------------------
1 | In order to compile the samples in the SDK you need the following:
2 |
3 | 1. CUDA Toolkit. Supported versions are listed in the release notes.
4 |
5 | 2. CMake 3.0 minimum (http://www.cmake.org/cmake/resources/software.html).
6 |
7 | 3. C++ compiler (gcc 4.4 and 4.8 been tested)
8 |
9 | To compile:
10 |
11 | Instructions for building.
12 | 1. Create a build directory other than the SDK/ directory. Using a separate
13 | build directory allows multiple builds, differing in flavor, platform, etc.
14 | 2. cd to new directory.
15 | 3. Run
16 | $ ccmake
17 | where path is the path to the SDK/ directory. This will bring up
18 | the cmake interface.
19 | 4. Press 'c' within ccmake to begin configure process.
20 | 5. Adjust any options, such as build flavor, by moving cursor to field and
21 | hitting , changing value, and hitting again. One field you
22 | may want to change is CMAKE_BUILD_TYPE to select a Debug build (it defaults
23 | to Release which is an optimized build).
24 | 6. Press 'c' again to finish configure.
25 | 7. Press 'g' to generate Makefiles and exit.
26 | 8. Run
27 | $ make
28 | to build.
29 | 9. Executables should be found in the bin directory.
30 |
--------------------------------------------------------------------------------
/SDK/INSTALL-WIN.txt:
--------------------------------------------------------------------------------
1 | In order to compile the samples in the SDK you need the following.
2 |
3 | 1. Visual Studio. Supported versions are listed in the release notes.
4 |
5 | 2. CUDA Toolkit. Supported versions are listed in the release notes.
6 |
7 | 3. CMake 3.0 minimum (http://www.cmake.org/cmake/resources/software.html).
8 | I suggest the executable installer.
9 |
10 |
11 | Instructions for building.
12 |
13 | 1. Start up cmake-gui from the Start Menu.
14 |
15 | 2. Select the C:\ProgramData\NVIDIA Corporation\OptiX SDK \SDK directory
16 | from the installation for the source file location.
17 |
18 | 3. Create a build directory that isn't the same as the source directory. For
19 | example, C:\ProgramData\NVIDIA Corporation\OptiX SDK \SDK\build.
20 | If you don't have permissions to write into the this directory (writing into
21 | the "C:/Program Files" directory can be restricted in some cases), pick a different
22 | directory where you do have write permissions. If you type in the directory
23 | (instead of using the "Browse Build..." button), CMake will ask you at the
24 | next step to create the directory for you if it doesn't already exist.
25 |
26 | 4. Press "Configure" button and select the version of Visual Studio you wish to
27 | use. Note that the 64-bit compiles are separate from the 32-bit compiles.
28 | The difference between the bitnesses of the build will be marked with "Win64"
29 | for 64 bit builds (e.g. "Visual Studio 14 2015 Win64" for 64 bit builds and
30 | "Visual Studio 14 2013" for 32 bit builds). Also note that OptiX only
31 | supports 64 bit builds, and CMake defaults to 32 bit configures, so you must
32 | change it. Leave all other options on their default. Press "OK". This can
33 | take awhile while source level dependencies for CUDA files are computed.
34 |
35 | 5. Press "Configure" again. Followed by "Generate".
36 |
37 | 6. Open the OptiX-Samples.sln solution file in the build directory you created.
38 |
39 | 7. Select "Build Solution" from the IDE.
40 |
41 | 8. Right click on one of the sample program targets in the solution explorer and
42 | select "Set as start up project".
43 |
44 | 9. Run the sample. "q" or "Esc" will close the window.
45 |
46 | Note that due to the way dependencies are automatically handled for CUDA
47 | compilation in Visual Studio, if you build again Visual Studio will likely ask
48 | you to reload your projects. Please do so. Subsequent compiles should not
49 | result in reloading unless you change the files that are included by a CUDA
50 | file.
51 |
52 | Further instructions regarding the build system can be found in comments in the
53 | SDK's CMakeLists.txt file.
54 |
--------------------------------------------------------------------------------
/SDK/cuda/BufferView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #include
32 |
33 | struct BufferView
34 | {
35 | CUdeviceptr data CONST_STATIC_INIT( 0 );
36 | unsigned int count CONST_STATIC_INIT( 0 );
37 | unsigned short byte_stride CONST_STATIC_INIT( 0 );
38 | unsigned short elmt_byte_size CONST_STATIC_INIT( 0 );
39 |
40 | SUTIL_HOSTDEVICE bool isValid() const
41 | { return static_cast( data ); }
42 |
43 | SUTIL_HOSTDEVICE operator bool() const
44 | { return isValid(); }
45 |
46 | template
47 | SUTIL_HOSTDEVICE const T& at( unsigned int idx ) const
48 | { return *reinterpret_cast( data + idx*(byte_stride ? byte_stride : sizeof( T ) ) ); }
49 |
50 | //SUTIL_HOSTDEVICE const T& operator[]( unsigned int idx ) const
51 | //{ return *reinterpret_cast( data + idx*(byte_stride ? byte_stride : sizeof( T ) ) ); }
52 | };
53 |
--------------------------------------------------------------------------------
/SDK/cuda/MaterialData.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #include
32 |
33 |
34 | struct MaterialData
35 | {
36 | enum Type
37 | {
38 | PBR = 0
39 | };
40 |
41 |
42 | struct Pbr
43 | {
44 | float4 base_color = { 1.0f, 1.0f, 1.0f, 1.0f };
45 | float metallic = 1.0f;
46 | float roughness = 1.0f;
47 |
48 | cudaTextureObject_t base_color_tex = 0;
49 | cudaTextureObject_t metallic_roughness_tex = 0;
50 | cudaTextureObject_t normal_tex = 0;
51 | };
52 |
53 | Type type;
54 |
55 | union
56 | {
57 | Pbr pbr;
58 | };
59 | };
60 |
--------------------------------------------------------------------------------
/SDK/cuda/sampler.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "random.h"
3 |
4 | class Sampler {
5 | public:
6 |
7 | __host__ __device__ Sampler(unsigned int seed) : cur_dim(0), cur_index(0) {
8 | for (int i = 0; i < 6; ++i)
9 | offsets[i] = rnd(seed);
10 | }
11 |
12 | __host__ __device__ __inline__ float get() {
13 | float sample = halton(cur_dim, cur_index) + offsets[cur_dim];
14 | if (sample > 1.0f) sample -= 1.0f;
15 | ++cur_dim;
16 | return sample;
17 | }
18 |
19 | __host__ __device__ __inline__ void next_sample() {
20 | cur_dim = 0;
21 | cur_index++;
22 | }
23 |
24 | private:
25 | float offsets[6];
26 | int cur_index;
27 | int cur_dim;
28 | };
29 |
--------------------------------------------------------------------------------
/SDK/cuda/sphere.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #include "GeometryData.h"
32 |
33 | namespace sphere {
34 |
35 | const unsigned int NUM_ATTRIBUTE_VALUES = 4u;
36 |
37 | struct SphereHitGroupData
38 | {
39 | GeometryData::Sphere sphere;
40 | };
41 |
42 | } // namespace sphere
43 |
--------------------------------------------------------------------------------
/SDK/cuda/util.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | #pragma once
29 |
30 | #ifndef __CUDACC_RTC__
31 | #include
32 | #endif
33 |
34 | #define if_pixel( x_, y_ ) \
35 | const uint3 launch_idx__ = optixGetLaunchIndex(); \
36 | if( launch_idx__.x == (x_) && launch_idx__.y == (y_) ) \
37 |
38 | #define print_pixel( x_, y_, str, ... ) \
39 | do \
40 | { \
41 | const uint3 launch_idx = optixGetLaunchIndex(); \
42 | if( launch_idx.x == (x_) && launch_idx.y == (y_) ) \
43 | { \
44 | printf( str, __VA_ARGS__ ); \
45 | } \
46 | } while(0);
47 |
48 |
49 |
--------------------------------------------------------------------------------
/SDK/data/chess/README:
--------------------------------------------------------------------------------
1 | This scene is the chess scene used for Figure 8 in "Multidimensional Adaptive Sampling and Reconstruction for Ray Tracing" by Hachisuka et al. SIGGRAPH 2008, and was modeled by Wojciech Jarosz.
2 |
3 | Permission to use the model/scene for non-commercial purposes is granted as long as proper credit is given. For example, put "The chess scene in Figure X is from Hackisuka et al. [2008] and was modeled by Wojciech Jarosz."
4 | in the acknowledgement section of your paper.
--------------------------------------------------------------------------------
/SDK/data/chess/black_pawn.bump0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_pawn.bump0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_pawn.diffuse0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_pawn.diffuse0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_pawn.glossiness0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_pawn.glossiness0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_pawn.specularity0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_pawn.specularity0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_queen.bump0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_queen.bump0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_queen.diffuse0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_queen.diffuse0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_queen.glossiness0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_queen.glossiness0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_queen.specularity0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_queen.specularity0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/black_squares.diffuse0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/black_squares.diffuse0000.exr
--------------------------------------------------------------------------------
/SDK/data/chess/chess.env:
--------------------------------------------------------------------------------
1 | Sampler {
2 | mdas true
3 | samples 8
4 | }
5 |
6 | Mdas {
7 | scaleFactor 1
8 | alpha 0.25
9 | bitsPerDim 1
10 | extraImgBits 8
11 | }
12 |
13 | Film {
14 | width 768
15 | height 1024
16 | }
17 |
18 | Camera {
19 | position 0.208107 0.501896 -0.099502
20 | direction -0.121100744 -0.25794649 0.035749208
21 | upVector 0 0 -1
22 | fovy 17.0
23 | focalDistance 0.42
24 | lensRadius 0.005
25 | }
26 |
27 | Light {
28 | color 0.15 0.15 0.15
29 | point 0.33452 0.25841 -0.2950
30 | color 0.04 0.04 0.04
31 | point -0.428147 0.123599 -0.422
32 | color 0.03 0.03 0.03
33 | point 0.274927 -0.368014 -0.32900
34 | color 0.10 0.10 0.10
35 | point -0.158656 0.336004 -0.385
36 | }
37 |
38 | Model {
39 | filename ../../../data/chess/chess.gltf
40 | }
41 |
--------------------------------------------------------------------------------
/SDK/data/chess/white_squares.diffuse0000.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/chess/white_squares.diffuse0000.exr
--------------------------------------------------------------------------------
/SDK/data/cornell-box/CornellBox-Original.mtl:
--------------------------------------------------------------------------------
1 | # The original Cornell Box in OBJ format.
2 | # Note that the real box is not a perfect cube, so
3 | # the faces are imperfect in this data set.
4 | #
5 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011
6 | # Released into the Public Domain.
7 | #
8 | # http://graphics.cs.williams.edu/data
9 | # http://www.graphics.cornell.edu/online/box/data.html
10 | #
11 |
12 | newmtl leftWall
13 | Ns 10.0000
14 | Ni 1.0000
15 | illum 2
16 | Ka 0.63 0.065 0.05 # Red
17 | Kd 0.63 0.065 0.05
18 | Ks 0 0 0
19 | Ke 0 0 0
20 |
21 |
22 | newmtl rightWall
23 | Ns 10.0000
24 | Ni 1.0000
25 | illum 2
26 | Ka 0.14 0.45 0.091 # Green
27 | Kd 0.14 0.45 0.091
28 | Ks 0 0 0
29 | Ke 0 0 0
30 |
31 |
32 | newmtl floor
33 | Ns 10.0000
34 | Ni 1.0000
35 | illum 2
36 | Ka 0.725 0.71 0.68 # White
37 | Kd 0.725 0.71 0.68
38 | Ks 0 0 0
39 | Ke 0 0 0
40 |
41 |
42 | newmtl ceiling
43 | Ns 10.0000
44 | Ni 1.0000
45 | illum 2
46 | Ka 0.725 0.71 0.68 # White
47 | Kd 0.725 0.71 0.68
48 | Ks 0 0 0
49 | Ke 0 0 0
50 |
51 |
52 | newmtl backWall
53 | Ns 10.0000
54 | Ni 1.0000
55 | illum 2
56 | Ka 0.725 0.71 0.68 # White
57 | Kd 0.725 0.71 0.68
58 | Ks 0 0 0
59 | Ke 0 0 0
60 |
61 |
62 | newmtl shortBox
63 | Ns 10.0000
64 | Ni 1.0000
65 | illum 2
66 | Ka 0.725 0.71 0.68 # White
67 | Kd 0.725 0.71 0.68
68 | Ks 0 0 0
69 | Ke 0 0 0
70 |
71 |
72 | newmtl tallBox
73 | Ns 10.0000
74 | Ni 1.0000
75 | illum 2
76 | Ka 0.725 0.71 0.68 # White
77 | Kd 0.725 0.71 0.68
78 | Ks 0 0 0
79 | Ke 0 0 0
80 |
81 | newmtl light
82 | Ns 10.0000
83 | Ni 1.0000
84 | illum 2
85 | Ka 0.78 0.78 0.78 # White
86 | Kd 0.78 0.78 0.78
87 | Ks 0 0 0
88 | Ke 17 12 4
89 |
--------------------------------------------------------------------------------
/SDK/data/cornell-box/cornell-box.env:
--------------------------------------------------------------------------------
1 | Sampler {
2 | mdas true
3 | samples 8
4 | }
5 |
6 | Mdas {
7 | scaleFactor 1
8 | alpha 0.0625
9 | bitsPerDim 1
10 | extraImgBits 7
11 | }
12 |
13 | Film {
14 | width 1024
15 | height 1024
16 | }
17 |
18 | Camera {
19 | position 0 1 4.2
20 | direction 0 0 -1
21 | fovy 34.4
22 | }
23 |
24 | Light {
25 | point 0.0 1.98 0.0
26 | background 0.0 0.0 0.0
27 | }
28 |
29 | Model {
30 | filename ../../../data/cornell-box/cornell-box.gltf
31 | }
32 |
--------------------------------------------------------------------------------
/SDK/data/cornell-box/light.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'None'
2 | # Material Count: 1
3 |
4 | newmtl light.003
5 | Ns 10.000002
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.725000 0.710000 0.680000
8 | Ks 0.500000 0.500000 0.500000
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.450000
11 | d 1.000000
12 | illum 2
13 |
--------------------------------------------------------------------------------
/SDK/data/cornell-box/light.obj:
--------------------------------------------------------------------------------
1 | # Blender v2.90.1 OBJ File: ''
2 | # www.blender.org
3 | mtllib light.mtl
4 | o light.001
5 | v -0.200000 1.985000 0.200000
6 | v 0.200000 1.985000 0.200000
7 | v 0.200000 1.985000 -0.200000
8 | v -0.200000 1.985000 -0.200000
9 | vn 0.0000 1.0000 0.0000
10 | usemtl light.003
11 | s off
12 | f 1//1 2//1 3//1
13 | f 1//1 3//1 4//1
14 |
--------------------------------------------------------------------------------
/SDK/data/pool/1.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/pool/1.exr
--------------------------------------------------------------------------------
/SDK/data/pool/2.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/pool/2.exr
--------------------------------------------------------------------------------
/SDK/data/pool/5.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/pool/5.exr
--------------------------------------------------------------------------------
/SDK/data/pool/6.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/pool/6.exr
--------------------------------------------------------------------------------
/SDK/data/pool/8.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/pool/8.exr
--------------------------------------------------------------------------------
/SDK/data/pool/README:
--------------------------------------------------------------------------------
1 | This scene is the pool scene used for Figure 7 in "Multidimensional Adaptive Sampling and Reconstruction for Ray Tracing" by Hachisuka et al. SIGGRAPH 2008.
2 |
3 | Permission to use the model/scene for non-commercial purposes is granted as long as proper credit is given. For example, put "The pool scene in Figure X is from Hackisuka et al. [2008]" in the acknowledgement section of your paper.
--------------------------------------------------------------------------------
/SDK/data/pool/back.obj:
--------------------------------------------------------------------------------
1 | # Created by Metasequoia
2 |
3 | v 1822.198608 -1254.318726 -509.786499
4 | v -1822.198608 -1254.318726 -509.786499
5 | v 1822.198608 1254.318481 -3153.340332
6 | v -1822.198608 1254.318481 -3153.340332
7 | # 4 vertices
8 |
9 | vt 0.00000 1.00000
10 | vt 1.00000 1.00000
11 | vt 1.00000 0.00000
12 | vt 0.00000 0.00000
13 | # 4 texture vertices
14 |
15 | vn 0.00000 0.72537 0.68835
16 | # 1 normal vertices
17 |
18 | f 3/1/1 4/2/1 2/3/1
19 | f 3/1/1 2/3/1 1/4/1
20 | # 2 elements
21 |
22 |
--------------------------------------------------------------------------------
/SDK/data/pool/pool.env:
--------------------------------------------------------------------------------
1 | Sampler {
2 | mdas true
3 | samples 4
4 | }
5 |
6 | Mdas {
7 | scaleFactor 0.0625
8 | alpha 0.25
9 | bitsPerDim 1
10 | extraImgBits 8
11 | }
12 |
13 | Film {
14 | width 1024
15 | height 1024
16 | }
17 |
18 | Camera {
19 | position -50 -50 -3750
20 | direction 0 0 1
21 | upVector 0 1 0
22 | fovy 14.0
23 | }
24 |
25 | Light {
26 | color 1 1 1|
27 | distant -0.1 0.1 0.2
28 | color 0.3210 0.2306 0.2919
29 | distant 0.186190 0.514521 -0.450556
30 | color 0.3826 0.3689 0.3754
31 | distant 0.371649 0.768631 -0.772347
32 | color 0.18881 0.26806 0.32420
33 | distant 0.470249 0.882291 -0.679304
34 | color 0.23466 0.19180 0.21958
35 | distant -0.442861 0.968631 -0.777845
36 | color 0.35678 0.24086 0.23976
37 | distant 0.412283 0.800362 -0.794489
38 | color 0.53103 0.46485 0.56109
39 | distant 0.550536 0.971044 -0.652179
40 | color 0.71312 0.884649 0.80156
41 | distant -0.151671 0.911743 -0.886968
42 | color 0.36443 0.32189 0.33331
43 | distant -0.269034 0.868833 -0.751783
44 | }
45 |
46 | Model {
47 | filename ../../../data/pool/table.gltf
48 | }
49 |
50 | Model {
51 | frame 0 1 1 1 110 -300 0 0 0 1 0
52 | frame 0.1 1 1 1 100 -230 0 0 0 1 0
53 | frame 1 1 1 1 100 -230 0 0 0 1 0
54 | filename ../../../data/pool/ballw.gltf
55 | }
56 |
57 | Model {
58 | frame 0 1 1 1 250 150 0 102 1.8 -0.37 0.62
59 | frame 1 1 1 1 250 150 0 102 1.8 -0.37 0.62
60 | filename ../../../data/pool/ball2.gltf
61 | }
62 |
63 | Model {
64 | frame 0 1 1 1 20 -50 0 82 1.97 -0.1 -0.1
65 | frame 0.1 1 1 1 20 -50 0 82 1.97 -0.1 -0.1
66 | frame 0.5 1 1 1 -20 0 0 98 1.97 0.093 0.093
67 | frame 0.51 1 1 1 -20 0 0 82 1.97 -0.1 -0.1
68 | frame 1 1 1 1 50 50 0 90 1.97 -0.18 -0.21
69 | filename ../../../data/pool/ball5.gltf
70 | }
71 |
72 | Model {
73 | frame 0 1 1 1 -150 100 0 90 1.97 -0.093 -0.28
74 | frame 0.5 1 1 1 -150 100 0 90 1.97 -0.093 -0.28
75 | frame 0.6 1 1 1 -180 120 0 83 1.96 0.2 -0.2
76 | frame 1 1 1 1 -180 120 0 83 1.96 0.2 -0.2
77 | filename ../../../data/pool/ball8.gltf
78 | }
79 |
80 | Model {
81 | frame 0 1 1 1 -350 200 0 105 1.8 -0.35 0.53
82 | frame 0.6 1 1 1 -350 200 0 107 1.8 -0.35 0.51
83 | frame 1 1 1 1 -370 200 0 107 1.8 -0.35 0.51
84 | filename ../../../data/pool/ball1.gltf
85 | }
86 |
--------------------------------------------------------------------------------
/SDK/data/pool/table.exr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/SDK/data/pool/table.exr
--------------------------------------------------------------------------------
/SDK/data/pool/table2.mtl:
--------------------------------------------------------------------------------
1 | # Blender MTL File: 'table.blend'
2 | # Material Count: 3
3 |
4 | newmtl Default_OBJ
5 | Ns 225.000000
6 | Ka 1.000000 1.000000 1.000000
7 | Kd 0.800000 0.800000 0.800000
8 | Ks 0.500000 0.500000 0.500000
9 | Ke 0.000000 0.000000 0.000000
10 | Ni 1.450000
11 | d 1.000000
12 | illum 2
13 | map_Kd table.exr
14 |
15 | newmtl Default_OBJ.001
16 | Ns 812.249999
17 | Ka 1.000000 1.000000 1.000000
18 | Kd 0.179569 0.130000 0.050000
19 | Ks 1.000000 1.000000 1.000000
20 | Ke 0.000000 0.000000 0.000000
21 | Ni 1.450000
22 | d 1.000000
23 | illum 2
24 |
25 | newmtl Default_OBJ.003
26 | Ns 225.000000
27 | Ka 1.000000 1.000000 1.000000
28 | Kd 0.010000 0.010000 0.010000
29 | Ks 0.500000 0.500000 0.500000
30 | Ke 0.000000 0.000000 0.000000
31 | Ni 1.450000
32 | d 1.000000
33 | illum 2
34 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/DemandTextureContext.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #include
32 |
33 | #include
34 |
35 | namespace demandLoading {
36 |
37 | struct DemandTextureInfo;
38 |
39 | /// Device-side demand texture context.
40 | struct DemandTextureContext
41 | {
42 | OptixPagingContext m_pagingContext;
43 | DemandTextureInfo* m_textureInfos;
44 | CUtexObject* m_textures;
45 | };
46 |
47 | } // namespace demandLoading
48 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/ImageReader.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #include
30 |
31 | #include // for size_t
32 |
33 | namespace demandLoading {
34 |
35 | bool ImageReader::readMipTail( char* dest, unsigned int mipTailFirstLevel, unsigned int numMipLevels, const uint2* mipLevelDims, unsigned int pixelSizeInBytes )
36 | {
37 | size_t offset = 0;
38 | for( unsigned int mipLevel = mipTailFirstLevel; mipLevel < numMipLevels; ++mipLevel )
39 | {
40 | const uint2 levelDims = mipLevelDims[mipLevel];
41 | if( !readMipLevel( dest + offset, mipLevel, levelDims.x, levelDims.y ) )
42 | {
43 | return false;
44 | }
45 |
46 | // Increment offset.
47 | offset += levelDims.x * levelDims.y * pixelSizeInBytes;
48 | }
49 | return true;
50 | }
51 |
52 | } // namespace demandLoading
53 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/Math.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | namespace demandLoading {
32 |
33 | // Return ceil(x/y) for integers x and y
34 | template
35 | inline IntT idivCeil( IntT x, IntT2 y )
36 | {
37 | return ( x + y - 1 ) / y;
38 | }
39 |
40 | } // namespace demandLoading
41 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/TextureDescriptor.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | #pragma once
29 |
30 | #include
31 |
32 | namespace demandLoading {
33 |
34 | /// TextureDescriptor specifies the address mode (e.g. wrap vs. clamp), filter mode (point vs. linear), etc.
35 | struct TextureDescriptor
36 | {
37 | CUaddress_mode addressMode[2];
38 | CUfilter_mode filterMode;
39 | CUfilter_mode mipmapFilterMode;
40 | unsigned int maxAnisotropy;
41 | };
42 |
43 | } // namespace demandLoading
44 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/TextureInfo.cpp:
--------------------------------------------------------------------------------
1 |
2 | //
3 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
4 | //
5 | // Redistribution and use in source and binary forms, with or without
6 | // modification, are permitted provided that the following conditions
7 | // are met:
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above copyright
11 | // notice, this list of conditions and the following disclaimer in the
12 | // documentation and/or other materials provided with the distribution.
13 | // * Neither the name of NVIDIA CORPORATION nor the names of its
14 | // contributors may be used to endorse or promote products derived
15 | // from this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
18 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | //
29 |
30 | #include "Exception.h"
31 | #include
32 |
33 | #include
34 | #include
35 |
36 | namespace demandLoading {
37 |
38 | unsigned int getBytesPerChannel( const CUarray_format format )
39 | {
40 | switch( format )
41 | {
42 | case CU_AD_FORMAT_SIGNED_INT8:
43 | case CU_AD_FORMAT_UNSIGNED_INT8:
44 | return 1;
45 |
46 | case CU_AD_FORMAT_SIGNED_INT16:
47 | case CU_AD_FORMAT_UNSIGNED_INT16:
48 | return 2;
49 |
50 | case CU_AD_FORMAT_SIGNED_INT32:
51 | case CU_AD_FORMAT_UNSIGNED_INT32:
52 | return 4;
53 |
54 | case CU_AD_FORMAT_HALF:
55 | return sizeof( half );
56 |
57 | case CU_AD_FORMAT_FLOAT:
58 | return sizeof( float );
59 | }
60 | DEMAND_ASSERT_MSG( false, "Invalid CUDA array format" );
61 | return sizeof( float );
62 | }
63 |
64 | } // namespace demandLoading
65 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/TextureInfo.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | #pragma once
29 |
30 | #include
31 |
32 | namespace demandLoading {
33 |
34 | /// Image info, including dimensions and format.
35 | struct TextureInfo
36 | {
37 | unsigned int width;
38 | unsigned int height;
39 | CUarray_format format;
40 | unsigned int numChannels;
41 | unsigned int numMipLevels;
42 | };
43 |
44 | /// Get the channel size in bytes.
45 | unsigned int getBytesPerChannel( const CUarray_format format );
46 |
47 |
48 | } // namespace demandLoading
49 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/TilePool.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | #pragma once
29 |
30 | #include
31 |
32 | #include
33 |
34 | namespace demandLoading {
35 |
36 | class TilePool
37 | {
38 | public:
39 | /// Construct tile pool for the specified device.
40 | explicit TilePool( unsigned int deviceIndex );
41 |
42 | /// Destroy the tile pool, reclaiming its resources.
43 | ~TilePool();
44 |
45 | /// Allocate memory on the specified device, returning a device memory handle and offset.
46 | void allocate( size_t numBytes, CUmemGenericAllocationHandle* handle, size_t* offset );
47 |
48 | /// The tile size is fixed.
49 | static const unsigned int TILE_SIZE = 65536;
50 |
51 | private:
52 | unsigned int m_deviceIndex;
53 | std::vector m_arenas;
54 | size_t m_arenaSize = 0;
55 | size_t m_offset = 0;
56 |
57 | CUmemGenericAllocationHandle createArena() const;
58 | };
59 |
60 | } // namespace demandLoading
61 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/include/DemandLoading/DemandTextureContext.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #include
32 |
33 | #include
34 |
35 | namespace demandLoading {
36 |
37 | struct DemandTextureInfo;
38 |
39 | /// Device-side demand texture context.
40 | struct DemandTextureContext
41 | {
42 | OptixPagingContext m_pagingContext;
43 | DemandTextureInfo* m_textureInfos;
44 | cudaTextureObject_t* m_textures;
45 | };
46 |
47 | } // namespace demandLoading
48 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/include/DemandLoading/TextureDescriptor.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | #pragma once
29 |
30 | #include
31 |
32 | namespace demandLoading {
33 |
34 | /// TextureDescriptor specifies the address mode (e.g. wrap vs. clamp), filter mode (point vs. linear), etc.
35 | struct TextureDescriptor
36 | {
37 | CUaddress_mode addressMode[2];
38 | CUfilter_mode filterMode;
39 | CUfilter_mode mipmapFilterMode;
40 | unsigned int maxAnisotropy;
41 | };
42 |
43 | } // namespace demandLoading
44 |
--------------------------------------------------------------------------------
/SDK/lib/DemandLoading/include/DemandLoading/TextureInfo.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | #pragma once
29 |
30 | #include
31 |
32 | namespace demandLoading {
33 |
34 | /// Image info, including dimensions and format.
35 | struct TextureInfo
36 | {
37 | unsigned int width;
38 | unsigned int height;
39 | CUarray_format format;
40 | unsigned int numChannels;
41 | unsigned int numMipLevels;
42 | };
43 |
44 | /// Get the channel size in bytes.
45 | unsigned int getBytesPerChannel( const CUarray_format format );
46 |
47 |
48 | } // namespace demandLoading
49 |
--------------------------------------------------------------------------------
/SDK/lib/mdas/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | # CUDA compilation doesn't pick up the mdas include path target property.
30 | #include_directories( include )
31 |
32 | cuda_wrap_srcs( mdas OBJ generated_files kdgrid.cu "" OPTIONS "" )
33 |
34 | add_library( mdas STATIC
35 | kdgrid.h
36 | aabb.h
37 | buffer.h
38 | point.h
39 | kdgrid.cu
40 | ${generated_files}
41 | )
42 |
43 | set_target_properties(mdas PROPERTIES LINKER_LANGUAGE CUDA)
44 |
45 | target_include_directories( mdas PUBLIC include )
46 |
47 | # These CUDA files need to be compiled as OBJ, not as PTX
48 | set_source_files_properties( kdgrid.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ )
49 |
50 | # This file is just for reference in the IDE, don't compile it.
51 | #set_source_files_properties( optixPagingImpl.cpp PROPERTIES HEADER_FILE_ONLY TRUE )
52 |
53 | set_property(TARGET mdas PROPERTY FOLDER "${OPTIX_IDE_FOLDER}")
54 |
55 | source_group("CUDA Files" REGULAR_EXPRESSION ".+\\.cu$")
56 |
--------------------------------------------------------------------------------
/SDK/lib/mdas/buffer.h:
--------------------------------------------------------------------------------
1 | #ifndef _BUFFER_H_
2 | #define _BUFFER_H_
3 |
4 | #include
5 |
6 | template
7 | bool checkCudaError_(T result, char const* const func, const char* const file, int const line) {
8 | if (result) {
9 | printf("CUDA error at %s:%d code=%d \"%s\"\n", file, line, static_cast(result), func);
10 | return true;
11 | }
12 | else {
13 | return false;
14 | }
15 | }
16 | #define CUDA_CHECK(val) checkCudaError_((val),#val,__FILE__,__LINE__)
17 |
18 |
19 | template
20 | class Buffer {
21 |
22 | public:
23 |
24 | Buffer(void) : size(0), totalSize(0), data(nullptr) {}
25 |
26 | Buffer(size_t size) : size(0), totalSize(0), data(nullptr) {
27 | Resize(size);
28 | }
29 |
30 | Buffer(const Buffer& other) : size(other.size), totalSize(other.totalSize), data(nullptr) {
31 | Resize(other.totalSize);
32 | size = other.size;
33 | if (size > 0)
34 | CUDA_CHECK(cudaMemcpy(data, other.data, sizeof(T) * other.size, cudaMemcpyDeviceToDevice));
35 | }
36 |
37 | ~Buffer(void) {
38 | if (data) cudaFree(data);
39 | }
40 |
41 | void Resize(size_t size) {
42 | if (size > totalSize) {
43 | if (data) cudaFree(data);
44 | CUDA_CHECK(cudaMallocManaged(&data, sizeof(T) * size));
45 | totalSize = size;
46 | }
47 | this->size = size;
48 | }
49 |
50 | T* Data(void) {
51 | return data;
52 | }
53 |
54 | T& operator[](int index) {
55 | return data[index];
56 | }
57 |
58 | Buffer& operator=(const Buffer& other) {
59 | Resize(other.totalSize);
60 | size = other.size;
61 | CUDA_CHECK(cudaMemcpy(data, other.data, sizeof(T) * other.size, cudaMemcpyDeviceToDevice));
62 | return *this;
63 | }
64 |
65 | size_t Size(void) {
66 | return size;
67 | }
68 |
69 | private:
70 | T* data;
71 | size_t size;
72 | size_t totalSize;
73 | };
74 |
75 | #endif /* _BUFFER_H_ */
76 |
--------------------------------------------------------------------------------
/SDK/lib/optixPaging/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | # CUDA compilation doesn't pick up the optixPaging include path target property.
30 | include_directories( include )
31 |
32 | cuda_wrap_srcs( optixPaging OBJ generated_files optixPaging.cu "" OPTIONS "" )
33 |
34 | add_library( optixPaging STATIC
35 | include/optixPaging/optixPaging.h
36 | optixPagingImpl.cpp
37 | optixPaging.cu
38 | ${generated_files}
39 | )
40 |
41 | target_include_directories( optixPaging PUBLIC include )
42 |
43 | # These CUDA files need to be compiled as OBJ, not as PTX
44 | set_source_files_properties( optixPaging.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ )
45 |
46 | # This file is just for reference in the IDE, don't compile it.
47 | set_source_files_properties( optixPagingImpl.cpp PROPERTIES HEADER_FILE_ONLY TRUE )
48 |
49 | set_property(TARGET optixPaging PROPERTY FOLDER "${OPTIX_IDE_FOLDER}")
50 |
51 | source_group("CUDA Files" REGULAR_EXPRESSION ".+\\.cu$")
52 |
--------------------------------------------------------------------------------
/SDK/optixAmbientOcclusion/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixAmbientOcclusion target_name
30 | optixAmbientOcclusion.cpp
31 |
32 | OPTIONS -rdc true
33 | )
34 |
35 | target_link_libraries( ${target_name}
36 | ${CUDA_LIBRARIES}
37 | )
38 |
--------------------------------------------------------------------------------
/SDK/optixBoundValues/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixBoundValues target_name
30 | optixBoundValues.cu
31 | optixBoundValues_ch.cu
32 | optixBoundValues.cpp
33 | optixBoundValues.h
34 | OPTIONS -rdc true
35 | )
36 |
37 | target_link_libraries( ${target_name}
38 | ${CUDA_LIBRARIES}
39 | )
40 |
--------------------------------------------------------------------------------
/SDK/optixCallablePrograms/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixCallablePrograms target_name
30 | optixCallablePrograms.cpp
31 | optixCallablePrograms.cu
32 | optixCallablePrograms.h
33 | OPTIONS -rdc true
34 | )
35 |
36 | target_link_libraries( ${target_name}
37 | ${CUDA_LIBRARIES}
38 | )
39 |
40 |
--------------------------------------------------------------------------------
/SDK/optixCallablePrograms/optixCallablePrograms.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #include
32 |
33 | struct EmptyData
34 | {
35 | };
36 |
37 | struct HitGroupData : sphere::SphereHitGroupData
38 | {
39 | unsigned int dc_index;
40 | };
41 |
42 |
--------------------------------------------------------------------------------
/SDK/optixCurves/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixCurves target_name
30 | optixCurves.cpp
31 | optixCurves.h
32 | optixCurves.cu
33 | OPTIONS -rdc true
34 | )
35 |
36 | target_link_libraries( ${target_name}
37 | ${CUDA_LIBRARIES}
38 | )
39 |
--------------------------------------------------------------------------------
/SDK/optixCurves/optixCurves.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | struct Params
30 | {
31 | uchar4* image;
32 | unsigned int image_width;
33 | unsigned int image_height;
34 | float3 cam_eye;
35 | float3 cam_u, cam_v, cam_w;
36 | OptixTraversableHandle handle;
37 | };
38 |
39 |
40 | struct RayGenData
41 | {
42 | // No data needed
43 | };
44 |
45 |
46 | struct MissData
47 | {
48 | float3 bg_color;
49 | };
50 |
51 |
52 | struct HitGroupData
53 | {
54 | // No data needed
55 | };
56 |
--------------------------------------------------------------------------------
/SDK/optixCutouts/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixCutouts target_name
30 | ${SAMPLES_CUDA_DIR}/helpers.h
31 | optixCutouts.cu
32 | optixCutouts.cpp
33 | optixCutouts.h
34 | OPTIONS -rdc true
35 | )
36 |
37 | target_link_libraries( ${target_name}
38 | ${CUDA_LIBRARIES}
39 | )
40 |
--------------------------------------------------------------------------------
/SDK/optixDemandPaging/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | set( EXP_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../lib" )
30 | include_directories(
31 | .
32 | ${EXP_LIB_DIR}/optixPaging/include
33 | ${EXP_LIB_DIR}
34 | )
35 |
36 | OPTIX_add_sample_executable( optixDemandPaging targetName
37 | ${SAMPLES_CUDA_DIR}/helpers.h
38 | optixDemandPaging.cpp
39 | optixDemandPaging.cu
40 | optixDemandPaging.h
41 | CheckerBoardImage.cpp
42 | CheckerBoardImage.h
43 | DemandTexture.cpp
44 | DemandTexture.h
45 | DemandTextureManager.cpp
46 | DemandTextureManager.h
47 | ImageReader.h
48 | )
49 |
50 | target_link_libraries( ${targetName} optixPaging ${CUDA_LIBRARIES} )
51 |
--------------------------------------------------------------------------------
/SDK/optixDemandPaging/README.txt:
--------------------------------------------------------------------------------
1 | This sample illustrates how to use the optixPaging library to load whole
2 | miplevels on demand. It does not employ the demand loading library.
3 |
--------------------------------------------------------------------------------
/SDK/optixDemandTexture/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | if( CUDA_VERSION VERSION_LESS "11.1" )
30 | return()
31 | endif()
32 |
33 | set( LIB_DIR "../lib" )
34 |
35 | # CUDA code includes from lib/DemandLoading, but the library target doesn't set the CUDA include path.
36 | include_directories(
37 | ${LIB_DIR}/optixPaging/include
38 | ${LIB_DIR}/DemandLoading/include
39 | )
40 |
41 | OPTIX_add_sample_executable( optixDemandTexture target_name
42 | ${SAMPLES_CUDA_DIR}/helpers.h
43 | optixDemandTexture.cpp
44 | optixDemandTexture.cu
45 | optixDemandTexture.h
46 | )
47 |
48 | target_link_libraries( ${target_name}
49 | optixPaging
50 | DemandLoading_exp
51 | )
52 |
--------------------------------------------------------------------------------
/SDK/optixDemandTexture/README.txt:
--------------------------------------------------------------------------------
1 | This sample illustrates how to use the demand loading library to load sparse
2 | texture tiles on demand from an EXR texture.
3 |
--------------------------------------------------------------------------------
/SDK/optixDenoiser/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # Copyright (c) 2010 - 2011 NVIDIA Corporation. All rights reserved.
4 | #
5 | # NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6 | # rights in and to this software, related documentation and any modifications thereto.
7 | # Any use, reproduction, disclosure or distribution of this software and related
8 | # documentation without an express license agreement from NVIDIA Corporation is strictly
9 | # prohibited.
10 | #
11 | # TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12 | # AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13 | # INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14 | # PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15 | # SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16 | # LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17 | # BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 | # INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19 | # SUCH DAMAGES
20 | #
21 |
22 | # See top level CMakeLists.txt file for documentation of OPTIX_add_sample_executable.
23 |
24 |
25 |
26 | OPTIX_add_sample_executable( optixDenoiser target_name
27 | OptiXDenoiser.h
28 | optixDenoiser.cpp
29 | )
30 |
31 | set_target_properties( ${target_name} PROPERTIES CXX_STANDARD 14 )
32 |
33 | target_link_libraries( ${target_name}
34 | ${CUDA_LIBRARIES}
35 | )
36 |
37 |
38 |
--------------------------------------------------------------------------------
/SDK/optixDepthOfField/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixDepthOfField target_name
30 | optixDepthOfField.cpp
31 |
32 | OPTIONS -rdc true
33 | )
34 |
35 | target_link_libraries( ${target_name}
36 | ${CUDA_LIBRARIES}
37 | )
38 |
--------------------------------------------------------------------------------
/SDK/optixDirectLighting/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixDirectLighting target_name
30 | optixDirectLighting.cpp
31 |
32 | OPTIONS -rdc true
33 | )
34 |
35 | target_link_libraries( ${target_name}
36 | ${CUDA_LIBRARIES}
37 | )
38 |
--------------------------------------------------------------------------------
/SDK/optixDynamicGeometry/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | # Tag the following kernel to be compiled to OBJ intead of PTX (which is the default for
30 | # OPTIX_add_sample_executable). Do must be called before OPTIX_add_sample_executable.
31 | set_source_files_properties(
32 | ${CMAKE_CURRENT_SOURCE_DIR}/vertices.cu
33 | PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ
34 | )
35 |
36 | OPTIX_add_sample_executable( optixDynamicGeometry target_name
37 | optixDynamicGeometry.cu
38 | optixDynamicGeometry.cpp
39 | optixDynamicGeometry.h
40 | vertices.cu
41 | # OPTIONS -rdc true
42 | )
43 |
44 | target_link_libraries( ${target_name} ${CUDA_LIBRARIES} )
45 |
--------------------------------------------------------------------------------
/SDK/optixDynamicGeometry/optixDynamicGeometry.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | struct Params
30 | {
31 | uchar4* frame_buffer;
32 | unsigned int width;
33 | unsigned int height;
34 | float3 eye, U, V, W;
35 | OptixTraversableHandle handle;
36 | int subframe_index;
37 | };
38 |
39 | struct RayGenData
40 | {
41 | float3 cam_eye;
42 | float3 camera_u, camera_v, camera_w;
43 | };
44 |
45 |
46 | struct MissData
47 | {
48 | float4 bg_color;
49 | };
50 |
51 |
52 | struct HitGroupData
53 | {
54 | float3 color;
55 | };
56 |
--------------------------------------------------------------------------------
/SDK/optixDynamicGeometry/vertices.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #include
32 | #include
33 |
34 | enum AnimationMode
35 | {
36 | AnimationMode_None,
37 | AnimationMode_Deform,
38 | AnimationMode_Explode
39 | };
40 |
41 | extern "C" __host__ void generateAnimatedVetrices( float3* out_vertices, AnimationMode animation_mode, float time, int width, int height );
42 |
--------------------------------------------------------------------------------
/SDK/optixDynamicMaterials/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixDynamicMaterials target_name
30 | optixDynamicMaterials.cu
31 | optixDynamicMaterials.cpp
32 | optixDynamicMaterials.h
33 | OPTIONS -rdc true
34 | )
35 |
36 | target_link_libraries( ${target_name}
37 | ${CUDA_LIBRARIES}
38 | )
39 |
--------------------------------------------------------------------------------
/SDK/optixDynamicMaterials/optixDynamicMaterials.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | struct Params
30 | {
31 | uchar4* image;
32 | unsigned int image_width;
33 | unsigned int image_height;
34 | float radius;
35 | OptixTraversableHandle handle;
36 | float3 cam_eye;
37 | float3 camera_u, camera_v, camera_w;
38 | unsigned int hitgroupRecordIdx_0;
39 | unsigned int hitgroupRecordStride;
40 | };
41 |
42 |
43 | struct RayGenData
44 | {
45 | float3 cam_eye;
46 | float3 camera_u, camera_v, camera_w;
47 | };
48 |
49 |
50 | struct MissData
51 | {
52 | float3 color;
53 | };
54 |
55 |
56 | struct HitGroupData
57 | {
58 | float3 color;
59 | unsigned int geometryIndex;
60 | };
61 |
--------------------------------------------------------------------------------
/SDK/optixHair/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixHair target_name
30 | optixHair.cpp
31 | optixHair.h
32 | optixHair.cu
33 | Renderers.h
34 | Renderers.cpp
35 | Hair.h
36 | Hair.cpp
37 | Head.h
38 | Head.cpp
39 | ProgramGroups.h
40 | ProgramGroups.cpp
41 | Util.h
42 | OPTIONS -rdc true
43 | )
44 |
45 | target_link_libraries( ${target_name}
46 | ${CUDA_LIBRARIES}
47 | )
48 |
--------------------------------------------------------------------------------
/SDK/optixHair/README.TXT:
--------------------------------------------------------------------------------
1 |
2 | Keyboard commands:
3 | * 'q' or 'ESC': Quit the application.
4 | * '1' linear (segments) interpretation of the geometry.
5 | * '2' quadratic b-spline interpretation of the geometry.
6 | * '3' cubic b-spline interpretation of the geometry.
7 | * 's' "segment u": modulate base color with segment u, i.e. each segment starts
8 | black and ends with full luminance of the base color.
9 | * 'r' "root-to-tip u": modulate base color with root-to-tip u, i.e. start hair
10 | at root black and full luminance of base color at hair's tip.
11 | * 'i' "index color": assign one of six solid colors (red, green, blue, magenta,
12 | cyan, and yellow) based on a hair's index. The shader in this mode
13 | demonstrates how to compute a hair index from the primitive index.
14 | It also does root to tip shading but uses index based math to compute a
15 | contiguous u along the hair.
16 | * 'c' "constant radius" hair geometry.
17 | * 't' "tapered radius" hair geometry.
18 |
19 | The hair model file for this SDK sample are from Cem Yuksel's web page:
20 |
21 | www.cemyuksel.com/research/hairmodels
22 |
23 | You can download three additional .hair definitions from there to be used
24 | by the sample code. Other hair files than the default can be passed to
25 | the executable via its "--hair" command-line parameter.
26 |
--------------------------------------------------------------------------------
/SDK/optixHello/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixHello target_name
30 | ${SAMPLES_CUDA_DIR}/helpers.h
31 | draw_solid_color.cu
32 | optixHello.cpp
33 | optixHello.h
34 |
35 | OPTIONS -rdc true
36 | )
37 |
38 | target_link_libraries( ${target_name}
39 | ${CUDA_LIBRARIES}
40 | )
41 |
--------------------------------------------------------------------------------
/SDK/optixHello/draw_solid_color.cu:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #include
30 |
31 | #include "optixHello.h"
32 | #include
33 |
34 | extern "C" {
35 | __constant__ Params params;
36 | }
37 |
38 | extern "C"
39 | __global__ void __raygen__draw_solid_color()
40 | {
41 | uint3 launch_index = optixGetLaunchIndex();
42 | RayGenData* rtData = (RayGenData*)optixGetSbtDataPointer();
43 | params.image[launch_index.y * params.image_width + launch_index.x] =
44 | make_color( make_float3( rtData->r, rtData->g, rtData->b ) );
45 | }
46 |
--------------------------------------------------------------------------------
/SDK/optixHello/optixHello.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | struct Params
30 | {
31 | uchar4* image;
32 | unsigned int image_width;
33 | };
34 |
35 | struct RayGenData
36 | {
37 | float r,g,b;
38 | };
39 |
--------------------------------------------------------------------------------
/SDK/optixMeshViewer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixMeshViewer target_name
30 | optixMeshViewer.cpp
31 |
32 | OPTIONS -rdc true
33 | )
34 |
35 | target_link_libraries( ${target_name}
36 | ${CUDA_LIBRARIES}
37 | )
38 |
--------------------------------------------------------------------------------
/SDK/optixMotionBlur/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixMotionBlur target_name
30 | optixMotionBlur.cpp
31 |
32 | OPTIONS -rdc true
33 | )
34 |
35 | target_link_libraries( ${target_name}
36 | ${CUDA_LIBRARIES}
37 | )
38 |
--------------------------------------------------------------------------------
/SDK/optixMultiGPU/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/optixMultiGPU_kernels.cu
30 | PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ
31 | )
32 |
33 | OPTIX_add_sample_executable( optixMultiGPU target_name
34 | ${SAMPLES_CUDA_DIR}/helpers.h
35 | optixMultiGPU_kernels.cu
36 | optixMultiGPU.cu
37 | optixMultiGPU.cpp
38 | optixMultiGPU.h
39 | )
40 | set_property(TARGET ${target_name} PROPERTY CUDA_SEPARABLE_COMPILATION ON)
41 |
42 | target_link_libraries( ${target_name}
43 | ${CUDA_LIBRARIES}
44 | )
45 |
--------------------------------------------------------------------------------
/SDK/optixMultiGPU/optixMultiGPU_kernels.cu:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #include "sutil/WorkDistribution.h"
30 |
31 | extern "C" __global__ void fillSamples(
32 | int gpu_idx,
33 | int num_gpus,
34 | int width,
35 | int height,
36 | int2* sample_indices )
37 | {
38 | StaticWorkDistribution wd;
39 | wd.setRasterSize( width, height );
40 | wd.setNumGPUs( num_gpus );
41 |
42 | const int sample_idx = blockIdx.x;
43 | sample_indices[sample_idx] = wd.getSamplePixel( gpu_idx, sample_idx );
44 | }
45 |
46 |
47 | extern "C" __host__ void fillSamplesCUDA(
48 | int num_samples,
49 | cudaStream_t stream,
50 | int gpu_idx,
51 | int num_gpus,
52 | int width,
53 | int height,
54 | int2* sample_indices )
55 | {
56 | fillSamples<<>>(
57 | gpu_idx,
58 | num_gpus,
59 | width,
60 | height,
61 | sample_indices );
62 | }
63 |
--------------------------------------------------------------------------------
/SDK/optixNVLink/nvml_configure.h.in:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019 NVIDIA Corporation. All rights reserved.
3 | //
4 | // NVIDIA Corporation and its licensors retain all intellectual property and proprietary
5 | // rights in and to this software, related documentation and any modifications thereto.
6 | // Any use, reproduction, disclosure or distribution of this software and related
7 | // documentation without an express license agreement from NVIDIA Corporation is strictly
8 | // prohibited.
9 | //
10 | // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
11 | // AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
12 | // INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
13 | // PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
14 | // SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
15 | // LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
16 | // BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
17 | // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
18 | // SUCH DAMAGES
19 | //
20 | //
21 | //
22 |
23 | #cmakedefine01 OPTIX_USE_NVML
24 |
--------------------------------------------------------------------------------
/SDK/optixNVLink/optixNVLink_kernels.cu:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #include
30 |
31 | extern "C" __global__ void fillSamples( int gpu_idx, int num_gpus, int width, int height, int2* sample_indices )
32 | {
33 | StaticWorkDistribution wd;
34 | wd.setRasterSize( width, height );
35 | wd.setNumGPUs( num_gpus );
36 |
37 | const int sample_idx = blockIdx.x;
38 | sample_indices[sample_idx] = wd.getSamplePixel( gpu_idx, sample_idx );
39 | }
40 |
41 |
42 | extern "C" __host__ void fillSamplesCUDA( int num_samples, cudaStream_t stream, int gpu_idx, int num_gpus, int width, int height, int2* sample_indices )
43 | {
44 | fillSamples<<>>(
45 | gpu_idx,
46 | num_gpus,
47 | width,
48 | height,
49 | sample_indices );
50 | }
51 |
--------------------------------------------------------------------------------
/SDK/optixPathTracer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixPathTracer target_name
30 | optixPathTracer.cpp
31 |
32 | OPTIONS -rdc true
33 | )
34 |
35 | target_link_libraries( ${target_name}
36 | ${CUDA_LIBRARIES}
37 | )
38 |
--------------------------------------------------------------------------------
/SDK/optixRaycasting/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/optixRaycastingKernels.cu
30 | PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ
31 | )
32 |
33 | OPTIX_add_sample_executable( optixRaycasting target_name
34 | optixRaycasting.cu
35 | optixRaycasting.cpp
36 | optixRaycasting.h
37 | optixRaycastingKernels.cu
38 | optixRaycastingKernels.h
39 | )
40 |
41 | target_link_libraries( ${target_name}
42 | ${CUDA_LIBRARIES}
43 | )
44 |
--------------------------------------------------------------------------------
/SDK/optixRaycasting/optixRaycasting.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 |
32 | enum RayType
33 | {
34 | RAY_TYPE_RADIANCE = 0,
35 | RAY_TYPE_COUNT
36 | };
37 |
38 | struct Ray;
39 | struct Hit;
40 |
41 | struct Params
42 | {
43 | OptixTraversableHandle handle;
44 | Ray* rays;
45 | Hit* hits;
46 | };
47 |
48 |
--------------------------------------------------------------------------------
/SDK/optixRaycasting/optixRaycastingKernels.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | //
32 | // Kernels for processing hits and rays outside of OptiX
33 | //
34 |
35 | struct Ray
36 | {
37 | float3 origin;
38 | float tmin;
39 | float3 dir;
40 | float tmax;
41 | };
42 |
43 | struct Hit
44 | {
45 | float t;
46 | float3 geom_normal;
47 | };
48 |
49 | void createRaysOrthoOnDevice( Ray* rays_device, int width, int height, float3 bbmin, float3 bbmax, float padding );
50 |
51 | void translateRaysOnDevice( Ray* rays_device, int count, float3 offset );
52 |
53 | void shadeHitsOnDevice( float3* image_device, int count, const Hit* hits_device );
54 |
55 |
--------------------------------------------------------------------------------
/SDK/optixSimpleMotionBlur/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixSimpleMotionBlur target_name
30 | optixSimpleMotionBlur.cu
31 | optixSimpleMotionBlur.cpp
32 | optixSimpleMotionBlur.h
33 | OPTIONS -rdc true
34 | )
35 |
36 | target_link_libraries( ${target_name}
37 | ${CUDA_LIBRARIES}
38 | )
39 |
--------------------------------------------------------------------------------
/SDK/optixSimpleMotionBlur/optixSimpleMotionBlur.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | enum RayType
30 | {
31 | RAY_TYPE_RADIANCE = 0,
32 | RAY_TYPE_COUNT
33 | };
34 |
35 |
36 | struct Params
37 | {
38 | unsigned int width;
39 | unsigned int height;
40 | float4* accum_buffer;
41 | uchar4* frame_buffer;
42 | unsigned int subframe_index;
43 |
44 | float3 eye;
45 | float3 U;
46 | float3 V;
47 | float3 W;
48 |
49 | OptixTraversableHandle handle;
50 | };
51 |
52 |
53 | struct RayGenData
54 | {
55 | };
56 |
57 |
58 | struct MissData
59 | {
60 | float3 color;
61 | unsigned int pad;
62 | };
63 |
64 |
65 | struct SphereData
66 | {
67 | float3 center;
68 | float radius;
69 | };
70 |
71 |
72 | struct HitGroupData
73 | {
74 | float3 color;
75 |
76 | // For spheres. In real use case, we would have an abstraction for geom data/ material data
77 | float3 center;
78 | float radius;
79 |
80 | unsigned int pad;
81 |
82 | };
83 |
84 |
85 |
--------------------------------------------------------------------------------
/SDK/optixSimplePathTracer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixSimplePathTracer target_name
30 | optixSimplePathTracer.cu
31 | optixSimplePathTracer.cpp
32 | optixSimplePathTracer.h
33 | OPTIONS -rdc true
34 | )
35 |
36 | target_link_libraries( ${target_name}
37 | ${CUDA_LIBRARIES}
38 | )
39 |
--------------------------------------------------------------------------------
/SDK/optixSimplePathTracer/optixSimplePathTracer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | enum RayType
30 | {
31 | RAY_TYPE_RADIANCE = 0,
32 | RAY_TYPE_OCCLUSION = 1,
33 | RAY_TYPE_COUNT
34 | };
35 |
36 |
37 | struct ParallelogramLight
38 | {
39 | float3 corner;
40 | float3 v1, v2;
41 | float3 normal;
42 | float3 emission;
43 | };
44 |
45 |
46 | struct Params
47 | {
48 | unsigned int subframe_index;
49 | float4* accum_buffer;
50 | uchar4* frame_buffer;
51 | unsigned int width;
52 | unsigned int height;
53 | unsigned int samples_per_launch;
54 |
55 | float3 eye;
56 | float3 U;
57 | float3 V;
58 | float3 W;
59 |
60 | ParallelogramLight light; // TODO: make light list
61 | OptixTraversableHandle handle;
62 | };
63 |
64 |
65 | struct RayGenData
66 | {
67 | };
68 |
69 |
70 | struct MissData
71 | {
72 | float4 bg_color;
73 | };
74 |
75 |
76 | struct HitGroupData
77 | {
78 | float3 emission_color;
79 | float3 diffuse_color;
80 | float4* vertices;
81 | };
82 |
--------------------------------------------------------------------------------
/SDK/optixSphere/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixSphere target_name
30 | optixSphere.cu
31 | optixSphere.cpp
32 | optixSphere.h
33 | OPTIONS -rdc true
34 | )
35 |
36 | target_link_libraries( ${target_name}
37 | ${CUDA_LIBRARIES}
38 | )
39 |
--------------------------------------------------------------------------------
/SDK/optixSphere/optixSphere.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | struct Params
30 | {
31 | uchar4* image;
32 | unsigned int image_width;
33 | unsigned int image_height;
34 | int origin_x;
35 | int origin_y;
36 | OptixTraversableHandle handle;
37 | };
38 |
39 |
40 | struct RayGenData
41 | {
42 | float3 cam_eye;
43 | float3 camera_u, camera_v, camera_w;
44 | };
45 |
46 |
47 | struct MissData
48 | {
49 | float r, g, b;
50 | };
51 |
52 |
--------------------------------------------------------------------------------
/SDK/optixTriangle/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixTriangle target_name
30 | optixTriangle.cu
31 | optixTriangle.cpp
32 | optixTriangle.h
33 | OPTIONS -rdc true
34 | )
35 |
36 | target_link_libraries( ${target_name}
37 | ${CUDA_LIBRARIES}
38 | )
39 |
--------------------------------------------------------------------------------
/SDK/optixTriangle/optixTriangle.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | struct Params
30 | {
31 | uchar4* image;
32 | unsigned int image_width;
33 | unsigned int image_height;
34 | float3 cam_eye;
35 | float3 cam_u, cam_v, cam_w;
36 | OptixTraversableHandle handle;
37 | };
38 |
39 |
40 | struct RayGenData
41 | {
42 | // No data needed
43 | };
44 |
45 |
46 | struct MissData
47 | {
48 | float3 bg_color;
49 | };
50 |
51 |
52 | struct HitGroupData
53 | {
54 | // No data needed
55 | };
56 |
--------------------------------------------------------------------------------
/SDK/optixWhitted/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | OPTIX_add_sample_executable( optixWhitted target_name
30 | ${SAMPLES_CUDA_DIR}/helpers.h
31 | optixWhitted.cpp
32 | optixWhitted.h
33 | camera.cu
34 | geometry.cu
35 | shading.cu
36 | OPTIONS -rdc true
37 | )
38 |
39 | target_link_libraries( ${target_name}
40 | ${CUDA_LIBRARIES}
41 | )
42 |
--------------------------------------------------------------------------------
/SDK/sampleConfig.h.in:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 | #pragma once
30 |
31 | #define SAMPLES_DIR "@SAMPLES_DIR@"
32 | #define SAMPLES_PTX_DIR "@SAMPLES_PTX_DIR@"
33 | #define SAMPLES_CUDA_DIR "@SAMPLES_CUDA_DIR@"
34 |
35 | // Include directories
36 | #define SAMPLES_RELATIVE_INCLUDE_DIRS @SAMPLES_RELATIVE_INCLUDE_DIRS@
37 | #define SAMPLES_ABSOLUTE_INCLUDE_DIRS @SAMPLES_ABSOLUTE_INCLUDE_DIRS@
38 |
39 | // Signal whether to use NVRTC or not
40 | #cmakedefine01 CUDA_NVRTC_ENABLED
41 |
42 | // NVRTC compiler options
43 | #define CUDA_NVRTC_OPTIONS @CUDA_NVRTC_OPTIONS@
44 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/.appveyor.yml:
--------------------------------------------------------------------------------
1 | branches:
2 | only:
3 | - ci
4 | - master
5 | skip_tags: true
6 | environment:
7 | matrix:
8 | - BUILD_SHARED_LIBS: ON
9 | - BUILD_SHARED_LIBS: OFF
10 | matrix:
11 | fast_finish: true
12 | build_script:
13 | - mkdir build
14 | - cd build
15 | - cmake -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% ..
16 | - cmake --build .
17 | notifications:
18 | - provider: Email
19 | to:
20 | - ci@glfw.org
21 | - on_build_failure: true
22 | - on_build_success: false
23 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/.travis.yml:
--------------------------------------------------------------------------------
1 | language: c
2 | compiler: clang
3 | branches:
4 | only:
5 | - ci
6 | - master
7 | os:
8 | - linux
9 | - osx
10 | sudo: false
11 | addons:
12 | apt:
13 | sources:
14 | - kubuntu-backports
15 | packages:
16 | - cmake
17 | env:
18 | - BUILD_SHARED_LIBS=ON
19 | - BUILD_SHARED_LIBS=OFF
20 | script:
21 | - mkdir build
22 | - cd build
23 | - cmake -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} ..
24 | - cmake --build .
25 | notifications:
26 | email:
27 | recipients:
28 | - ci@glfw.org
29 | on_success: never
30 | on_failure: always
31 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/MacOSXBundleInfo.plist.in:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME}
9 | CFBundleGetInfoString
10 | ${MACOSX_BUNDLE_INFO_STRING}
11 | CFBundleIconFile
12 | ${MACOSX_BUNDLE_ICON_FILE}
13 | CFBundleIdentifier
14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER}
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleLongVersionString
18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING}
19 | CFBundleName
20 | ${MACOSX_BUNDLE_BUNDLE_NAME}
21 | CFBundlePackageType
22 | APPL
23 | CFBundleShortVersionString
24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING}
25 | CFBundleSignature
26 | ????
27 | CFBundleVersion
28 | ${MACOSX_BUNDLE_BUNDLE_VERSION}
29 | CSResourcesFileMapped
30 |
31 | LSRequiresCarbon
32 |
33 | NSHumanReadableCopyright
34 | ${MACOSX_BUNDLE_COPYRIGHT}
35 | NSHighResolutionCapable
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/amd64-mingw32msvc.cmake:
--------------------------------------------------------------------------------
1 | # Define the environment for cross compiling from Linux to Win64
2 | SET(CMAKE_SYSTEM_NAME Windows)
3 | SET(CMAKE_SYSTEM_VERSION 1)
4 | SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc")
5 | SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++")
6 | SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres")
7 | SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib")
8 |
9 | # Configure the behaviour of the find commands
10 | SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc")
11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/i586-mingw32msvc.cmake:
--------------------------------------------------------------------------------
1 | # Define the environment for cross compiling from Linux to Win32
2 | SET(CMAKE_SYSTEM_NAME Windows)
3 | SET(CMAKE_SYSTEM_VERSION 1)
4 | SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc")
5 | SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++")
6 | SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres")
7 | SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib")
8 |
9 | # Configure the behaviour of the find commands
10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc")
11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/i686-pc-mingw32.cmake:
--------------------------------------------------------------------------------
1 | # Define the environment for cross compiling from Linux to Win32
2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name
3 | SET(CMAKE_SYSTEM_VERSION 1)
4 | SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc")
5 | SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++")
6 | SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres")
7 | SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib")
8 |
9 | #Configure the behaviour of the find commands
10 | SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32")
11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/i686-w64-mingw32.cmake:
--------------------------------------------------------------------------------
1 | # Define the environment for cross compiling from Linux to Win32
2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name
3 | SET(CMAKE_SYSTEM_VERSION 1)
4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib")
8 |
9 | # Configure the behaviour of the find commands
10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/modules/FindMir.cmake:
--------------------------------------------------------------------------------
1 | # Try to find Mir on a Unix system
2 | #
3 | # This will define:
4 | #
5 | # MIR_LIBRARIES - Link these to use Wayland
6 | # MIR_INCLUDE_DIR - Include directory for Wayland
7 | #
8 | # Copyright (c) 2014 Brandon Schaefer
9 |
10 | if (NOT WIN32)
11 |
12 | find_package (PkgConfig)
13 | pkg_check_modules (PKG_MIR QUIET mirclient)
14 |
15 | set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS})
16 | set (MIR_LIBRARIES ${PKG_MIR_LIBRARIES})
17 |
18 | endif ()
19 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/modules/FindVulkan.cmake:
--------------------------------------------------------------------------------
1 | # Find Vulkan
2 | #
3 | # VULKAN_INCLUDE_DIR
4 | # VULKAN_LIBRARY
5 | # VULKAN_FOUND
6 |
7 | if (WIN32)
8 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
9 | "$ENV{VULKAN_SDK}/Include"
10 | "$ENV{VK_SDK_PATH}/Include")
11 | if (CMAKE_CL_64)
12 | find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
13 | "$ENV{VULKAN_SDK}/Bin"
14 | "$ENV{VK_SDK_PATH}/Bin")
15 | find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
16 | "$ENV{VULKAN_SDK}/Bin"
17 | "$ENV{VK_SDK_PATH}/Bin")
18 | else()
19 | find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
20 | "$ENV{VULKAN_SDK}/Bin32"
21 | "$ENV{VK_SDK_PATH}/Bin32")
22 | endif()
23 | else()
24 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS
25 | "$ENV{VULKAN_SDK}/include")
26 | find_library(VULKAN_LIBRARY NAMES vulkan HINTS
27 | "$ENV{VULKAN_SDK}/lib")
28 | endif()
29 |
30 | include(FindPackageHandleStandardArgs)
31 | find_package_handle_standard_args(Vulkan DEFAULT_MSG VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
32 |
33 | mark_as_advanced(VULKAN_INCLUDE_DIR VULKAN_LIBRARY VULKAN_STATIC_LIBRARY)
34 |
35 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/modules/FindWaylandProtocols.cmake:
--------------------------------------------------------------------------------
1 | find_package(PkgConfig)
2 |
3 | pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION})
4 |
5 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
6 | OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR
7 | RESULT_VARIABLE _pkgconfig_failed)
8 | if (_pkgconfig_failed)
9 | message(FATAL_ERROR "Missing wayland-protocols pkgdatadir")
10 | endif()
11 |
12 | string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}")
13 |
14 | find_package_handle_standard_args(WaylandProtocols
15 | FOUND_VAR
16 | WaylandProtocols_FOUND
17 | REQUIRED_VARS
18 | WaylandProtocols_PKGDATADIR
19 | VERSION_VAR
20 | WaylandProtocols_VERSION
21 | HANDLE_COMPONENTS
22 | )
23 |
24 | set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND})
25 | set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR})
26 | set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION})
27 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/modules/FindXKBCommon.cmake:
--------------------------------------------------------------------------------
1 | # - Try to find XKBCommon
2 | # Once done, this will define
3 | #
4 | # XKBCOMMON_FOUND - System has XKBCommon
5 | # XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
6 | # XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
7 | # XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
8 |
9 | find_package(PkgConfig)
10 | pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
11 | set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
12 |
13 | find_path(XKBCOMMON_INCLUDE_DIR
14 | NAMES xkbcommon/xkbcommon.h
15 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
16 | )
17 |
18 | find_library(XKBCOMMON_LIBRARY
19 | NAMES xkbcommon
20 | HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS}
21 | )
22 |
23 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
24 | set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS})
25 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
26 |
27 | include(FindPackageHandleStandardArgs)
28 | find_package_handle_standard_args(XKBCommon DEFAULT_MSG
29 | XKBCOMMON_LIBRARY
30 | XKBCOMMON_INCLUDE_DIR
31 | )
32 |
33 | mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)
34 |
35 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/CMake/x86_64-w64-mingw32.cmake:
--------------------------------------------------------------------------------
1 | # Define the environment for cross compiling from Linux to Win32
2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name
3 | SET(CMAKE_SYSTEM_VERSION 1)
4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib")
8 |
9 | # Configure the behaviour of the find commands
10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/COPYING.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2002-2006 Marcus Geelnard
2 | Copyright (c) 2006-2016 Camilla Berglund
3 |
4 | This software is provided 'as-is', without any express or implied
5 | warranty. In no event will the authors be held liable for any damages
6 | arising from the use of this software.
7 |
8 | Permission is granted to anyone to use this software for any purpose,
9 | including commercial applications, and to alter it and redistribute it
10 | freely, subject to the following restrictions:
11 |
12 | 1. The origin of this software must not be misrepresented; you must not
13 | claim that you wrote the original software. If you use this software
14 | in a product, an acknowledgment in the product documentation would
15 | be appreciated but is not required.
16 |
17 | 2. Altered source versions must be plainly marked as such, and must not
18 | be misrepresented as being the original software.
19 |
20 | 3. This notice may not be removed or altered from any source
21 | distribution.
22 |
23 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/cmake_uninstall.cmake.in:
--------------------------------------------------------------------------------
1 |
2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
4 | endif()
5 |
6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
7 | string(REGEX REPLACE "\n" ";" files "${files}")
8 |
9 | foreach (file ${files})
10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
11 | if (EXISTS "$ENV{DESTDIR}${file}")
12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
13 | OUTPUT_VARIABLE rm_out
14 | RETURN_VALUE rm_retval)
15 | if (NOT "${rm_retval}" STREQUAL 0)
16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
17 | endif()
18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}")
19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
20 | OUTPUT_VARIABLE rm_out
21 | RETURN_VALUE rm_retval)
22 | if (NOT "${rm_retval}" STREQUAL 0)
23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"")
24 | endif()
25 | else()
26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
27 | endif()
28 | endforeach()
29 |
30 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/deps/getopt.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2012, Kim Gräsman
2 | * All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions are met:
6 | * * Redistributions of source code must retain the above copyright notice,
7 | * this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above copyright notice,
9 | * this list of conditions and the following disclaimer in the documentation
10 | * and/or other materials provided with the distribution.
11 | * * Neither the name of Kim Gräsman nor the names of contributors may be used
12 | * to endorse or promote products derived from this software without specific
13 | * prior written permission.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | #ifndef INCLUDED_GETOPT_PORT_H
28 | #define INCLUDED_GETOPT_PORT_H
29 |
30 | #if defined(__cplusplus)
31 | extern "C" {
32 | #endif
33 |
34 | extern const int no_argument;
35 | extern const int required_argument;
36 | extern const int optional_argument;
37 |
38 | extern char* optarg;
39 | extern int optind, opterr, optopt;
40 |
41 | struct option {
42 | const char* name;
43 | int has_arg;
44 | int* flag;
45 | int val;
46 | };
47 |
48 | int getopt(int argc, char* const argv[], const char* optstring);
49 |
50 | int getopt_long(int argc, char* const argv[],
51 | const char* optstring, const struct option* longopts, int* longindex);
52 |
53 | #if defined(__cplusplus)
54 | }
55 | #endif
56 |
57 | #endif // INCLUDED_GETOPT_PORT_H
58 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/cocoa_joystick.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 Cocoa - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2006-2016 Camilla Berglund
5 | //
6 | // This software is provided 'as-is', without any express or implied
7 | // warranty. In no event will the authors be held liable for any damages
8 | // arising from the use of this software.
9 | //
10 | // Permission is granted to anyone to use this software for any purpose,
11 | // including commercial applications, and to alter it and redistribute it
12 | // freely, subject to the following restrictions:
13 | //
14 | // 1. The origin of this software must not be misrepresented; you must not
15 | // claim that you wrote the original software. If you use this software
16 | // in a product, an acknowledgment in the product documentation would
17 | // be appreciated but is not required.
18 | //
19 | // 2. Altered source versions must be plainly marked as such, and must not
20 | // be misrepresented as being the original software.
21 | //
22 | // 3. This notice may not be removed or altered from any source
23 | // distribution.
24 | //
25 | //========================================================================
26 |
27 | #ifndef _glfw3_cocoa_joystick_h_
28 | #define _glfw3_cocoa_joystick_h_
29 |
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \
36 | _GLFWjoystickNS ns_js[GLFW_JOYSTICK_LAST + 1]
37 |
38 |
39 | // Cocoa-specific per-joystick data
40 | //
41 | typedef struct _GLFWjoystickNS
42 | {
43 | GLFWbool present;
44 | char name[256];
45 |
46 | IOHIDDeviceRef deviceRef;
47 |
48 | CFMutableArrayRef axisElements;
49 | CFMutableArrayRef buttonElements;
50 | CFMutableArrayRef hatElements;
51 |
52 | float* axes;
53 | unsigned char* buttons;
54 | } _GLFWjoystickNS;
55 |
56 |
57 | void _glfwInitJoysticksNS(void);
58 | void _glfwTerminateJoysticksNS(void);
59 |
60 | #endif // _glfw3_cocoa_joystick_h_
61 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/cocoa_time.c:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 OS X - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2009-2016 Camilla Berglund
5 | //
6 | // This software is provided 'as-is', without any express or implied
7 | // warranty. In no event will the authors be held liable for any damages
8 | // arising from the use of this software.
9 | //
10 | // Permission is granted to anyone to use this software for any purpose,
11 | // including commercial applications, and to alter it and redistribute it
12 | // freely, subject to the following restrictions:
13 | //
14 | // 1. The origin of this software must not be misrepresented; you must not
15 | // claim that you wrote the original software. If you use this software
16 | // in a product, an acknowledgment in the product documentation would
17 | // be appreciated but is not required.
18 | //
19 | // 2. Altered source versions must be plainly marked as such, and must not
20 | // be misrepresented as being the original software.
21 | //
22 | // 3. This notice may not be removed or altered from any source
23 | // distribution.
24 | //
25 | //========================================================================
26 |
27 | #include "internal.h"
28 |
29 | #include
30 |
31 |
32 | //////////////////////////////////////////////////////////////////////////
33 | ////// GLFW internal API //////
34 | //////////////////////////////////////////////////////////////////////////
35 |
36 | // Initialise timer
37 | //
38 | void _glfwInitTimerNS(void)
39 | {
40 | mach_timebase_info_data_t info;
41 | mach_timebase_info(&info);
42 |
43 | _glfw.ns_time.frequency = (info.denom * 1e9) / info.numer;
44 | }
45 |
46 |
47 | //////////////////////////////////////////////////////////////////////////
48 | ////// GLFW platform API //////
49 | //////////////////////////////////////////////////////////////////////////
50 |
51 | uint64_t _glfwPlatformGetTimerValue(void)
52 | {
53 | return mach_absolute_time();
54 | }
55 |
56 | uint64_t _glfwPlatformGetTimerFrequency(void)
57 | {
58 | return _glfw.ns_time.frequency;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/glfw3.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@CMAKE_INSTALL_PREFIX@
2 | exec_prefix=${prefix}
3 | includedir=${prefix}/include
4 | libdir=${exec_prefix}/lib@LIB_SUFFIX@
5 |
6 | Name: GLFW
7 | Description: A multi-platform library for OpenGL, window and input
8 | Version: @GLFW_VERSION_FULL@
9 | URL: http://www.glfw.org/
10 | Requires.private: @GLFW_PKG_DEPS@
11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@
12 | Libs.private: @GLFW_PKG_LIBS@
13 | Cflags: -I${includedir}
14 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/glfw3Config.cmake.in:
--------------------------------------------------------------------------------
1 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake")
2 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/linux_joystick.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 Linux - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2014 Jonas Ådahl
5 | //
6 | // This software is provided 'as-is', without any express or implied
7 | // warranty. In no event will the authors be held liable for any damages
8 | // arising from the use of this software.
9 | //
10 | // Permission is granted to anyone to use this software for any purpose,
11 | // including commercial applications, and to alter it and redistribute it
12 | // freely, subject to the following restrictions:
13 | //
14 | // 1. The origin of this software must not be misrepresented; you must not
15 | // claim that you wrote the original software. If you use this software
16 | // in a product, an acknowledgment in the product documentation would
17 | // be appreciated but is not required.
18 | //
19 | // 2. Altered source versions must be plainly marked as such, and must not
20 | // be misrepresented as being the original software.
21 | //
22 | // 3. This notice may not be removed or altered from any source
23 | // distribution.
24 | //
25 | //========================================================================
26 |
27 | #ifndef _glfw3_linux_joystick_h_
28 | #define _glfw3_linux_joystick_h_
29 |
30 | #include
31 |
32 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWjoylistLinux linux_js
33 |
34 |
35 | // Linux-specific joystick data
36 | //
37 | typedef struct _GLFWjoystickLinux
38 | {
39 | GLFWbool present;
40 | int fd;
41 | float* axes;
42 | int axisCount;
43 | unsigned char* buttons;
44 | int buttonCount;
45 | char* name;
46 | char* path;
47 | } _GLFWjoystickLinux;
48 |
49 | // Linux-specific joystick API data
50 | //
51 | typedef struct _GLFWjoylistLinux
52 | {
53 | _GLFWjoystickLinux js[GLFW_JOYSTICK_LAST + 1];
54 |
55 | #if defined(__linux__)
56 | int inotify;
57 | int watch;
58 | regex_t regex;
59 | #endif /*__linux__*/
60 | } _GLFWjoylistLinux;
61 |
62 |
63 | GLFWbool _glfwInitJoysticksLinux(void);
64 | void _glfwTerminateJoysticksLinux(void);
65 |
66 | void _glfwPollJoystickEvents(void);
67 |
68 | #endif // _glfw3_linux_joystick_h_
69 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/nsgl_context.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 OS X - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2009-2016 Camilla Berglund
5 | //
6 | // This software is provided 'as-is', without any express or implied
7 | // warranty. In no event will the authors be held liable for any damages
8 | // arising from the use of this software.
9 | //
10 | // Permission is granted to anyone to use this software for any purpose,
11 | // including commercial applications, and to alter it and redistribute it
12 | // freely, subject to the following restrictions:
13 | //
14 | // 1. The origin of this software must not be misrepresented; you must not
15 | // claim that you wrote the original software. If you use this software
16 | // in a product, an acknowledgment in the product documentation would
17 | // be appreciated but is not required.
18 | //
19 | // 2. Altered source versions must be plainly marked as such, and must not
20 | // be misrepresented as being the original software.
21 | //
22 | // 3. This notice may not be removed or altered from any source
23 | // distribution.
24 | //
25 | //========================================================================
26 |
27 | #ifndef _glfw3_nsgl_context_h_
28 | #define _glfw3_nsgl_context_h_
29 |
30 | #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL nsgl
31 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl
32 |
33 |
34 | // NSGL-specific per-context data
35 | //
36 | typedef struct _GLFWcontextNSGL
37 | {
38 | id pixelFormat;
39 | id object;
40 |
41 | } _GLFWcontextNSGL;
42 |
43 | // NSGL-specific global data
44 | //
45 | typedef struct _GLFWlibraryNSGL
46 | {
47 | // dlopen handle for OpenGL.framework (for glfwGetProcAddress)
48 | CFBundleRef framework;
49 |
50 | } _GLFWlibraryNSGL;
51 |
52 |
53 | GLFWbool _glfwInitNSGL(void);
54 | void _glfwTerminateNSGL(void);
55 | GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window,
56 | const _GLFWctxconfig* ctxconfig,
57 | const _GLFWfbconfig* fbconfig);
58 | void _glfwDestroyContextNSGL(_GLFWwindow* window);
59 |
60 | #endif // _glfw3_nsgl_context_h_
61 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/posix_time.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 POSIX - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2002-2006 Marcus Geelnard
5 | // Copyright (c) 2006-2016 Camilla Berglund
6 | //
7 | // This software is provided 'as-is', without any express or implied
8 | // warranty. In no event will the authors be held liable for any damages
9 | // arising from the use of this software.
10 | //
11 | // Permission is granted to anyone to use this software for any purpose,
12 | // including commercial applications, and to alter it and redistribute it
13 | // freely, subject to the following restrictions:
14 | //
15 | // 1. The origin of this software must not be misrepresented; you must not
16 | // claim that you wrote the original software. If you use this software
17 | // in a product, an acknowledgment in the product documentation would
18 | // be appreciated but is not required.
19 | //
20 | // 2. Altered source versions must be plainly marked as such, and must not
21 | // be misrepresented as being the original software.
22 | //
23 | // 3. This notice may not be removed or altered from any source
24 | // distribution.
25 | //
26 | //========================================================================
27 |
28 | #ifndef _glfw3_posix_time_h_
29 | #define _glfw3_posix_time_h_
30 |
31 | #define _GLFW_PLATFORM_LIBRARY_TIME_STATE _GLFWtimePOSIX posix_time
32 |
33 | #include
34 |
35 |
36 | // POSIX-specific global timer data
37 | //
38 | typedef struct _GLFWtimePOSIX
39 | {
40 | GLFWbool monotonic;
41 | uint64_t frequency;
42 |
43 | } _GLFWtimePOSIX;
44 |
45 |
46 | void _glfwInitTimerPOSIX(void);
47 |
48 | #endif // _glfw3_posix_time_h_
49 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/posix_tls.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 POSIX - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2002-2006 Marcus Geelnard
5 | // Copyright (c) 2006-2016 Camilla Berglund
6 | //
7 | // This software is provided 'as-is', without any express or implied
8 | // warranty. In no event will the authors be held liable for any damages
9 | // arising from the use of this software.
10 | //
11 | // Permission is granted to anyone to use this software for any purpose,
12 | // including commercial applications, and to alter it and redistribute it
13 | // freely, subject to the following restrictions:
14 | //
15 | // 1. The origin of this software must not be misrepresented; you must not
16 | // claim that you wrote the original software. If you use this software
17 | // in a product, an acknowledgment in the product documentation would
18 | // be appreciated but is not required.
19 | //
20 | // 2. Altered source versions must be plainly marked as such, and must not
21 | // be misrepresented as being the original software.
22 | //
23 | // 3. This notice may not be removed or altered from any source
24 | // distribution.
25 | //
26 | //========================================================================
27 |
28 | #ifndef _glfw3_posix_tls_h_
29 | #define _glfw3_posix_tls_h_
30 |
31 | #include
32 |
33 | #define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsPOSIX posix_tls
34 |
35 |
36 | // POSIX-specific global TLS data
37 | //
38 | typedef struct _GLFWtlsPOSIX
39 | {
40 | GLFWbool allocated;
41 | pthread_key_t context;
42 |
43 | } _GLFWtlsPOSIX;
44 |
45 |
46 | GLFWbool _glfwInitThreadLocalStoragePOSIX(void);
47 | void _glfwTerminateThreadLocalStoragePOSIX(void);
48 |
49 | #endif // _glfw3_posix_tls_h_
50 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/win32_joystick.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 Win32 - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2006-2016 Camilla Berglund
5 | //
6 | // This software is provided 'as-is', without any express or implied
7 | // warranty. In no event will the authors be held liable for any damages
8 | // arising from the use of this software.
9 | //
10 | // Permission is granted to anyone to use this software for any purpose,
11 | // including commercial applications, and to alter it and redistribute it
12 | // freely, subject to the following restrictions:
13 | //
14 | // 1. The origin of this software must not be misrepresented; you must not
15 | // claim that you wrote the original software. If you use this software
16 | // in a product, an acknowledgment in the product documentation would
17 | // be appreciated but is not required.
18 | //
19 | // 2. Altered source versions must be plainly marked as such, and must not
20 | // be misrepresented as being the original software.
21 | //
22 | // 3. This notice may not be removed or altered from any source
23 | // distribution.
24 | //
25 | //========================================================================
26 |
27 | #ifndef _glfw3_win32_joystick_h_
28 | #define _glfw3_win32_joystick_h_
29 |
30 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \
31 | _GLFWjoystickWin32 win32_js[GLFW_JOYSTICK_LAST + 1]
32 |
33 | // Joystick element (axis, button or slider)
34 | //
35 | typedef struct _GLFWjoyobjectWin32
36 | {
37 | int offset;
38 | int type;
39 | } _GLFWjoyobjectWin32;
40 |
41 | // Win32-specific per-joystick data
42 | //
43 | typedef struct _GLFWjoystickWin32
44 | {
45 | GLFWbool present;
46 | float* axes;
47 | int axisCount;
48 | unsigned char* buttons;
49 | int buttonCount;
50 | _GLFWjoyobjectWin32* objects;
51 | int objectCount;
52 | char* name;
53 | IDirectInputDevice8W* device;
54 | DWORD index;
55 | GUID guid;
56 | } _GLFWjoystickWin32;
57 |
58 |
59 | void _glfwInitJoysticksWin32(void);
60 | void _glfwTerminateJoysticksWin32(void);
61 | void _glfwDetectJoystickConnectionWin32(void);
62 | void _glfwDetectJoystickDisconnectionWin32(void);
63 |
64 | #endif // _glfw3_win32_joystick_h_
65 |
--------------------------------------------------------------------------------
/SDK/support/GLFW/src/xkb_unicode.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | // GLFW 3.2 Linux - www.glfw.org
3 | //------------------------------------------------------------------------
4 | // Copyright (c) 2014 Jonas Ådahl
5 | //
6 | // This software is provided 'as-is', without any express or implied
7 | // warranty. In no event will the authors be held liable for any damages
8 | // arising from the use of this software.
9 | //
10 | // Permission is granted to anyone to use this software for any purpose,
11 | // including commercial applications, and to alter it and redistribute it
12 | // freely, subject to the following restrictions:
13 | //
14 | // 1. The origin of this software must not be misrepresented; you must not
15 | // claim that you wrote the original software. If you use this software
16 | // in a product, an acknowledgment in the product documentation would
17 | // be appreciated but is not required.
18 | //
19 | // 2. Altered source versions must be plainly marked as such, and must not
20 | // be misrepresented as being the original software.
21 | //
22 | // 3. This notice may not be removed or altered from any source
23 | // distribution.
24 | //
25 | //========================================================================
26 |
27 | #ifndef _glfw3_xkb_unicode_h_
28 | #define _glfw3_xkb_unicode_h_
29 |
30 |
31 | long _glfwKeySym2Unicode(unsigned int keysym);
32 |
33 | #endif // _glfw3_xkb_unicode_h_
34 |
--------------------------------------------------------------------------------
/SDK/support/imgui/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions
6 | # are met:
7 | # * Redistributions of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # * Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | # * Neither the name of NVIDIA CORPORATION nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | add_library( imgui STATIC
30 | imconfig.h
31 | imgui.cpp
32 | imgui_demo.cpp
33 | imgui_draw.cpp
34 | imgui.h
35 | imgui_impl_glfw.cpp
36 | imgui_impl_glfw.h
37 | imgui_impl_opengl3.cpp
38 | imgui_impl_opengl3.h
39 | imgui_internal.h
40 | imgui_widgets.cpp
41 | imstb_rectpack.h
42 | imstb_textedit.h
43 | imstb_truetype.h
44 | )
45 |
46 | target_include_directories( imgui
47 | INTERFACE ..
48 | PRIVATE . )
49 | target_compile_definitions( imgui PRIVATE IMGUI_IMPL_OPENGL_LOADER_GLAD )
50 | target_link_libraries( imgui glfw glad ${OPENGL_gl_LIBRARY})
51 |
--------------------------------------------------------------------------------
/SDK/support/imgui/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014-2019 Omar Cornut
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/SDK/support/imgui/imgui_impl_glfw.h:
--------------------------------------------------------------------------------
1 | // dear imgui: Platform Binding for GLFW
2 | // This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan..)
3 | // (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.)
4 |
5 | // Implemented features:
6 | // [X] Platform: Clipboard support.
7 | // [X] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
8 | // [x] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. FIXME: 3 cursors types are missing from GLFW.
9 | // [X] Platform: Keyboard arrays indexed using GLFW_KEY_* codes, e.g. ImGui::IsKeyPressed(GLFW_KEY_SPACE).
10 |
11 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
12 | // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp.
13 | // https://github.com/ocornut/imgui
14 |
15 | // About GLSL version:
16 | // The 'glsl_version' initialization parameter defaults to "#version 150" if NULL.
17 | // Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure!
18 |
19 | #pragma once
20 |
21 | struct GLFWwindow;
22 |
23 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks);
24 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks);
25 | IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown();
26 | IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame();
27 |
28 | // InitXXX function with 'install_callbacks=true': install GLFW callbacks. They will call user's previously installed callbacks, if any.
29 | // InitXXX function with 'install_callbacks=false': do not install GLFW callbacks. You will need to call them yourself from your own GLFW callbacks.
30 | IMGUI_IMPL_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
31 | IMGUI_IMPL_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
32 | IMGUI_IMPL_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
33 | IMGUI_IMPL_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c);
34 |
--------------------------------------------------------------------------------
/SDK/support/imgui/imgui_impl_opengl3.h:
--------------------------------------------------------------------------------
1 | // dear imgui: Renderer for modern OpenGL with shaders / programmatic pipeline
2 | // - Desktop GL: 3.x 4.x
3 | // - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0)
4 | // This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..)
5 |
6 | // Implemented features:
7 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp.
8 |
9 | // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
10 | // If you are new to dear imgui, read examples/README.txt and read the documentation at the top of imgui.cpp.
11 | // https://github.com/ocornut/imgui
12 |
13 | // About Desktop OpenGL function loaders:
14 | // Modern desktop OpenGL doesn't have a standard portable header file to load OpenGL function pointers.
15 | // Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
16 | // You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
17 |
18 | // About GLSL version:
19 | // The 'glsl_version' initialization parameter should be NULL (default) or a "#version XXX" string.
20 | // On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es"
21 | // Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp.
22 |
23 | #pragma once
24 |
25 | // Specific OpenGL versions
26 | //#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten
27 | //#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android
28 |
29 | // Set default OpenGL3 loader to be gl3w
30 | #if !defined(IMGUI_IMPL_OPENGL_LOADER_GL3W) \
31 | && !defined(IMGUI_IMPL_OPENGL_LOADER_GLEW) \
32 | && !defined(IMGUI_IMPL_OPENGL_LOADER_GLAD) \
33 | && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
34 | #define IMGUI_IMPL_OPENGL_LOADER_GL3W
35 | #endif
36 |
37 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
38 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
39 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame();
40 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
41 |
42 | // Called by Init/NewFrame/Shutdown
43 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture();
44 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture();
45 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects();
46 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
47 |
--------------------------------------------------------------------------------
/SDK/support/tinygltf/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Syoyo Fujita, Aurélien Chatelain and many contributors
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/SDK/sutil/Camera.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 |
30 | #include
31 | #include
32 |
33 | namespace sutil {
34 |
35 | void Camera::UVWFrame(float3& U, float3& V, float3& W) const
36 | {
37 | W = m_lookat - m_eye; // Do not normalize W -- it implies focal length
38 | float wlen = length(W);
39 | U = normalize(cross(W, m_up));
40 | V = normalize(cross(U, W));
41 |
42 | float vlen = wlen * tanf(0.5f * m_fovY * M_PIf / 180.0f);
43 | V *= vlen;
44 | float ulen = vlen * m_aspectRatio;
45 | U *= ulen;
46 | }
47 |
48 | } // namespace sutil
49 |
--------------------------------------------------------------------------------
/SDK/sutil/Frame.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | struct Frame {
7 | float time;
8 | float3 scale;
9 | float3 translate;
10 | float4 rotate;
11 | };
12 |
--------------------------------------------------------------------------------
/SDK/sutil/GLDisplay.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 |
30 |
31 | #pragma once
32 |
33 | #include
34 |
35 | #include
36 | #include
37 |
38 | #include
39 | #include
40 |
41 | namespace sutil
42 | {
43 |
44 | class GLDisplay
45 | {
46 | public:
47 | SUTILAPI GLDisplay(
48 | BufferImageFormat format = sutil::BufferImageFormat::UNSIGNED_BYTE4);
49 |
50 | SUTILAPI void display(
51 | const int32_t screen_res_x,
52 | const int32_t screen_res_y,
53 | const int32_t framebuf_res_x,
54 | const int32_t framebuf_res_y,
55 | const uint32_t pbo) const;
56 |
57 | private:
58 | GLuint m_render_tex = 0u;
59 | GLuint m_program = 0u;
60 | GLint m_render_tex_uniform_loc = -1;
61 | GLuint m_quad_vertex_buffer = 0;
62 |
63 | sutil::BufferImageFormat m_image_format;
64 |
65 | static const std::string s_vert_source;
66 | static const std::string s_frag_source;
67 | };
68 |
69 | } // end namespace sutil
70 |
--------------------------------------------------------------------------------
/SDK/sutil/Parallelogram.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | struct Parallelogram {
7 | float3 o;
8 | float3 u;
9 | float3 v;
10 | };
11 |
--------------------------------------------------------------------------------
/SDK/sutil/Preprocessor.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 |
29 |
30 | #pragma once
31 |
32 | #if defined(__CUDACC__) || defined(__CUDABE__)
33 | # define SUTIL_HOSTDEVICE __host__ __device__
34 | # define SUTIL_INLINE __forceinline__
35 | # define CONST_STATIC_INIT( ... )
36 | #else
37 | # define SUTIL_HOSTDEVICE
38 | # define SUTIL_INLINE inline
39 | # define CONST_STATIC_INIT( ... ) = __VA_ARGS__
40 | #endif
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/SDK/sutil/Record.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions
6 | // are met:
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above copyright
10 | // notice, this list of conditions and the following disclaimer in the
11 | // documentation and/or other materials provided with the distribution.
12 | // * Neither the name of NVIDIA CORPORATION nor the names of its
13 | // contributors may be used to endorse or promote products derived
14 | // from this software without specific prior written permission.
15 | //
16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
17 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 | // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | //
28 | #include
29 |
30 |
31 | namespace sutil
32 | {
33 |
34 | template
35 | struct Record
36 | {
37 | __align__( OPTIX_SBT_RECORD_ALIGNMENT ) char header[OPTIX_SBT_RECORD_HEADER_SIZE];
38 | T data;
39 | };
40 |
41 | struct EmptyData {};
42 |
43 | typedef Record EmptyRecord;
44 |
45 | } // end namespace sutil
46 |
--------------------------------------------------------------------------------
/doc/OptiX_API_Reference_7.2.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/doc/OptiX_API_Reference_7.2.0.pdf
--------------------------------------------------------------------------------
/doc/OptiX_EndUserLicense.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/doc/OptiX_EndUserLicense.pdf
--------------------------------------------------------------------------------
/doc/OptiX_Programming_Guide_7.2.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/meistdan/pmdas/3748be898b171caa09425ca41f644c0f0390b479/doc/OptiX_Programming_Guide_7.2.0.pdf
--------------------------------------------------------------------------------
/include/optix.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
4 | *
5 | * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6 | * rights in and to this software, related documentation and any modifications thereto.
7 | * Any use, reproduction, disclosure or distribution of this software and related
8 | * documentation without an express license agreement from NVIDIA Corporation is strictly
9 | * prohibited.
10 | *
11 | * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12 | * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13 | * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14 | * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15 | * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16 | * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17 | * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 | * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19 | * SUCH DAMAGES
20 | */
21 |
22 | /// @file
23 | /// @author NVIDIA Corporation
24 | /// @brief OptiX public API header
25 | ///
26 | /// Includes the host api if compiling host code, includes the cuda api if compiling device code.
27 | /// For the math library routines include optix_math.h
28 |
29 | #ifndef __optix_optix_h__
30 | #define __optix_optix_h__
31 |
32 | /// The OptiX version.
33 | ///
34 | /// - major = OPTIX_VERSION/10000
35 | /// - minor = (OPTIX_VERSION%10000)/100
36 | /// - micro = OPTIX_VERSION%100
37 | #define OPTIX_VERSION 70200
38 |
39 |
40 | #ifdef __CUDACC__
41 | #include "optix_device.h"
42 | #else
43 | #include "optix_host.h"
44 | #endif
45 |
46 |
47 | #endif // __optix_optix_h__
48 |
--------------------------------------------------------------------------------
/include/optix_device.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
4 | *
5 | * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6 | * rights in and to this software, related documentation and any modifications thereto.
7 | * Any use, reproduction, disclosure or distribution of this software and related
8 | * documentation without an express license agreement from NVIDIA Corporation is strictly
9 | * prohibited.
10 | *
11 | * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12 | * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13 | * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14 | * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15 | * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16 | * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17 | * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 | * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19 | * SUCH DAMAGES
20 | */
21 |
22 | /**
23 | * @file optix_device.h
24 | * @author NVIDIA Corporation
25 | * @brief OptiX public API
26 | *
27 | * OptiX public API Reference - Host/Device side
28 | */
29 |
30 | /******************************************************************************\
31 | * optix_cuda.h
32 | *
33 | * This file provides the nvcc interface for generating PTX that the OptiX is
34 | * capable of parsing and weaving into the final kernel. This is included by
35 | * optix.h automatically if compiling device code. It can be included explicitly
36 | * in host code if desired.
37 | *
38 | \******************************************************************************/
39 | #if !defined(__OPTIX_INCLUDE_INTERNAL_HEADERS__)
40 | # define __OPTIX_INCLUDE_INTERNAL_HEADERS__
41 | # define __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_DEVICE_H__
42 | #endif
43 | #include "optix_7_device.h"
44 | #if defined( __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_DEVICE_H__ )
45 | # undef __OPTIX_INCLUDE_INTERNAL_HEADERS__
46 | # undef __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_DEVICE_H__
47 | #endif
48 |
--------------------------------------------------------------------------------
/include/optix_function_table_definition.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
3 | *
4 | * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
5 | * rights in and to this software, related documentation and any modifications thereto.
6 | * Any use, reproduction, disclosure or distribution of this software and related
7 | * documentation without an express license agreement from NVIDIA Corporation is strictly
8 | * prohibited.
9 | *
10 | * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
11 | * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
12 | * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
13 | * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
14 | * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
15 | * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
16 | * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
17 | * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
18 | * SUCH DAMAGES
19 | */
20 |
21 | /// @file
22 | /// @author NVIDIA Corporation
23 | /// @brief OptiX public API header
24 |
25 | #ifndef __optix_optix_function_table_definition_h__
26 | #define __optix_optix_function_table_definition_h__
27 |
28 | #include "optix_function_table.h"
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | /** \addtogroup optix_function_table
35 | @{
36 | */
37 |
38 | /// If the stubs in optix_stubs.h are used, then the function table needs to be defined in exactly
39 | /// one translation unit. This can be achieved by including this header file in that translation
40 | /// unit.
41 | OptixFunctionTable g_optixFunctionTable;
42 |
43 | /*@}*/ // end group optix_function_table
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif
48 |
49 | #endif // __optix_optix_function_table_definition_h__
50 |
--------------------------------------------------------------------------------
/include/optix_host.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
4 | *
5 | * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6 | * rights in and to this software, related documentation and any modifications thereto.
7 | * Any use, reproduction, disclosure or distribution of this software and related
8 | * documentation without an express license agreement from NVIDIA Corporation is strictly
9 | * prohibited.
10 | *
11 | * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12 | * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13 | * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14 | * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15 | * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16 | * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17 | * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18 | * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19 | * SUCH DAMAGES
20 | */
21 |
22 | /**
23 | * @file optix_host.h
24 | * @author NVIDIA Corporation
25 | * @brief OptiX public API
26 | *
27 | * OptiX public API Reference - Host side
28 | */
29 |
30 | #if !defined(__OPTIX_INCLUDE_INTERNAL_HEADERS__)
31 | # define __OPTIX_INCLUDE_INTERNAL_HEADERS__
32 | # define __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_HOST_H__
33 | #endif
34 | #include "optix_7_host.h"
35 | #if defined( __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_HOST_H__ )
36 | # undef __OPTIX_INCLUDE_INTERNAL_HEADERS__
37 | # undef __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_HOST_H__
38 | #endif
39 |
--------------------------------------------------------------------------------
/include/optix_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
3 | *
4 | * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
5 | * rights in and to this software, related documentation and any modifications thereto.
6 | * Any use, reproduction, disclosure or distribution of this software and related
7 | * documentation without an express license agreement from NVIDIA Corporation is strictly
8 | * prohibited.
9 | *
10 | * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
11 | * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
12 | * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
13 | * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
14 | * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
15 | * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
16 | * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
17 | * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
18 | * SUCH DAMAGES
19 | */
20 |
21 | /**
22 | * @file optix_types.h
23 | * @author NVIDIA Corporation
24 | * @brief OptiX public API header
25 | *
26 | */
27 |
28 | #ifndef __optix_optix_types_h__
29 | #define __optix_optix_types_h__
30 |
31 | // clang-format off
32 | #if !defined(__OPTIX_INCLUDE_INTERNAL_HEADERS__)
33 | # define __OPTIX_INCLUDE_INTERNAL_HEADERS__
34 | # define __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_TYPES_H__
35 | #endif
36 | #include "optix_7_types.h"
37 | #if defined( __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_TYPES_H__ )
38 | # undef __OPTIX_INCLUDE_INTERNAL_HEADERS__
39 | # undef __UNDEF_OPTIX_INCLUDE_INTERNAL_HEADERS_OPTIX_TYPES_H__
40 | #endif
41 | // clang-format on
42 |
43 | #endif // #ifndef __optix_optix_types_h__
44 |
--------------------------------------------------------------------------------