├── .clang_complete ├── .dir-locals.el ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── cmake ├── FindOpenEXR.cmake └── Findassimp.cmake ├── external ├── ctpl_stl.h ├── halton_sampler.h ├── json │ ├── json-forwards.h │ └── json.h ├── jsoncpp.cpp └── stb_image.h ├── scenes ├── box1.json ├── box1 │ ├── box1.mtl │ └── box1.obj ├── box2.json ├── box2 │ ├── box2.mtl │ └── box2.obj ├── box3.json ├── box3 │ ├── box3.mtl │ └── box3.obj ├── box4.json ├── box4 │ ├── box4.mtl │ └── box4.obj ├── box5.json ├── box5 │ ├── box5.mtl │ └── box5.obj ├── box6.json ├── box6 │ ├── box6.mtl │ └── box6.obj ├── box7.json ├── box7 │ ├── box1.mtl │ └── box1.obj ├── box8.json ├── box8 │ ├── box8.mtl │ └── box8.obj ├── buddha.json ├── cb1.json ├── coffee.json ├── conference.json ├── cornell-box-spheres.json ├── cornell-box.json ├── cornell-box │ ├── CornellBox-Empty-CO.mtl │ ├── CornellBox-Empty-CO.obj │ ├── CornellBox-Empty-RG.mtl │ ├── CornellBox-Empty-RG.obj │ ├── CornellBox-Empty-Squashed.mtl │ ├── CornellBox-Empty-Squashed.obj │ ├── CornellBox-Empty-White.mtl │ ├── CornellBox-Empty-White.obj │ ├── CornellBox-Glossy.mtl │ ├── CornellBox-Glossy.obj │ ├── CornellBox-Mirror.mtl │ ├── CornellBox-Mirror.obj │ ├── CornellBox-Original.mtl │ ├── CornellBox-Original.obj │ ├── CornellBox-Sphere.mtl │ ├── CornellBox-Sphere.obj │ ├── CornellBox-Water.mtl │ ├── CornellBox-Water.obj │ ├── CornellBox │ │ ├── CornellBox-Empty-CO.mtl │ │ ├── CornellBox-Empty-CO.obj │ │ ├── CornellBox-Empty-RG.mtl │ │ ├── CornellBox-Empty-RG.obj │ │ ├── CornellBox-Empty-Squashed.mtl │ │ ├── CornellBox-Empty-Squashed.obj │ │ ├── CornellBox-Empty-White.mtl │ │ ├── CornellBox-Empty-White.obj │ │ ├── CornellBox-Glossy.mtl │ │ ├── CornellBox-Glossy.obj │ │ ├── CornellBox-Mirror.mtl │ │ ├── CornellBox-Mirror.obj │ │ ├── CornellBox-Original.mtl │ │ ├── CornellBox-Original.obj │ │ ├── CornellBox-Sphere.mtl │ │ ├── CornellBox-Sphere.obj │ │ ├── CornellBox-Water.mtl │ │ ├── CornellBox-Water.obj │ │ ├── copyright.txt │ │ ├── index.png │ │ ├── index.txt │ │ └── water.obj │ ├── copyright.txt │ ├── index.png │ ├── index.txt │ └── water.obj ├── cube.json ├── cube1.json ├── cube3-b.json ├── cube3.json ├── cube4.json ├── cube_flat.json ├── cubes │ ├── cube.mtl │ ├── cube.obj │ ├── cube1.mtl │ ├── cube1.obj │ ├── cube2.mtl │ ├── cube2.obj │ ├── cube3.mtl │ ├── cube3.obj │ ├── cube4.mtl │ ├── cube4.obj │ ├── cube_flat.mtl │ └── cube_flat.obj ├── dragon-sponza.json ├── envmap │ ├── cloudy1.hdr │ └── license.txt ├── floor.json ├── floor │ ├── bump2.png │ ├── bump3.png │ ├── floor.mtl │ ├── floor.obj │ ├── grid.png │ ├── grid.svg │ ├── grid2.png │ └── intensity.jpg ├── floor2.json ├── floor3.json ├── json │ └── sponza-global4.json ├── meshes │ └── sphere.obj ├── primitives1.json ├── rubiks-bump.json ├── rubiks-bump │ ├── bump.png │ ├── rubiks.mtl │ ├── rubiks.obj │ ├── rubiks.png │ └── rubiks.svg ├── rubiks-jpg │ ├── rubiks.jpg │ ├── rubiks.mtl │ ├── rubiks.obj │ └── rubiks.svg ├── rubiks.json ├── rubiks │ ├── rubiks.mtl │ ├── rubiks.obj │ ├── rubiks.png │ └── rubiks.svg ├── sibenik.json ├── sibenik │ ├── KAMEN-stup.png │ ├── copyright.txt │ ├── kamen-bump.png │ ├── kamen.png │ ├── mramor6x6-bump.png │ ├── mramor6x6.png │ ├── sibenik.mtl │ └── sibenik.obj ├── sibenik2.json ├── sibenik3.json ├── sponza-fixed │ ├── 00_skap.JPG │ ├── 01_STUB-bump.jpg │ ├── 01_STUB.JPG │ ├── 01_S_ba.JPG │ ├── 01_St_kp-bump.jpg │ ├── 01_St_kp.JPG │ ├── KAMEN-bump.jpg │ ├── KAMEN-stup.JPG │ ├── KAMEN.JPG │ ├── copyright.txt │ ├── prozor1.JPG │ ├── reljef-bump.jpg │ ├── reljef.JPG │ ├── sp_luk-bump.JPG │ ├── sp_luk.JPG │ ├── sponza.mtl │ ├── sponza.obj │ ├── vrata_ko.JPG │ ├── vrata_kr.JPG │ └── x01_st.JPG ├── sponza.json ├── sponza.rtc ├── sponza2.json ├── sponza3.json ├── sponza4.json ├── sponza4b.json ├── sponza4c.json ├── teapot.json └── teapots.json └── src ├── CMakeLists.txt ├── LRU.hpp ├── LTC ├── ltc.cpp ├── ltc.hpp ├── ltc_beckmann.cpp └── ltc_ggx.cpp ├── brdf.cpp ├── brdf.hpp ├── bxdf ├── bxdf.cpp └── bxdf.hpp ├── camera.cpp ├── camera.hpp ├── config.cpp ├── config.hpp ├── glm.cpp ├── glm.hpp ├── global_config.cpp ├── global_config.hpp ├── jsonutils.cpp ├── jsonutils.hpp ├── main.cpp ├── out.cpp ├── out.hpp ├── path_tracer.cpp ├── path_tracer.hpp ├── primitives.cpp ├── primitives.hpp ├── radiance.hpp ├── random_utils.hpp ├── ray.hpp ├── render_driver.cpp ├── render_driver.hpp ├── sampler.cpp ├── sampler.hpp ├── scene.cpp ├── scene.hpp ├── scene_intersect.cpp ├── stbi.cpp ├── stbi.hpp ├── texture.cpp ├── texture.hpp ├── tracer.cpp ├── tracer.hpp ├── utils.cpp └── utils.hpp /.clang_complete: -------------------------------------------------------------------------------- 1 | -I./external/ -------------------------------------------------------------------------------- /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ;;; Directory Local Variables 2 | ;;; For more information see (info "(emacs) Directory Variables") 3 | 4 | ((nil) 5 | (c++-mode 6 | (flycheck-gcc-language-standard . "c++11") 7 | (flycheck-clang-language-standard . "c++11") 8 | (eval progn 9 | (setq flycheck-clang-include-path 10 | (list 11 | (expand-file-name "./external/include/"))) 12 | (flycheck-select-checker 'c/c++-clang)))) 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # The build dir 2 | build 3 | outs 4 | out 5 | 6 | # Binaries 7 | *.so 8 | *.a 9 | 10 | # Temporary and backup files 11 | *~ 12 | *# 13 | .\#* 14 | 15 | # 3d model imports 16 | *.blender 17 | *.blend* 18 | 19 | # External models 20 | scenes/teapot 21 | scenes/conference 22 | scenes/dragon 23 | scenes/buddha 24 | scenes/dragon-sponza 25 | scenes/coffee -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0) 2 | 3 | set(PROJECT_NAME "RGKrt") 4 | set(EXECUTABLE_NAME ${PROJECT_NAME}) 5 | 6 | project( 7 | ${PROJECT_NAME} 8 | VERSION 1.0 9 | LANGUAGES CXX 10 | ) 11 | 12 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") 13 | 14 | include(FindPackageHandleStandardArgs) 15 | 16 | ## Assimp 17 | find_package(assimp REQUIRED) 18 | 19 | ## GLM 20 | set(GLM_FIND_REQUIRED TRUE) 21 | find_path( 22 | GLM_INCLUDE_DIRS "glm/glm.hpp" 23 | ) 24 | find_package_handle_standard_args( 25 | GLM 26 | DEFAULT_MSG 27 | GLM_INCLUDE_DIRS 28 | ) 29 | 30 | ## libpng, PNG++ 31 | find_package(PNG REQUIRED) 32 | set(png++_FIND_REQUIRED TRUE) 33 | find_path( 34 | png++_INCLUDE_DIRS 35 | NAMES "png++/color.hpp" "png++/png.hpp" 36 | ) 37 | find_package_handle_standard_args( 38 | png++ 39 | DEFAULT_MSG 40 | png++_INCLUDE_DIRS 41 | ) 42 | 43 | ## libjpeg 44 | find_package(JPEG REQUIRED) 45 | 46 | ## OpenEXR 47 | find_package(OpenEXR REQUIRED) 48 | 49 | 50 | add_subdirectory(src) 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Rafał Cieślak 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgement in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. -------------------------------------------------------------------------------- /cmake/FindOpenEXR.cmake: -------------------------------------------------------------------------------- 1 | # - Find OpenEXR library 2 | # Find the native OpenEXR includes and library 3 | # This module defines 4 | # OPENEXR_INCLUDE_DIRS, where to find ImfXdr.h, etc. Set when 5 | # OPENEXR_INCLUDE_DIR is found. 6 | # OPENEXR_LIBRARIES, libraries to link against to use OpenEXR. 7 | # OPENEXR_ROOT_DIR, The base directory to search for OpenEXR. 8 | # This can also be an environment variable. 9 | # OPENEXR_FOUND, If false, do not try to use OpenEXR. 10 | # 11 | # For individual library access these advanced settings are available 12 | # OPENEXR_HALF_LIBRARY, Path to Half library 13 | # OPENEXR_IEX_LIBRARY, Path to Half library 14 | # OPENEXR_ILMIMF_LIBRARY, Path to Ilmimf library 15 | # OPENEXR_ILMTHREAD_LIBRARY, Path to IlmThread library 16 | # OPENEXR_IMATH_LIBRARY, Path to Imath library 17 | # 18 | # also defined, but not for general use are 19 | # OPENEXR_LIBRARY, where to find the OpenEXR library. 20 | 21 | #============================================================================= 22 | # Copyright 2011 Blender Foundation. 23 | # 24 | # Distributed under the OSI-approved BSD License (the "License"); 25 | # see accompanying file Copyright.txt for details. 26 | # 27 | # This software is distributed WITHOUT ANY WARRANTY; without even the 28 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 29 | # See the License for more information. 30 | #============================================================================= 31 | 32 | # If OPENEXR_ROOT_DIR was defined in the environment, use it. 33 | IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "") 34 | SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR}) 35 | ENDIF() 36 | 37 | SET(_openexr_FIND_COMPONENTS 38 | Half 39 | Iex 40 | IlmImf 41 | IlmThread 42 | Imath 43 | ) 44 | 45 | SET(_openexr_SEARCH_DIRS 46 | ${OPENEXR_ROOT_DIR} 47 | /usr/local 48 | /sw # Fink 49 | /opt/local # DarwinPorts 50 | /opt/csw # Blastwave 51 | ) 52 | 53 | FIND_PATH(OPENEXR_INCLUDE_DIR 54 | NAMES 55 | OpenEXR/ImfXdr.h 56 | HINTS 57 | ${_openexr_SEARCH_DIRS} 58 | PATH_SUFFIXES 59 | include 60 | ) 61 | 62 | SET(_openexr_LIBRARIES) 63 | FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) 64 | STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) 65 | 66 | FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY 67 | NAMES 68 | ${COMPONENT} 69 | HINTS 70 | ${_openexr_SEARCH_DIRS} 71 | PATH_SUFFIXES 72 | lib64 lib 73 | ) 74 | LIST(APPEND _openexr_LIBRARIES "${OPENEXR_${UPPERCOMPONENT}_LIBRARY}") 75 | ENDFOREACH() 76 | 77 | # handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if 78 | # all listed variables are TRUE 79 | INCLUDE(FindPackageHandleStandardArgs) 80 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG 81 | _openexr_LIBRARIES OPENEXR_INCLUDE_DIR) 82 | 83 | IF(OPENEXR_FOUND) 84 | SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES}) 85 | # Both include paths are needed because of dummy OSL headers mixing #include and #include :( 86 | SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}/OpenEXR) 87 | ENDIF() 88 | 89 | MARK_AS_ADVANCED(OPENEXR_INCLUDE_DIR) 90 | FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) 91 | STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) 92 | MARK_AS_ADVANCED(OPENEXR_${UPPERCOMPONENT}_LIBRARY) 93 | ENDFOREACH() 94 | -------------------------------------------------------------------------------- /cmake/Findassimp.cmake: -------------------------------------------------------------------------------- 1 | if(CMAKE_SIZEOF_VOID_P EQUAL 8) 2 | set(ASSIMP_ARCHITECTURE "64") 3 | elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) 4 | set(ASSIMP_ARCHITECTURE "32") 5 | endif(CMAKE_SIZEOF_VOID_P EQUAL 8) 6 | 7 | if(WIN32) 8 | set(ASSIMP_ROOT_DIR CACHE PATH "ASSIMP root directory") 9 | 10 | # Find path of each library 11 | find_path(ASSIMP_INCLUDE_DIR 12 | NAMES 13 | assimp/anim.h 14 | HINTS 15 | ${ASSIMP_ROOT_DIR}/include 16 | ) 17 | 18 | if(MSVC12) 19 | set(ASSIMP_MSVC_VERSION "vc120") 20 | elseif(MSVC14) 21 | set(ASSIMP_MSVC_VERSION "vc140") 22 | endif(MSVC12) 23 | 24 | if(MSVC12 OR MSVC14) 25 | 26 | find_path(ASSIMP_LIBRARY_DIR 27 | NAMES 28 | assimp-${ASSIMP_MSVC_VERSION}-mt.lib 29 | HINTS 30 | ${ASSIMP_ROOT_DIR}/lib${ASSIMP_ARCHITECTURE} 31 | ) 32 | 33 | find_library(ASSIMP_LIBRARY_RELEASE assimp-${ASSIMP_MSVC_VERSION}-mt.lib PATHS ${ASSIMP_LIBRARY_DIR}) 34 | find_library(ASSIMP_LIBRARY_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mtd.lib PATHS ${ASSIMP_LIBRARY_DIR}) 35 | 36 | set(ASSIMP_LIBRARY 37 | optimized ${ASSIMP_LIBRARY_RELEASE} 38 | debug ${ASSIMP_LIBRARY_DEBUG} 39 | ) 40 | 41 | set(ASSIMP_LIBRARIES "ASSIMP_LIBRARY_RELEASE" "ASSIMP_LIBRARY_DEBUG") 42 | 43 | FUNCTION(ASSIMP_COPY_BINARIES TargetDirectory) 44 | ADD_CUSTOM_TARGET(AssimpCopyBinaries 45 | COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll ${TargetDirectory}/Debug/assimp-${ASSIMP_MSVC_VERSION}-mtd.dll 46 | COMMAND ${CMAKE_COMMAND} -E copy ${ASSIMP_ROOT_DIR}/bin${ASSIMP_ARCHITECTURE}/assimp-${ASSIMP_MSVC_VERSION}-mt.dll ${TargetDirectory}/Release/assimp-${ASSIMP_MSVC_VERSION}-mt.dll 47 | COMMENT "Copying Assimp binaries to '${TargetDirectory}'" 48 | VERBATIM) 49 | ENDFUNCTION(ASSIMP_COPY_BINARIES) 50 | 51 | endif() 52 | 53 | else(WIN32) 54 | find_path( 55 | assimp_INCLUDE_DIRS 56 | NAME assimp/scene.h 57 | HINTS /opt/assimp/include/ /usr/include/ /usr/local/include/ 58 | ) 59 | 60 | find_library( 61 | assimp_LIBRARIES 62 | NAMES assimp 63 | HINTS /opt/assimp/lib/ /usr/local/lib/ /lib/ /usr/lib/ 64 | ) 65 | 66 | if (assimp_INCLUDE_DIRS AND assimp_LIBRARIES) 67 | SET(assimp_FOUND TRUE) 68 | ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES) 69 | 70 | if (assimp_FOUND) 71 | if (NOT assimp_FIND_QUIETLY) 72 | message(STATUS "Found asset importer library: ${assimp_LIBRARIES}") 73 | endif (NOT assimp_FIND_QUIETLY) 74 | else (assimp_FOUND) 75 | if (assimp_FIND_REQUIRED) 76 | message(FATAL_ERROR "Could not find asset importer library") 77 | endif (assimp_FIND_REQUIRED) 78 | endif (assimp_FOUND) 79 | 80 | endif(WIN32) -------------------------------------------------------------------------------- /scenes/box1.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box1/box1.obj", 3 | "output-file": "box1.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera" : { 7 | "position": [0.0, 0.0, 4.0], 8 | "lookat": [0.0, 0.0, 0.0], 9 | "focal": 1.6 10 | }, 11 | "lights" : [{ 12 | "position": [0.0, 2.5, 1.0], 13 | "intensity": 1.0, 14 | "size": 0.5 15 | }], 16 | "multisample": 40, 17 | "rounds": 20, 18 | "clamp": 20.0, 19 | "russian": 0.75, 20 | "brdf": "cooktorr" 21 | } 22 | -------------------------------------------------------------------------------- /scenes/box1/box1.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box1.blend' 2 | # Material Count: 5 3 | 4 | newmtl ball1 5 | Ns 120.0 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.286638 0.640000 0.359819 8 | Ks 1.000000 1.000000 1.000000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.400000 11 | d 1.000000 12 | illum 2 13 | 14 | newmtl cyll 15 | Ns 96.078431 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.640000 0.619458 0.246705 18 | Ks 1.000000 0.000000 0.900000 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.500000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl wall-blue 25 | Ns 96.078431 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.401621 0.485190 1.000000 28 | Ks 0.500000 0.500000 0.500000 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.000000 31 | d 1.000000 32 | illum 2 33 | 34 | newmtl wall-red 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 1.000000 0.418849 0.401621 38 | Ks 0.500000 0.500000 0.500000 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.000000 41 | d 1.000000 42 | illum 2 43 | 44 | newmtl wall-white 45 | Ns 20.725490 46 | Ka 1.000000 1.000000 1.000000 47 | Kd 0.834409 0.834409 0.834409 48 | Ks 0.026506 0.026506 0.026506 49 | Ke 0.000000 0.000000 0.000000 50 | Ni 1.450000 51 | d 1.000000 52 | illum 2 53 | -------------------------------------------------------------------------------- /scenes/box2.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box2/box2.obj", 3 | "output-file": "box2.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera" : { 8 | "position": [0.0, 0.0, 4.9], 9 | "lookat": [0.0, 0.0, 0.0], 10 | "focal": 1.25 11 | }, 12 | "lights" : [{ 13 | "position": [0.0, 2.5, 1.0], 14 | "intensity": 10.0, 15 | "size": 0.5 16 | }], 17 | "multisample": 240, 18 | "rounds": 5, 19 | "clamp": 2.0, 20 | "russian": 0.6, 21 | "reverse": 4, 22 | "brdf": "cooktorr" 23 | } 24 | -------------------------------------------------------------------------------- /scenes/box2/box2.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box2.blend' 2 | # Material Count: 6 3 | 4 | newmtl ball1.001 5 | Ns 200.509804 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.555573 0.90968 0.615254 8 | Ks 0.200000 0.200000 0.200000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.400000 11 | d 0.056022 12 | illum 9 13 | 14 | newmtl ball1_refl 15 | Ns 500.0 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.367118 0.277278 0.340000 18 | Ks 0.900000 0.900000 0.900000 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.450000 21 | d 1.000000 22 | illum 1 23 | 24 | newmtl wall-blue 25 | Ns 96.078431 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.401621 0.485190 1.000000 28 | Ks 0.500000 0.500000 0.900000 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.000000 31 | d 1.000000 32 | illum 2 33 | 34 | newmtl wall-red 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 1.000000 0.418849 0.401621 38 | Ks 0.900000 0.500000 0.500000 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.000000 41 | d 1.000000 42 | illum 2 43 | 44 | newmtl wall-white 45 | Ns 50.725490 46 | Ka 1.000000 1.000000 1.000000 47 | Kd 0.834409 0.834409 0.834409 48 | Ks 0.895906 0.896506 0.896506 49 | Ke 0.000000 0.000000 0.000000 50 | Ni 1.000000 51 | d 1.000000 52 | illum 2 53 | 54 | newmtl wall-white-back 55 | Ns 50.725490 56 | Ka 1.000000 1.000000 1.000000 57 | Kd 0.634409 0.634409 0.634409 58 | Ks 0.996506 0.996506 0.996506 59 | Ke 0.000000 0.000000 0.000000 60 | Ni 1.00000 61 | d 1.000000 62 | illum 2 63 | -------------------------------------------------------------------------------- /scenes/box3.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box3/box3.obj", 3 | "output-file": "box3.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera" : { 8 | "position": [7.0, -1.0, 4.0], 9 | "lookat": [0.0, 0.0, 0.0], 10 | "focal": 1.1 11 | }, 12 | "lights" : [{ 13 | "position": [0.0, 0.0, -2.0], 14 | "intensity": 5.0, 15 | "size": 0.4 16 | }], 17 | "multisample": 40, 18 | "rounds": 20, 19 | "clamp": 5.0, 20 | "russian": 0.6 21 | } 22 | -------------------------------------------------------------------------------- /scenes/box3/box3.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box3.blend' 2 | # Material Count: 4 3 | 4 | newmtl Materialglass_red 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.800000 0.000000 0.001124 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.500000 11 | d 0.200000 12 | illum 9 13 | 14 | newmtl box 15 | Ns 11.764706 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.640000 0.640000 0.640000 18 | Ks 0.209677 0.209677 0.209677 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl glass_blue 25 | Ns 96.078431 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.000536 0.000000 0.800000 28 | Ks 0.500000 0.500000 0.500000 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.500000 31 | d 0.200000 32 | illum 9 33 | 34 | newmtl glass_green 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 0.000000 1.000000 0.003777 38 | Ks 0.500000 0.500000 0.500000 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.500000 41 | d 0.010000 42 | illum 9 43 | -------------------------------------------------------------------------------- /scenes/box3/box3.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.76 (sub 0) OBJ File: 'box3.blend' 2 | # www.blender.org 3 | mtllib box3.mtl 4 | o Cube.001_Cube.004 5 | v -1.000000 -1.000000 0.050000 6 | v -1.000000 1.000000 0.050000 7 | v -1.000000 -1.000000 -0.050000 8 | v -1.000000 1.000000 -0.050000 9 | v -0.500000 -1.000000 0.050000 10 | v -0.500000 1.000000 0.050000 11 | v -0.500000 -1.000000 -0.050000 12 | v -0.500000 1.000000 -0.050000 13 | vn -1.000000 0.000000 0.000000 14 | vn 0.000000 0.000000 -1.000000 15 | vn 1.000000 0.000000 0.000000 16 | vn 0.000000 0.000000 1.000000 17 | vn 0.000000 -1.000000 0.000000 18 | vn 0.000000 1.000000 0.000000 19 | usemtl glass_green 20 | s off 21 | f 2//1 4//1 3//1 1//1 22 | f 4//2 8//2 7//2 3//2 23 | f 8//3 6//3 5//3 7//3 24 | f 6//4 2//4 1//4 5//4 25 | f 1//5 3//5 7//5 5//5 26 | f 6//6 8//6 4//6 2//6 27 | o Cube_Cube.001 28 | v -1.000000 -3.000000 3.000000 29 | v -1.000000 3.000000 3.000000 30 | v -1.000000 -3.000000 -3.000000 31 | v -1.000000 3.000000 -3.000000 32 | v 1.000000 -3.000000 3.000000 33 | v 1.000000 3.000000 3.000000 34 | v 1.000000 -3.000000 -3.000000 35 | v 1.000000 3.000000 -3.000000 36 | vn 1.000000 0.000000 0.000000 37 | vn 0.000000 0.000000 1.000000 38 | vn 0.000000 0.000000 -1.000000 39 | vn 0.000000 1.000000 0.000000 40 | vn 0.000000 -1.000000 0.000000 41 | usemtl box 42 | s off 43 | f 10//7 9//7 11//7 12//7 44 | f 12//8 11//8 15//8 16//8 45 | f 14//9 13//9 9//9 10//9 46 | f 9//10 13//10 15//10 11//10 47 | f 14//11 10//11 12//11 16//11 48 | o Cube.002_Cube.005 49 | v -1.000000 -3.000000 0.050000 50 | v -1.000000 -1.000000 0.050000 51 | v -1.000000 -3.000000 -0.050000 52 | v -1.000000 -1.000000 -0.050000 53 | v -0.500000 -3.000000 0.050000 54 | v -0.500000 -1.000000 0.050000 55 | v -0.500000 -3.000000 -0.050000 56 | v -0.500000 -1.000000 -0.050000 57 | vn -1.000000 0.000000 0.000000 58 | vn 0.000000 0.000000 -1.000000 59 | vn 1.000000 0.000000 0.000000 60 | vn 0.000000 0.000000 1.000000 61 | vn 0.000000 -1.000000 0.000000 62 | vn 0.000000 1.000000 0.000000 63 | usemtl Materialglass_red 64 | s off 65 | f 18//12 20//12 19//12 17//12 66 | f 20//13 24//13 23//13 19//13 67 | f 24//14 22//14 21//14 23//14 68 | f 22//15 18//15 17//15 21//15 69 | f 17//16 19//16 23//16 21//16 70 | f 22//17 24//17 20//17 18//17 71 | o Cube.003_Cube.006 72 | v -1.000000 1.000000 0.050000 73 | v -1.000000 3.000000 0.050000 74 | v -1.000000 1.000000 -0.050000 75 | v -1.000000 3.000000 -0.050000 76 | v -0.500000 1.000000 0.050000 77 | v -0.500000 3.000000 0.050000 78 | v -0.500000 1.000000 -0.050000 79 | v -0.500000 3.000000 -0.050000 80 | vn -1.000000 0.000000 0.000000 81 | vn 0.000000 0.000000 -1.000000 82 | vn 1.000000 0.000000 0.000000 83 | vn 0.000000 0.000000 1.000000 84 | vn 0.000000 -1.000000 0.000000 85 | vn 0.000000 1.000000 0.000000 86 | usemtl glass_blue 87 | s off 88 | f 26//18 28//18 27//18 25//18 89 | f 28//19 32//19 31//19 27//19 90 | f 32//20 30//20 29//20 31//20 91 | f 30//21 26//21 25//21 29//21 92 | f 25//22 27//22 31//22 29//22 93 | f 30//23 32//23 28//23 26//23 94 | -------------------------------------------------------------------------------- /scenes/box4.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box4/box4.obj", 3 | "output-file": "box4.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera" : { 8 | "position": [0.0, 0.0, 4.5], 9 | "lookat": [0.0, 0.0, 0.0], 10 | "focal": 1.2 11 | }, 12 | "multisample": 400, 13 | "rounds": 4, 14 | "clamp": 2.0, 15 | "russian": 0.7, 16 | "brdf": "ltc_beckmann" 17 | } 18 | -------------------------------------------------------------------------------- /scenes/box4/box4.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box4.blend' 2 | # Material Count: 9 3 | 4 | newmtl ball 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.217365 0.640000 0.132124 8 | Ks 0.069892 0.069892 0.069892 9 | Ke 0.184760 0.544000 0.112305 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | 14 | newmtl box1 15 | Ns 29.411765 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.193881 0.818284 0.950538 18 | Ks 0.672043 0.672043 0.672043 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl box_small 25 | Ns 96.078431 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.614148 0.629919 0.206994 28 | Ks 0.500000 0.500000 0.500000 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.000000 31 | d 1.000000 32 | illum 2 33 | 34 | newmtl cyll 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 0.230638 0.230638 0.230638 38 | Ks 0.500000 0.500000 0.500000 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.000000 41 | d 1.000000 42 | illum 2 43 | 44 | newmtl light_top 45 | Ns 96.078431 46 | Ka 1.000000 1.000000 1.000000 47 | Kd 0.794839 0.794839 0.794839 48 | Ks 0.500000 0.500000 0.500000 49 | Ke 0.648000 0.648000 0.648000 50 | Ni 1.000000 51 | d 1.000000 52 | illum 2 53 | 54 | newmtl torus 55 | Ns 96.078431 56 | Ka 1.000000 1.000000 1.000000 57 | Kd 0.800000 0.090789 0.365903 58 | Ks 0.500000 0.500000 0.500000 59 | Ke 0.000000 0.000000 0.000000 60 | Ni 1.000000 61 | d 1.000000 62 | illum 2 63 | 64 | newmtl wall_green 65 | Ns 168.627451 66 | Ka 1.000000 1.000000 1.000000 67 | Kd 0.379197 0.763076 0.415406 68 | Ks 0.147660 0.147660 0.147660 69 | Ke 0.000000 0.000000 0.000000 70 | Ni 1.000000 71 | d 1.000000 72 | illum 2 73 | 74 | newmtl wall_red 75 | Ns 188.235294 76 | Ka 1.000000 1.000000 1.000000 77 | Kd 0.904585 0.314807 0.287216 78 | Ks 0.188574 0.188574 0.188574 79 | Ke 0.000000 0.000000 0.000000 80 | Ni 1.000000 81 | d 1.000000 82 | illum 2 83 | 84 | newmtl wall_white 85 | Ns 96.078431 86 | Ka 1.000000 1.000000 1.000000 87 | Kd 0.663291 0.663291 0.663291 88 | Ks 0.089926 0.089926 0.089926 89 | Ke 0.000000 0.000000 0.000000 90 | Ni 1.000000 91 | d 1.000000 92 | illum 2 93 | -------------------------------------------------------------------------------- /scenes/box5.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box5/box5.obj", 3 | "output-file": "box5.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera" : { 8 | "position": [0.0, 0.0, 4.5], 9 | "lookat": [0.0, 0.0, 0.0], 10 | "focal": 1.2 11 | }, 12 | "multisample": 40, 13 | "rounds": 40, 14 | "clamp": 5.0, 15 | "russian": 0.7 16 | } 17 | -------------------------------------------------------------------------------- /scenes/box5/box5.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box5.blend' 2 | # Material Count: 11 3 | 4 | newmtl Material 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.269252 0.360270 0.405654 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | 14 | newmtl ball 15 | Ns 96.078431 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.217365 0.640000 0.132124 18 | Ks 0.069892 0.069892 0.069892 19 | Ke 0.184760 0.544000 0.112305 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl box1 25 | Ns 29.411765 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.193881 0.818284 0.950538 28 | Ks 0.672043 0.672043 0.672043 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.000000 31 | d 1.000000 32 | illum 2 33 | 34 | newmtl box_small 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 0.614148 0.629919 0.206994 38 | Ks 0.500000 0.500000 0.500000 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.000000 41 | d 1.000000 42 | illum 2 43 | 44 | newmtl cyll 45 | Ns 96.078431 46 | Ka 1.000000 1.000000 1.000000 47 | Kd 0.230638 0.230638 0.230638 48 | Ks 0.500000 0.500000 0.500000 49 | Ke 0.000000 0.000000 0.000000 50 | Ni 1.000000 51 | d 1.000000 52 | illum 2 53 | 54 | newmtl light_top 55 | Ns 96.078431 56 | Ka 1.000000 1.000000 1.000000 57 | Kd 0.794839 0.794839 0.794839 58 | Ks 0.500000 0.500000 0.500000 59 | Ke 0.648000 0.648000 0.648000 60 | Ni 1.000000 61 | d 1.000000 62 | illum 2 63 | 64 | newmtl suzanne 65 | Ns 96.078431 66 | Ka 1.000000 1.000000 1.000000 67 | Kd 0.640000 0.640000 0.640000 68 | Ks 0.500000 0.500000 0.500000 69 | Ke 0.000000 0.000000 0.000000 70 | Ni 1.500000 71 | d 0.075472 72 | illum 9 73 | 74 | newmtl torus 75 | Ns 96.078431 76 | Ka 1.000000 1.000000 1.000000 77 | Kd 0.651233 0.075202 0.299218 78 | Ks 0.500000 0.500000 0.500000 79 | Ke 0.000000 0.000000 0.000000 80 | Ni 1.000000 81 | d 1.000000 82 | illum 2 83 | 84 | newmtl wall_green 85 | Ns 168.627451 86 | Ka 1.000000 1.000000 1.000000 87 | Kd 0.379197 0.763076 0.415406 88 | Ks 0.358186 0.358186 0.358186 89 | Ke 0.000000 0.000000 0.000000 90 | Ni 1.000000 91 | d 1.000000 92 | illum 2 93 | 94 | newmtl wall_red 95 | Ns 188.235294 96 | Ka 1.000000 1.000000 1.000000 97 | Kd 0.904585 0.314807 0.287216 98 | Ks 0.641205 0.641205 0.641205 99 | Ke 0.000000 0.000000 0.000000 100 | Ni 1.000000 101 | d 1.000000 102 | illum 2 103 | 104 | newmtl wall_white 105 | Ns 96.078431 106 | Ka 1.000000 1.000000 1.000000 107 | Kd 0.663291 0.663291 0.663291 108 | Ks 0.521505 0.521505 0.521505 109 | Ke 0.000000 0.000000 0.000000 110 | Ni 1.000000 111 | d 1.000000 112 | illum 2 113 | -------------------------------------------------------------------------------- /scenes/box6.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box6/box6.obj", 3 | "output-file": "box6.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera" : { 8 | "position": [0.0, 0.0, 4.5], 9 | "lookat": [0.0, 0.0, 0.0], 10 | "focal": 1.2 11 | }, 12 | "multisample": 40, 13 | "rounds": 60, 14 | "clamp": 5.0, 15 | "russian": 0.7, 16 | "reverse": 3, 17 | "brdf": "ltc_ggx" 18 | } 19 | -------------------------------------------------------------------------------- /scenes/box6/box6.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box6.blend' 2 | # Material Count: 12 3 | 4 | newmtl Default 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.500000 11 | d 0.150943 12 | illum 9 13 | 14 | newmtl Material 15 | Ns 96.078431 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.269252 0.360270 0.405654 18 | Ks 0.500000 0.500000 0.500000 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl ball 25 | Ns 96.078431 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.217365 0.640000 0.132124 28 | Ks 0.069892 0.069892 0.069892 29 | Ke 0.184760 0.544000 0.112305 30 | Ni 1.000000 31 | d 1.000000 32 | illum 2 33 | 34 | newmtl box1 35 | Ns 29.411765 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 0.193881 0.818284 0.950538 38 | Ks 0.672043 0.672043 0.672043 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.000000 41 | d 1.000000 42 | illum 2 43 | 44 | newmtl box_small 45 | Ns 96.078431 46 | Ka 1.000000 1.000000 1.000000 47 | Kd 0.614148 0.629919 0.206994 48 | Ks 0.500000 0.500000 0.500000 49 | Ke 0.000000 0.000000 0.000000 50 | Ni 1.000000 51 | d 1.000000 52 | illum 2 53 | 54 | newmtl cyll 55 | Ns 96.078431 56 | Ka 1.000000 1.000000 1.000000 57 | Kd 0.230638 0.230638 0.230638 58 | Ks 0.500000 0.500000 0.500000 59 | Ke 0.000000 0.000000 0.000000 60 | Ni 1.000000 61 | d 1.000000 62 | illum 2 63 | 64 | newmtl default 65 | Ns 9.803922 66 | Ka 1.000000 1.000000 1.000000 67 | Kd 1.000000 1.000000 1.000000 68 | Ks 0.200000 0.200000 0.200000 69 | Ke 0.000000 0.000000 0.000000 70 | Ni 1.500000 71 | d 0.169811 72 | illum 9 73 | map_Kd /home/cielak/Programy/RGK/obj/teapot/default.png 74 | 75 | newmtl light_top 76 | Ns 96.078431 77 | Ka 1.000000 1.000000 1.000000 78 | Kd 0.794839 0.794839 0.794839 79 | Ks 0.500000 0.500000 0.500000 80 | Ke 0.648000 0.648000 0.648000 81 | Ni 1.000000 82 | d 1.000000 83 | illum 2 84 | 85 | newmtl torus 86 | Ns 96.078431 87 | Ka 1.000000 1.000000 1.000000 88 | Kd 0.588527 0.068579 0.271052 89 | Ks 0.500000 0.500000 0.500000 90 | Ke 0.000000 0.000000 0.000000 91 | Ni 1.000000 92 | d 1.000000 93 | illum 2 94 | 95 | newmtl wall_green 96 | Ns 168.627451 97 | Ka 1.000000 1.000000 1.000000 98 | Kd 0.379197 0.763076 0.415406 99 | Ks 0.358186 0.358186 0.358186 100 | Ke 0.000000 0.000000 0.000000 101 | Ni 1.000000 102 | d 1.000000 103 | illum 2 104 | 105 | newmtl wall_red 106 | Ns 188.235294 107 | Ka 1.000000 1.000000 1.000000 108 | Kd 0.904585 0.314807 0.287216 109 | Ks 0.641205 0.641205 0.641205 110 | Ke 0.000000 0.000000 0.000000 111 | Ni 1.000000 112 | d 1.000000 113 | illum 2 114 | 115 | newmtl wall_white 116 | Ns 96.078431 117 | Ka 1.000000 1.000000 1.000000 118 | Kd 0.663291 0.663291 0.663291 119 | Ks 0.521505 0.521505 0.521505 120 | Ke 0.000000 0.000000 0.000000 121 | Ni 1.000000 122 | d 1.000000 123 | illum 2 124 | -------------------------------------------------------------------------------- /scenes/box7.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box7/box1.obj", 3 | "output-file": "box7.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 3, 7 | "camera" : { 8 | "position": [0.0, 0.0, 4.0], 9 | "lookat": [0.0, 0.0, 0.0], 10 | "focal": 1.6 11 | }, 12 | "lights": [{ 13 | "position": [0.0, 2.7, -1.5], 14 | "intensity": 10.0 15 | }], 16 | "multisample": 40, 17 | "rounds": 20, 18 | "clamp": 3.0, 19 | "russian": 0.75, 20 | "reverse": 4 21 | } 22 | -------------------------------------------------------------------------------- /scenes/box7/box1.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box1.blend' 2 | # Material Count: 6 3 | 4 | newmtl Material 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.468692 0.984885 0.304864 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | 14 | newmtl ball1 15 | Ns 96.078431 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.286638 0.640000 0.359819 18 | Ks 0.500000 0.500000 0.500000 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl cyll 25 | Ns 96.078431 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.640000 0.619458 0.246705 28 | Ks 0.500000 0.500000 0.500000 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.000000 31 | d 1.000000 32 | illum 2 33 | 34 | newmtl wall-blue 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 0.401621 0.485190 1.000000 38 | Ks 0.500000 0.500000 0.500000 39 | Ke 0.000000 0.000000 0.000000 40 | Ni 1.000000 41 | d 1.000000 42 | illum 2 43 | 44 | newmtl wall-red 45 | Ns 96.078431 46 | Ka 1.000000 1.000000 1.000000 47 | Kd 1.000000 0.418849 0.401621 48 | Ks 0.500000 0.500000 0.500000 49 | Ke 0.000000 0.000000 0.000000 50 | Ni 1.000000 51 | d 1.000000 52 | illum 2 53 | 54 | newmtl wall-white 55 | Ns 13.725490 56 | Ka 1.000000 1.000000 1.000000 57 | Kd 0.634409 0.634409 0.634409 58 | Ks 0.126506 0.126506 0.126506 59 | Ke 0.000000 0.000000 0.000000 60 | Ni 1.000000 61 | d 1.000000 62 | illum 2 63 | -------------------------------------------------------------------------------- /scenes/box8.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "box8/box8.obj", 3 | "output-file": "box8.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera" : { 8 | "position": [0.0, 0.0, 7.8], 9 | "lookat": [0.0, 0.0, 0.0], 10 | "focal": 1.0 11 | }, 12 | "multisample": 40, 13 | "rounds": 40, 14 | "clamp": 5.0, 15 | "russian": 0.7, 16 | "reverse": 2, 17 | "brdf": "diffuse" 18 | } 19 | -------------------------------------------------------------------------------- /scenes/box8/box8.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'box8.blend' 2 | # Material Count: 8 3 | 4 | newmtl Material.002 5 | Ns 1000.000000 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.546014 0.800000 0.709120 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.500000 11 | d 0.094340 12 | illum 9 13 | 14 | newmtl Material.004 15 | Ns 1000.000000 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.379298 0.444169 0.800000 18 | Ks 0.500000 0.500000 0.500000 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.500000 21 | d 0.094340 22 | illum 9 23 | 24 | newmtl Material.005 25 | Ns 1000.000000 26 | Ka 1.000000 1.000000 1.000000 27 | Kd 0.602264 0.602264 0.602264 28 | Ks 0.433962 0.433962 0.433962 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.500000 31 | d 0.056604 32 | illum 9 33 | 34 | newmtl Material.006 35 | Ns 96.078431 36 | Ka 1.000000 1.000000 1.000000 37 | Kd 0.771461 0.800000 0.034127 38 | Ks 0.000000 0.000000 0.000000 39 | Ke 0.648027 0.672000 0.028666 40 | Ni 1.000000 41 | d 1.000000 42 | illum 1 43 | 44 | newmtl light_top 45 | Ns 96.078431 46 | Ka 1.000000 1.000000 1.000000 47 | Kd 0.794839 0.794839 0.794839 48 | Ks 0.500000 0.500000 0.500000 49 | Ke 0.648000 0.648000 0.648000 50 | Ni 1.000000 51 | d 1.000000 52 | illum 2 53 | 54 | newmtl wall_green 55 | Ns 125.490196 56 | Ka 1.000000 1.000000 1.000000 57 | Kd 0.379197 0.763076 0.415406 58 | Ks 0.074267 0.103469 0.068117 59 | Ke 0.000000 0.000000 0.000000 60 | Ni 1.000000 61 | d 1.000000 62 | illum 2 63 | 64 | newmtl wall_red 65 | Ns 80.392157 66 | Ka 1.000000 1.000000 1.000000 67 | Kd 0.904585 0.314807 0.287216 68 | Ks 0.216298 0.140059 0.112267 69 | Ke 0.000000 0.000000 0.000000 70 | Ni 1.000000 71 | d 1.000000 72 | illum 2 73 | 74 | newmtl wall_white 75 | Ns 54.901961 76 | Ka 1.000000 1.000000 1.000000 77 | Kd 0.663291 0.663291 0.663291 78 | Ks 0.200751 0.200751 0.200751 79 | Ke 0.000000 0.000000 0.000000 80 | Ni 1.000000 81 | d 1.000000 82 | illum 2 83 | -------------------------------------------------------------------------------- /scenes/buddha.json: -------------------------------------------------------------------------------- 1 | { 2 | // The buddha model can be downloaded from http://graphics.cs.williams.edu/data/meshes.xml 3 | "model-file": "buddha/buddha.obj", 4 | "output-file": "buddha.exr", 5 | "output-width": 1200, 6 | "output-height": 900, 7 | "recursion-max": 2, 8 | "camera" : { 9 | "position": [-0.3, 0.3, -0.7], 10 | "lookat": [0.0, 0.1, 0.0], 11 | "focal": 1.6 12 | }, 13 | "lights": [{ 14 | "position": [1.0, 5.0, -5.0], 15 | "color255": [255, 240, 240], 16 | "intensity": 400.0 17 | }], 18 | "multisample": 500 19 | } 20 | -------------------------------------------------------------------------------- /scenes/cb1.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cornell-box/CornellBox-Sphere.obj", 3 | "output-file": "cb1.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 2, 7 | "camera": { 8 | "position": [0.0, 0.8, 2.5], 9 | "lookat": [0.0, 0.8, 0.0], 10 | "focal": 1.0 11 | }, 12 | "multisample": 240, 13 | "rounds": 5, 14 | "sky": { 15 | "color255": [200, 0, 0], 16 | "intensity": 1.0 17 | }, 18 | "clamp": 150.0, 19 | "russian": 0.7, 20 | "reverse": 4, 21 | "brdf": "ltc_ggx" 22 | } 23 | -------------------------------------------------------------------------------- /scenes/coffee.json: -------------------------------------------------------------------------------- 1 | { 2 | // The coffee maker model can be downloaded from https://benedikt-bitterli.me/resources/ 3 | "output-file": "coffee.exr", 4 | "output-width": 800, 5 | "output-height": 1000, 6 | "output-scale": 0.5, 7 | "multisample": 200, 8 | "russian": 0.75, 9 | "recursion-max": 10, 10 | "rounds": 4, 11 | "clamp": 3, 12 | "camera": { 13 | "position": [-0.00296, 0.19830, 0.82815], 14 | "lookat": [ 0.00289, 0.16660, 0.02271], 15 | "fov": 25 16 | }, 17 | "materials": [ 18 | { 19 | "name": "Plastic_Orange1", 20 | "brdf": "diffuse", 21 | // Original color 22 | //"diffuse": [1.0, 0.3787, 0.0135] 23 | // Adjusted for temporary lack of coating 24 | "diffuse": [1.0, 0.25, 0.0135] 25 | },{ 26 | "name": "Plastic_Orange2", 27 | "brdf": "mirror", 28 | "color": [1.0, 1.0, 1.0] 29 | },{ 30 | "name": "Plastic_Orange", 31 | "brdf": "mix", 32 | "material1": "Plastic_Orange1", 33 | "material2": "Plastic_Orange2", 34 | "amount": 0.88 35 | },{ 36 | "name": "Plastic_Black", 37 | "brdf": "ltc_ggx_diffuse", 38 | "roughness": 0.08, 39 | "specular": 0.04, 40 | "diffuse": 0.00631 41 | },{ 42 | "name": "Glass", 43 | "brdf": "dielectric", 44 | "no-russian": true, 45 | "ior": 1.5 46 | },{ 47 | "name": "Metal", 48 | "brdf": "mirror" 49 | },{ 50 | "name": "Floor1", "brdf": "mirror", "color": 0.5786 51 | },{ 52 | "name": "Floor2", "brdf": "diffuse", "diffuse": 0.5786 53 | },{ 54 | "name": "Floor", 55 | "brdf": "mix", 56 | "material1": "Floor1", 57 | "material2": "Floor2", 58 | "amount": 0.5 59 | },{ 60 | "name": "Light", 61 | "brdf": "transparent", 62 | "no-russian": true, 63 | "emission": 2.0 64 | } 65 | ], 66 | "scene": [ { "file": "coffee/Mesh000.obj", "material": "Plastic_Orange" }, 67 | { "file": "coffee/Mesh001.obj", "material": "Plastic_Orange" }, 68 | { "file": "coffee/Mesh002.obj", "material": "Metal" }, 69 | { "file": "coffee/Mesh003.obj", "material": "Plastic_Black" }, 70 | { "file": "coffee/Mesh004.obj", "material": "Floor" }, 71 | { "file": "coffee/Mesh005.obj", "material": "Plastic_Black" }, 72 | { "file": "coffee/Mesh006.obj", "material": "Plastic_Orange" }, 73 | { "file": "coffee/Mesh007.obj", "material": "Plastic_Black" }, 74 | { "file": "coffee/Mesh008.obj", "material": "Plastic_Black" }, 75 | { "file": "coffee/Mesh009.obj", "material": "Plastic_Orange" }, 76 | { "file": "coffee/Mesh010.obj", "material": "Glass" }, 77 | { "file": "coffee/Mesh011.obj", "material": "Plastic_Black" }, 78 | { "file": "coffee/Mesh012.obj", "material": "Plastic_Orange" }, 79 | { "file": "coffee/Mesh013.obj", "material": "Plastic_Black" }, 80 | { "file": "coffee/Mesh014.obj", "material": "Plastic_Black" }, 81 | { "file": "coffee/Mesh015.obj", "material": "Metal" }, 82 | { "file": "coffee/Mesh016.obj", "material": "Plastic_Orange" }, 83 | { "file": "coffee/Mesh017.obj", "material": "Plastic_Black" }, 84 | { "file": "coffee/Mesh018.obj", "material": "Plastic_Black" }, 85 | { "file": "coffee/Mesh019.obj", "material": "Plastic_Black" }, 86 | { 87 | "primitive": "plane", 88 | "translate": [ -0.2779231, 0.22527096, 0.16372351 ], 89 | //"scale": [ 0.3851, 0.1728, 0.4488 ], 90 | "scale": [ 0.19255, 0.0865, 0.2244 ], 91 | "rotate": [ -90, 0, 115 ], 92 | "material": "Light" 93 | }, 94 | { 95 | "primitive": "plane", 96 | "translate": [ 0.3229, 0.2517, 0.0462 ], 97 | //"scale": [ 0.4488, 0.1640, 0.3654 ], 98 | "scale": [ 0.2244, 0.082, 0.1827 ], 99 | "rotate": [ 0.0, 180, 90.0 ], 100 | "material": "Light" 101 | },{ 102 | "primitive": "plane", 103 | "translate": [ 0.0, 0.5038, 0.0372 ], 104 | //"scale": [ 0.4602, 0.2118, 0.4602 ], 105 | "scale": [ 0.2301, 0.1059, 0.2301 ], 106 | "rotate": [ 0.0, 0.0, 180 ], 107 | "material": "Light" 108 | } 109 | ], 110 | "sky": { 111 | "color": 1.0, 112 | "intensity": 0.0 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /scenes/conference.json: -------------------------------------------------------------------------------- 1 | { 2 | // The conference model can be downloaded from http://graphics.cs.williams.edu/data/meshes.xml 3 | "model-file": "conference/conference.obj", 4 | "output-file": "conference.exr", 5 | "output-width": 1200, 6 | "output-height": 900, 7 | "recursion-max": 4, 8 | "camera": { 9 | "position": [1400.0, 360.0, 350.0], 10 | "lookat": [200.0, 150.0, 0.0], 11 | "focal": 1.6 12 | }, 13 | "lights": [ 14 | { "position": [800.0, 400.0, -500.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 }, 15 | { "position": [800.0, 400.0, -250.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 }, 16 | { "position": [800.0, 400.0, 000.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 }, 17 | { "position": [800.0, 400.0, 250.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 }, 18 | 19 | { "position": [0.0, 400.0, -500.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 }, 20 | { "position": [0.0, 400.0, -250.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 }, 21 | { "position": [0.0, 400.0, 000.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 }, 22 | { "position": [0.0, 400.0, 250.0], "color255": [200, 220, 255], "intensity": 250000.0, "size": 100.0 } 23 | ], 24 | "multisample": 400, 25 | "rounds": 3, 26 | "clamp": 5.0, 27 | "russian": 0.7, 28 | "brdf": "cooktorr" 29 | } 30 | -------------------------------------------------------------------------------- /scenes/cornell-box-spheres.json: -------------------------------------------------------------------------------- 1 | { 2 | "output-file": "cornell-box-spheres.exr", 3 | "output-width": 1024, 4 | "output-height": 1024, 5 | "multisample": 400, 6 | "rounds": 1, 7 | "russian": 0.74, 8 | "recursion-max": 10, 9 | "clamp": 20.0, 10 | "camera": { 11 | "position": [0, 1, 6.8], 12 | "lookat": [0, 1, 0], 13 | "fov": 19.5 14 | }, 15 | "materials": [ 16 | { 17 | "name": "LeftWall", 18 | "diffuse": [0.63, 0.065, 0.05], 19 | "brdf": "diffuse" 20 | },{ 21 | "name": "RightWall", 22 | "diffuse": [0.14, 0.45, 0.091], 23 | "brdf": "diffuse" 24 | },{ 25 | "name": "WallsAndBoxes", 26 | "diffuse": [0.725, 0.71, 0.68], 27 | "brdf": "diffuse" 28 | },{ 29 | "name": "TallSphere", 30 | //"diffuse": [0.725, 0.71, 0.88], 31 | "specular": [0.825, 0.61, 0.63], 32 | "roughness": 0.11, 33 | "brdf": "ltc_beckmann" 34 | }/*,{ 35 | "name": "SmallSphere", 36 | //"diffuse": [0.725, 0.71, 0.88], 37 | "specular": [0.625, 0.61, 0.88], 38 | "roughness": 0, 39 | "brdf": "ltc_ggx" 40 | }*/,{ 41 | "name": "SmallSphere", 42 | "brdf": "dielectric", 43 | "ior": 1.5 44 | },{ 45 | "name": "Light", 46 | "emission": [17, 12, 4], 47 | "brdf": "diffuse" 48 | } 49 | ], 50 | "scene": [ 51 | { //Back wall 52 | "primitive": "plane", 53 | "axis": "Z", 54 | "translate": [0,1,-1], 55 | "material": "WallsAndBoxes" 56 | },{ // Bottom wall 57 | "primitive": "plane", 58 | "axis": "Y", 59 | "translate": [0,0,0], 60 | "material": "WallsAndBoxes" 61 | },{ // Top wall 62 | "primitive": "plane", 63 | "axis": "Y", 64 | "translate": [0,2,0], 65 | "rotate": [180,0,0], 66 | "material": "WallsAndBoxes" 67 | },{ // Right wall 68 | "primitive": "plane", 69 | "axis": "X", 70 | "translate": [1,1,0], 71 | "material": "RightWall" 72 | },{ // Left wall 73 | "primitive": "plane", 74 | "axis": "X", 75 | "translate": [-1,1,0], 76 | "rotate": [0,180,0], 77 | "material": "LeftWall" 78 | },{ // Tall sphere 79 | "file": "meshes/sphere.obj", 80 | "translate": [-0.335439, 0.6, -0.291415], 81 | "scale": [0.3, 0.3, 0.6], 82 | "rotate": [90, 180, -160.812], 83 | "material": "TallSphere" 84 | },{ // Small sphere 85 | "file": "meshes/sphere.obj", 86 | "translate": [0.328631, 0.3, 0.374592], 87 | "scale": [0.3, 0.3, 0.3], 88 | "rotate": [0, -163.36, 0], 89 | "material": "SmallSphere" 90 | },{ // Light source 91 | "primitive": "tri", 92 | "translate": [-0.005, 1.98, -0.03], 93 | "scale": [0.235, -1.0, 0.19], 94 | "rotate": [0, 180, 0], 95 | //"scale": [0.5,-1,0.5], 96 | "material": "Light" 97 | },{ // Light source 98 | "primitive": "tri", 99 | "translate": [-0.005, 1.98, -0.03], 100 | "scale": [0.235, -1.0, 0.19], 101 | "rotate": [0, 0, 0], 102 | //"scale": [0, 0, 0], 103 | "material": "Light" 104 | } 105 | ] 106 | } 107 | -------------------------------------------------------------------------------- /scenes/cornell-box.json: -------------------------------------------------------------------------------- 1 | { 2 | "output-file": "cornell-box.exr", 3 | "output-width": 1024, 4 | "output-height": 1024, 5 | "multisample": 400, 6 | "rounds": 1, 7 | "russian": 0.74, 8 | "recursion-max": 10, 9 | "clamp": 20.0, 10 | "camera": { 11 | "position": [0, 1, 6.8], 12 | "lookat": [0, 1, 0], 13 | "fov": 19.5 14 | }, 15 | "materials": [ 16 | { 17 | "name": "LeftWall", 18 | "diffuse": [0.63, 0.065, 0.05], 19 | "brdf": "diffuse" 20 | },{ 21 | "name": "RightWall", 22 | "diffuse": [0.14, 0.45, 0.091], 23 | "brdf": "diffuse" 24 | },{ 25 | "name": "WallsAndBoxes", 26 | "diffuse": [0.725, 0.71, 0.68], 27 | "brdf": "diffuse" 28 | },{ 29 | "name": "Light", 30 | "emission": [17, 12, 4], 31 | "brdf": "diffuse" 32 | } 33 | ], 34 | "scene": [ 35 | { //Back wall 36 | "primitive": "plane", 37 | "axis": "Z", 38 | "translate": [0,1,-1], 39 | "material": "WallsAndBoxes" 40 | },{ // Bottom wall 41 | "primitive": "plane", 42 | "axis": "Y", 43 | "translate": [0,0,0], 44 | "material": "WallsAndBoxes" 45 | },{ // Top wall 46 | "primitive": "plane", 47 | "axis": "Y", 48 | "translate": [0,2,0], 49 | "rotate": [180,0,0], 50 | "material": "WallsAndBoxes" 51 | },{ // Right wall 52 | "primitive": "plane", 53 | "axis": "X", 54 | "translate": [1,1,0], 55 | "material": "RightWall" 56 | },{ // Left wall 57 | "primitive": "plane", 58 | "axis": "X", 59 | "translate": [-1,1,0], 60 | "rotate": [0,180,0], 61 | "material": "LeftWall" 62 | },{ // Tall box 63 | "primitive": "cube", 64 | "translate": [-0.335439, 0.6, -0.291415], 65 | "scale": [0.607289, 0.597739, 1.2], 66 | "rotate": [90, 180, -160.812], 67 | "material": "WallsAndBoxes" 68 | },{ // Short box 69 | "primitive": "cube", 70 | "translate": [0.328631, 0.3, 0.374592], 71 | "scale": [0.594811, 0.604394, 0.6], 72 | "rotate": [0, -163.36, 0], 73 | "material": "WallsAndBoxes" 74 | },{ // Light source 75 | "primitive": "tri", 76 | "translate": [-0.005, 1.98, -0.03], 77 | "scale": [0.235, -1.0, 0.19], 78 | "rotate": [0, 180, 0], 79 | //"scale": [0.5,-1,0.5], 80 | "material": "Light" 81 | },{ // Light source 82 | "primitive": "tri", 83 | "translate": [-0.005, 1.98, -0.03], 84 | "scale": [0.235, -1.0, 0.19], 85 | "rotate": [0, 0, 0], 86 | //"scale": [0, 0, 0], 87 | "material": "Light" 88 | } 89 | ] 90 | } 91 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Empty-CO.mtl: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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.5000 15 | illum 2 16 | Ka 0.953 0.357 0.212 # Orange 17 | Kd 0.953 0.357 0.212 18 | Ks 0 0 0 19 | Ke 0 0 0 20 | 21 | 22 | newmtl rightWall 23 | Ns 10.0000 24 | Ni 1.5000 25 | illum 2 26 | Ka 0.486 0.631 0.663 # Cyan 27 | Kd 0.486 0.631 0.663 28 | Ks 0 0 0 29 | Ke 0 0 0 30 | 31 | newmtl floor 32 | Ns 10.0000 33 | Ni 1.0000 34 | illum 2 35 | Ka 0.725 0.71 0.68 # White 36 | Kd 0.725 0.71 0.68 37 | Ks 0 0 0 38 | Ke 0 0 0 39 | 40 | 41 | newmtl ceiling 42 | Ns 10.0000 43 | Ni 1.0000 44 | illum 2 45 | Ka 0.725 0.71 0.68 # White 46 | Kd 0.725 0.71 0.68 47 | Ks 0 0 0 48 | Ke 0 0 0 49 | 50 | 51 | newmtl backWall 52 | Ns 10.0000 53 | Ni 1.0000 54 | illum 2 55 | Ka 0.725 0.71 0.68 # White 56 | Kd 0.725 0.71 0.68 57 | Ks 0 0 0 58 | Ke 0 0 0 59 | 60 | newmtl light 61 | Ns 10.0000 62 | Ni 1.5000 63 | d 1.0000 64 | Tr 0.0000 65 | Tf 1.0000 1.0000 1.0000 66 | illum 2 67 | Ka 0.7800 0.7800 0.7800 68 | Kd 0.7800 0.7800 0.7800 69 | Ke 10 10 10 70 | Ks 0 0 0 71 | 72 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Empty-CO.obj: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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 | mtllib CornellBox-Empty-CO.mtl 13 | 14 | # Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | # Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | # Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object light 65 | v -0.24 1.98 0.16 66 | v -0.24 1.98 -0.22 67 | v 0.23 1.98 -0.22 68 | v 0.23 1.98 0.16 69 | 70 | g light 71 | usemtl light 72 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Empty-RG.mtl: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with red and blue walls 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 | 13 | newmtl leftWall 14 | Ns 10.0000 15 | Ni 1.0000 16 | illum 2 17 | Ka 0.63 0.065 0.05 # Red 18 | Kd 0.63 0.065 0.05 19 | Ks 0 0 0 20 | Ke 0 0 0 21 | 22 | 23 | newmtl rightWall 24 | Ns 10.0000 25 | Ni 1.0000 26 | illum 2 27 | Ka 0.14 0.45 0.091 # Green 28 | Kd 0.14 0.45 0.091 29 | Ks 0 0 0 30 | Ke 0 0 0 31 | 32 | 33 | newmtl floor 34 | Ns 10.0000 35 | Ni 1.0000 36 | illum 2 37 | Ka 0.725 0.71 0.68 # White 38 | Kd 0.725 0.71 0.68 39 | Ks 0 0 0 40 | Ke 0 0 0 41 | 42 | 43 | newmtl ceiling 44 | Ns 10.0000 45 | Ni 1.0000 46 | illum 2 47 | Ka 0.725 0.71 0.68 # White 48 | Kd 0.725 0.71 0.68 49 | Ks 0 0 0 50 | Ke 0 0 0 51 | 52 | 53 | newmtl light 54 | Ns 10.0000 55 | Ni 1.0000 56 | illum 2 57 | Ka 0.78 0.78 0.78 # White 58 | Kd 0.78 0.78 0.78 59 | Ks 0 0 0 60 | Ke 17 17 17 61 | 62 | newmtl backWall 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 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Empty-RG.obj: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with red and blue walls 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 | mtllib CornellBox-Empty-RG.mtl 13 | 14 | # Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | # Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | # Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object light 65 | v -0.24 1.98 0.16 66 | v -0.24 1.98 -0.22 67 | v 0.23 1.98 -0.22 68 | v 0.23 1.98 0.16 69 | 70 | g light 71 | usemtl light 72 | f -4 -3 -2 -1 73 | 74 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Empty-Squashed.mtl: -------------------------------------------------------------------------------- 1 | # The empty water Cornell Box as seen in Henrik Jensen's 2 | # "Realistic Image Synthesis Using Photon Mapping" (Page 109 Fig. 9.14) in OBJ format. 3 | # Note that the real box is not a perfect cube, so 4 | # the faces are imperfect in this data set. 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://www.graphics.cornell.edu/online/box/data.html 11 | # 12 | 13 | newmtl floor 14 | Ns 10.0000 15 | Ni 1.5000 16 | illum 2 17 | Ka 0.7250 0.7100 0.6800 18 | Kd 0.7250 0.7100 0.6800 19 | Ks 0 0 0 20 | 21 | newmtl ceiling 22 | Ns 10.0000 23 | Ni 1.5000 24 | illum 2 25 | Ka 0.7250 0.7100 0.6800 26 | Kd 0.7250 0.7100 0.6800 27 | Ks 0.0000 0.0000 0.0000 28 | 29 | newmtl backWall 30 | Ns 10.0000 31 | Ni 1.5000 32 | illum 2 33 | Ka 0.7250 0.7100 0.6800 34 | Kd 0.7250 0.7100 0.6800 35 | Ks 0.0000 0.0000 0.0000 36 | Ke 0.0000 0.0000 0.0000 37 | 38 | newmtl rightWall 39 | Ns 10.0000 40 | illum 2 41 | Ka 0.161 0.133 0.427 # Blue 42 | Kd 0.161 0.133 0.427 43 | Ks 0 0 0 44 | 45 | newmtl leftWall 46 | Ns 10.0000 47 | illum 2 48 | Ka 0.6300 0.0650 0.0500 49 | Kd 0.6300 0.0650 0.0500 50 | Ks 0 0 0 51 | 52 | newmtl light 53 | Ns 10.0000 54 | Ni 1.5000 55 | d 1.0000 56 | Tr 0.0000 57 | Tf 1.0000 1.0000 1.0000 58 | illum 2 59 | Ka 0.7800 0.7800 0.7800 60 | Kd 0.7800 0.7800 0.7800 61 | Ke 10 10 10 62 | Ks 0 0 0 63 | 64 | newmtl water 65 | Ka 0.01 0.01 0.01 66 | Kd 0.01 0.01 0.01 67 | Ks 0.30 0.30 0.30 68 | Tf 0.10 0.10 0.10 69 | Ns 200 70 | Ni 1.33 71 | illum 7 72 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Empty-White.mtl: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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.5000 15 | illum 2 16 | Ka 1 1 1 17 | Kd 1 1 1 18 | Ks 0 0 0 19 | Ke 0 0 0 20 | 21 | 22 | newmtl rightWall 23 | Ns 10.0000 24 | Ni 1.5000 25 | illum 2 26 | Ka 1 1 1 27 | Kd 1 1 1 28 | Ks 0 0 0 29 | Ke 0 0 0 30 | 31 | newmtl floor 32 | Ns 10.0000 33 | Ni 1.0000 34 | illum 2 35 | Ka 1 1 1 36 | Kd 1 1 1 37 | Ks 0 0 0 38 | Ke 0 0 0 39 | 40 | 41 | newmtl ceiling 42 | Ns 10.0000 43 | Ni 1.0000 44 | illum 2 45 | Ka 1 1 1 46 | Kd 1 1 1 47 | Ks 0 0 0 48 | Ke 0 0 0 49 | 50 | 51 | newmtl backWall 52 | Ns 10.0000 53 | Ni 1.0000 54 | illum 2 55 | Ka 1 1 1 56 | Kd 1 1 1 57 | Ks 0 0 0 58 | Ke 0 0 0 59 | 60 | newmtl light 61 | Ns 10.0000 62 | Ni 1.5000 63 | d 1.0000 64 | Tr 0.0000 65 | Tf 1.0000 1.0000 1.0000 66 | illum 2 67 | Ka 0.7800 0.7800 0.7800 68 | Kd 0.7800 0.7800 0.7800 69 | Ke 10 10 10 70 | Ks 0 0 0 71 | 72 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Empty-White.obj: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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 | mtllib CornellBox-Empty-White.mtl 13 | 14 | # Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | # Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | # Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object light 65 | v -0.24 1.98 0.16 66 | v -0.24 1.98 -0.22 67 | v 0.23 1.98 -0.22 68 | v 0.23 1.98 0.16 69 | 70 | g light 71 | usemtl light 72 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Glossy.mtl: -------------------------------------------------------------------------------- 1 | # The glossy 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 | # This can be matched with Henrik Jensen's "Global Illumination using Photon Maps" Page 17 Fig. 6 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://scholar.google.com/scholar?q=global+illumination+using+photon+maps+jensen&hl=en&as_sdt=0&as_vis=1&oi=scholart 11 | # 12 | newmtl sphere 13 | Ns 32 14 | d 1 15 | Tr 0 16 | Tf 1 1 1 17 | illum 2 18 | Ka 0.486 0.631 0.663 # Cyan 19 | Kd 0.486 0.631 0.663 20 | Ks 0.700 0.700 0.700 21 | Ke 0.000 0.000 0.000 22 | 23 | newmtl shortBox 24 | Ns 10.0000 25 | Ni 1.0000 26 | illum 2 27 | Ka 0.725 0.71 0.68 # White 28 | Kd 0.725 0.71 0.68 29 | Ks 0 0 0 30 | Ke 0 0 0 31 | 32 | newmtl floor 33 | Ns 80 34 | Ni 1.5000 35 | d 1.0000 36 | Tr 0.0000 37 | Tf 1.0000 1.0000 1.0000 38 | illum 2 39 | Ka 0.7250 0.7100 0.6800 40 | Kd 0.7250 0.7100 0.6800 41 | Ks 0.3000 0.3000 0.3000 42 | Ke 0.0000 0.0000 0.0000 43 | 44 | newmtl ceiling 45 | Ns 10.0000 46 | Ni 1.5000 47 | d 1.0000 48 | Tr 0.0000 49 | Tf 1.0000 1.0000 1.0000 50 | illum 2 51 | Ka 0.7250 0.7100 0.6800 52 | Kd 0.7250 0.7100 0.6800 53 | Ks 0.0000 0.0000 0.0000 54 | Ke 0.0000 0.0000 0.0000 55 | 56 | newmtl backWall 57 | Ns 10.0000 58 | Ni 1.0000 59 | illum 2 60 | Ka 0.725 0.71 0.68 # White 61 | Kd 0.725 0.71 0.68 62 | Ks 0 0 0 63 | Ke 0 0 0 64 | 65 | newmtl leftWall 66 | Ns 10.0000 67 | Ni 1.5000 68 | illum 2 69 | Ka 0.63 0.065 0.05 # Red 70 | Kd 0.63 0.065 0.05 71 | Ks 0 0 0 72 | Ke 0 0 0 73 | 74 | 75 | newmtl rightWall 76 | Ns 10.0000 77 | Ni 1.5000 78 | illum 2 79 | Ka 0.3725 0.6480 0.3137 # Green 80 | Kd 0.3725 0.6480 0.3137 81 | Ks 0 0 0 82 | Ke 0 0 0 83 | 84 | 85 | newmtl light 86 | Ns 10.0000 87 | Ni 1.5000 88 | d 1.0000 89 | Tr 0.0000 90 | Tf 1.0000 1.0000 1.0000 91 | illum 2 92 | Ka 0.7800 0.7800 0.7800 93 | Kd 0.7800 0.7800 0.7800 94 | Ke 10 10 10 95 | Ks 0 0 0 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Mirror.mtl: -------------------------------------------------------------------------------- 1 | # The mirror 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 | # http://www.graphics.cornell.edu/online/box/compare.html 11 | # 12 | 13 | newmtl leftWall 14 | Ns 10.0000 15 | Ni 1.5000 16 | illum 2 17 | Ka 0.63 0.065 0.05 # Red 18 | Kd 0.63 0.065 0.05 19 | Ks 0 0 0 20 | Ke 0 0 0 21 | 22 | 23 | newmtl rightWall 24 | Ns 10.0000 25 | Ni 1.5000 26 | illum 2 27 | Ka 0.14 0.45 0.091 # Green 28 | Kd 0.14 0.45 0.091 29 | Ks 0 0 0 30 | Ke 0 0 0 31 | 32 | 33 | newmtl floor 34 | Ns 10.0000 35 | Ni 1.0000 36 | illum 2 37 | Ka 0.725 0.71 0.68 # White 38 | Kd 0.725 0.71 0.68 39 | Ks 0 0 0 40 | Ke 0 0 0 41 | 42 | 43 | newmtl ceiling 44 | Ns 10.0000 45 | Ni 1.0000 46 | illum 2 47 | Ka 0.725 0.71 0.68 # White 48 | Kd 0.725 0.71 0.68 49 | Ks 0 0 0 50 | Ke 0 0 0 51 | 52 | 53 | newmtl backWall 54 | Ns 10.0000 55 | Ni 1.0000 56 | illum 2 57 | Ka 0.725 0.71 0.68 # White 58 | Kd 0.725 0.71 0.68 59 | Ks 0 0 0 60 | Ke 0 0 0 61 | 62 | 63 | newmtl shortBox 64 | Ns 10.0000 65 | Ni 1.0000 66 | illum 2 67 | Ka 0.725 0.71 0.68 # White 68 | Kd 0.725 0.71 0.68 69 | Ks 0 0 0 70 | Ke 0 0 0 71 | 72 | #the mirror mtl 73 | newmtl tallBox 74 | Ka 0.01 0.01 0.01 75 | Kd 0.01 0.01 0.01 76 | Ks 0.950 0.95 0.95 77 | Ns 1000 78 | illum 5 79 | 80 | newmtl light 81 | Ns 10.0000 82 | Ni 1.0000 83 | illum 2 84 | Ka 0.78 0.78 0.78 # White 85 | Kd 0.78 0.78 0.78 86 | Ks 0 0 0 87 | Ke 17 12 4 88 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Mirror.obj: -------------------------------------------------------------------------------- 1 | # The mirror 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 | # http://www.graphics.cornell.edu/online/box/compare.html 11 | # 12 | 13 | mtllib CornellBox-Mirror.mtl 14 | 15 | # Object floor 16 | v -1.01 0.00 0.99 17 | v 1.00 0.00 0.99 18 | v 1.00 0.00 -1.04 19 | v -0.99 0.00 -1.04 20 | 21 | g floor 22 | usemtl floor 23 | f -4 -3 -2 -1 24 | 25 | # Object ceiling 26 | v -1.02 1.99 0.99 27 | v -1.02 1.99 -1.04 28 | v 1.00 1.99 -1.04 29 | v 1.00 1.99 0.99 30 | 31 | g ceiling 32 | usemtl ceiling 33 | f -4 -3 -2 -1 34 | 35 | # Object backwall 36 | v -0.99 0.00 -1.04 37 | v 1.00 0.00 -1.04 38 | v 1.00 1.99 -1.04 39 | v -1.02 1.99 -1.04 40 | 41 | g backWall 42 | usemtl backWall 43 | f -4 -3 -2 -1 44 | 45 | ## Object rightwall 46 | v 1.00 0.00 -1.04 47 | v 1.00 0.00 0.99 48 | v 1.00 1.99 0.99 49 | v 1.00 1.99 -1.04 50 | 51 | g rightWall 52 | usemtl rightWall 53 | f -4 -3 -2 -1 54 | 55 | ## Object leftWall 56 | v -1.01 0.00 0.99 57 | v -0.99 0.00 -1.04 58 | v -1.02 1.99 -1.04 59 | v -1.02 1.99 0.99 60 | 61 | g leftWall 62 | usemtl leftWall 63 | f -4 -3 -2 -1 64 | 65 | ## Object shortBox 66 | usemtl shortBox 67 | 68 | # Top Face 69 | v 0.53 0.60 0.75 70 | v 0.70 0.60 0.17 71 | v 0.13 0.60 0.00 72 | v -0.05 0.60 0.57 73 | f -4 -3 -2 -1 74 | 75 | # Left Face 76 | v -0.05 0.00 0.57 77 | v -0.05 0.60 0.57 78 | v 0.13 0.60 0.00 79 | v 0.13 0.00 0.00 80 | f -4 -3 -2 -1 81 | 82 | # Front Face 83 | v 0.53 0.00 0.75 84 | v 0.53 0.60 0.75 85 | v -0.05 0.60 0.57 86 | v -0.05 0.00 0.57 87 | f -4 -3 -2 -1 88 | 89 | # Right Face 90 | v 0.70 0.00 0.17 91 | v 0.70 0.60 0.17 92 | v 0.53 0.60 0.75 93 | v 0.53 0.00 0.75 94 | f -4 -3 -2 -1 95 | 96 | # Back Face 97 | v 0.13 0.00 0.00 98 | v 0.13 0.60 0.00 99 | v 0.70 0.60 0.17 100 | v 0.70 0.00 0.17 101 | f -4 -3 -2 -1 102 | 103 | # Bottom Face 104 | v 0.53 0.00 0.75 105 | v 0.70 0.00 0.17 106 | v 0.13 0.00 0.00 107 | v -0.05 0.00 0.57 108 | f -12 -11 -10 -9 109 | 110 | g shortBox 111 | usemtl shortBox 112 | 113 | ## Object tallBox 114 | usemtl tallBox 115 | 116 | # Top Face 117 | v -0.53 1.20 0.09 118 | v 0.04 1.20 -0.09 119 | v -0.14 1.20 -0.67 120 | v -0.71 1.20 -0.49 121 | f -4 -3 -2 -1 122 | 123 | # Left Face 124 | v -0.53 0.00 0.09 125 | v -0.53 1.20 0.09 126 | v -0.71 1.20 -0.49 127 | v -0.71 0.00 -0.49 128 | f -4 -3 -2 -1 129 | 130 | # Back Face 131 | v -0.71 0.00 -0.49 132 | v -0.71 1.20 -0.49 133 | v -0.14 1.20 -0.67 134 | v -0.14 0.00 -0.67 135 | f -4 -3 -2 -1 136 | 137 | # Right Face 138 | v -0.14 0.00 -0.67 139 | v -0.14 1.20 -0.67 140 | v 0.04 1.20 -0.09 141 | v 0.04 0.00 -0.09 142 | f -4 -3 -2 -1 143 | 144 | # Front Face 145 | v 0.04 0.00 -0.09 146 | v 0.04 1.20 -0.09 147 | v -0.53 1.20 0.09 148 | v -0.53 0.00 0.09 149 | f -4 -3 -2 -1 150 | 151 | # Bottom Face 152 | v -0.53 0.00 0.09 153 | v 0.04 0.00 -0.09 154 | v -0.14 0.00 -0.67 155 | v -0.71 0.00 -0.49 156 | f -8 -7 -6 -5 157 | 158 | g tallBox 159 | usemtl tallBox 160 | 161 | ## Object light 162 | v -0.24 1.98 0.16 163 | v -0.24 1.98 -0.22 164 | v 0.23 1.98 -0.22 165 | v 0.23 1.98 0.16 166 | 167 | g light 168 | usemtl light 169 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/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.5000 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.5000 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 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Original.obj: -------------------------------------------------------------------------------- 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 | mtllib CornellBox-Original.mtl 13 | 14 | ## Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | ## Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | ## Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object shortBox 65 | usemtl shortBox 66 | 67 | # Top Face 68 | v 0.53 0.60 0.75 69 | v 0.70 0.60 0.17 70 | v 0.13 0.60 0.00 71 | v -0.05 0.60 0.57 72 | f -4 -3 -2 -1 73 | 74 | # Left Face 75 | v -0.05 0.00 0.57 76 | v -0.05 0.60 0.57 77 | v 0.13 0.60 0.00 78 | v 0.13 0.00 0.00 79 | f -4 -3 -2 -1 80 | 81 | # Front Face 82 | v 0.53 0.00 0.75 83 | v 0.53 0.60 0.75 84 | v -0.05 0.60 0.57 85 | v -0.05 0.00 0.57 86 | f -4 -3 -2 -1 87 | 88 | # Right Face 89 | v 0.70 0.00 0.17 90 | v 0.70 0.60 0.17 91 | v 0.53 0.60 0.75 92 | v 0.53 0.00 0.75 93 | f -4 -3 -2 -1 94 | 95 | # Back Face 96 | v 0.13 0.00 0.00 97 | v 0.13 0.60 0.00 98 | v 0.70 0.60 0.17 99 | v 0.70 0.00 0.17 100 | f -4 -3 -2 -1 101 | 102 | # Bottom Face 103 | v 0.53 0.00 0.75 104 | v 0.70 0.00 0.17 105 | v 0.13 0.00 0.00 106 | v -0.05 0.00 0.57 107 | f -12 -11 -10 -9 108 | 109 | g shortBox 110 | usemtl shortBox 111 | 112 | ## Object tallBox 113 | usemtl tallBox 114 | 115 | # Top Face 116 | v -0.53 1.20 0.09 117 | v 0.04 1.20 -0.09 118 | v -0.14 1.20 -0.67 119 | v -0.71 1.20 -0.49 120 | f -4 -3 -2 -1 121 | 122 | # Left Face 123 | v -0.53 0.00 0.09 124 | v -0.53 1.20 0.09 125 | v -0.71 1.20 -0.49 126 | v -0.71 0.00 -0.49 127 | f -4 -3 -2 -1 128 | 129 | # Back Face 130 | v -0.71 0.00 -0.49 131 | v -0.71 1.20 -0.49 132 | v -0.14 1.20 -0.67 133 | v -0.14 0.00 -0.67 134 | f -4 -3 -2 -1 135 | 136 | # Right Face 137 | v -0.14 0.00 -0.67 138 | v -0.14 1.20 -0.67 139 | v 0.04 1.20 -0.09 140 | v 0.04 0.00 -0.09 141 | f -4 -3 -2 -1 142 | 143 | # Front Face 144 | v 0.04 0.00 -0.09 145 | v 0.04 1.20 -0.09 146 | v -0.53 1.20 0.09 147 | v -0.53 0.00 0.09 148 | f -4 -3 -2 -1 149 | 150 | # Bottom Face 151 | v -0.53 0.00 0.09 152 | v 0.04 0.00 -0.09 153 | v -0.14 0.00 -0.67 154 | v -0.71 0.00 -0.49 155 | f -8 -7 -6 -5 156 | 157 | g tallBox 158 | usemtl tallBox 159 | 160 | ## Object light 161 | v -0.24 1.98 0.16 162 | v -0.24 1.98 -0.22 163 | v 0.23 1.98 -0.22 164 | v 0.23 1.98 0.16 165 | 166 | g light 167 | usemtl light 168 | f -4 -3 -2 -1 169 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Sphere.mtl: -------------------------------------------------------------------------------- 1 | # The sphere Cornell Box as seen in Henrik Jensen's 2 | # "Realistic Image Synthesis Using Photon Mapping" (Page 107 Fig. 9.10) in OBJ format. 3 | # Note that the real box is not a perfect cube, so 4 | # the faces are imperfect in this data set. 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://www.graphics.cornell.edu/online/box/data.html 11 | # http://www.cs.cmu.edu/~djames/15-864/pics/cornellBox.jpg 12 | # 13 | 14 | 15 | newmtl leftSphere 16 | Ka 0.00 0.00 0.00 17 | Kd 0.00 0.00 0.00 18 | Ks 1.00 1.00 1.00 19 | Ns 1000 20 | illum 5 21 | 22 | newmtl rightSphere 23 | Ka 0.01 0.01 0.01 24 | Kd 0.9 0.0 0.9 25 | Ks 0.30 0.30 0.30 26 | Tf 0.10 0.10 0.10 27 | d 0.1 28 | Ns 200 29 | Ni 2.5 30 | illum 7 31 | 32 | newmtl floor 33 | Ns 10.0000 34 | Ni 1.5000 35 | illum 2 36 | Ka 0.7250 0.7100 0.6800 37 | Kd 0.7250 0.7100 0.6800 38 | Ks 0 0 0 39 | 40 | newmtl ceiling 41 | Ns 10.0000 42 | Ni 1.5000 43 | illum 2 44 | Ka 0.7250 0.7100 0.6800 45 | Kd 0.7250 0.7100 0.6800 46 | Ks 0.0000 0.0000 0.0000 47 | 48 | newmtl backWall 49 | Ns 10.0000 50 | Ni 1.5000 51 | illum 2 52 | Ka 0.7250 0.7100 0.6800 53 | Kd 0.7250 0.7100 0.6800 54 | Ks 0.0000 0.0000 0.0000 55 | Ke 0.0000 0.0000 0.0000 56 | 57 | newmtl rightWall 58 | Ns 10.0000 59 | illum 2 60 | Ka 0.161 0.133 0.427 # Blue 61 | Kd 0.161 0.133 0.427 62 | Ks 0 0 0 63 | 64 | newmtl leftWall 65 | Ns 10.0000 66 | illum 2 67 | Ka 0.6300 0.0650 0.0500 68 | Kd 0.6300 0.0650 0.0500 69 | Ks 0 0 0 70 | 71 | newmtl light 72 | Ns 10.0000 73 | Ni 1.5000 74 | d 1.0000 75 | Tr 0.0000 76 | Tf 1.0000 1.0000 1.0000 77 | illum 2 78 | Ka 0.7800 0.7800 0.7800 79 | Kd 0.7800 0.7800 0.7800 80 | Ke 10 10 10 81 | Ks 0 0 0 82 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox-Water.mtl: -------------------------------------------------------------------------------- 1 | # The water Cornell Box as seen in Henrik Jensen's 2 | # "Realistic Image Synthesis Using Photon Mapping" (Page 109 Fig. 9.14) in OBJ format. 3 | # Note that the real box is not a perfect cube, so 4 | # the faces are imperfect in this data set. 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://www.graphics.cornell.edu/online/box/data.html 11 | # 12 | newmtl leftSphere 13 | Ka 0.01 0.01 0.01 14 | Kd 0.01 0.01 0.01 15 | Ks 0.95 0.95 0.95 16 | Ns 1000 17 | illum 5 18 | 19 | newmtl rightSphere 20 | Ka 0.01 0.01 0.01 21 | Kd 0.01 0.01 0.01 22 | Ks 0.30 0.30 0.30 23 | Tf 0.10 0.10 0.10 24 | Ns 200 25 | Ni 2.5 26 | illum 7 27 | 28 | newmtl floor 29 | Ns 10.0000 30 | Ni 1.5000 31 | illum 2 32 | Ka 0.7250 0.7100 0.6800 33 | Kd 0.7250 0.7100 0.6800 34 | Ks 0 0 0 35 | 36 | newmtl ceiling 37 | Ns 10.0000 38 | Ni 1.5000 39 | illum 2 40 | Ka 0.7250 0.7100 0.6800 41 | Kd 0.7250 0.7100 0.6800 42 | Ks 0.0000 0.0000 0.0000 43 | 44 | newmtl backWall 45 | Ns 10.0000 46 | Ni 1.5000 47 | illum 2 48 | Ka 0.7250 0.7100 0.6800 49 | Kd 0.7250 0.7100 0.6800 50 | Ks 0.0000 0.0000 0.0000 51 | Ke 0.0000 0.0000 0.0000 52 | 53 | newmtl rightWall 54 | Ns 10.0000 55 | illum 2 56 | Ka 0.161 0.133 0.427 # Blue 57 | Kd 0.161 0.133 0.427 58 | Ks 0 0 0 59 | 60 | newmtl leftWall 61 | Ns 10.0000 62 | illum 2 63 | Ka 0.6300 0.0650 0.0500 64 | Kd 0.6300 0.0650 0.0500 65 | Ks 0 0 0 66 | 67 | newmtl light 68 | Ns 10.0000 69 | Ni 1.5000 70 | d 1.0000 71 | Tr 0.0000 72 | Tf 1.0000 1.0000 1.0000 73 | illum 2 74 | Ka 0.7800 0.7800 0.7800 75 | Kd 0.7800 0.7800 0.7800 76 | Ke 10 10 10 77 | Ks 0 0 0 78 | 79 | newmtl water 80 | Ka 0.01 0.01 0.01 81 | Kd 0.01 0.01 0.01 82 | Ks 0.30 0.30 0.30 83 | Tf 0.10 0.10 0.10 84 | Ns 200 85 | Ni 1.33 86 | illum 7 87 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Empty-CO.mtl: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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.5000 15 | illum 2 16 | Ka 0.953 0.357 0.212 # Orange 17 | Kd 0.953 0.357 0.212 18 | Ks 0 0 0 19 | Ke 0 0 0 20 | 21 | 22 | newmtl rightWall 23 | Ns 10.0000 24 | Ni 1.5000 25 | illum 2 26 | Ka 0.486 0.631 0.663 # Cyan 27 | Kd 0.486 0.631 0.663 28 | Ks 0 0 0 29 | Ke 0 0 0 30 | 31 | newmtl floor 32 | Ns 10.0000 33 | Ni 1.0000 34 | illum 2 35 | Ka 0.725 0.71 0.68 # White 36 | Kd 0.725 0.71 0.68 37 | Ks 0 0 0 38 | Ke 0 0 0 39 | 40 | 41 | newmtl ceiling 42 | Ns 10.0000 43 | Ni 1.0000 44 | illum 2 45 | Ka 0.725 0.71 0.68 # White 46 | Kd 0.725 0.71 0.68 47 | Ks 0 0 0 48 | Ke 0 0 0 49 | 50 | 51 | newmtl backWall 52 | Ns 10.0000 53 | Ni 1.0000 54 | illum 2 55 | Ka 0.725 0.71 0.68 # White 56 | Kd 0.725 0.71 0.68 57 | Ks 0 0 0 58 | Ke 0 0 0 59 | 60 | newmtl light 61 | Ns 10.0000 62 | Ni 1.5000 63 | d 1.0000 64 | Tr 0.0000 65 | Tf 1.0000 1.0000 1.0000 66 | illum 2 67 | Ka 0.7800 0.7800 0.7800 68 | Kd 0.7800 0.7800 0.7800 69 | Ke 10 10 10 70 | Ks 0 0 0 71 | 72 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Empty-CO.obj: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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 | mtllib CornellBox-Empty-CO.mtl 13 | 14 | # Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | # Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | # Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object light 65 | v -0.24 1.98 0.16 66 | v -0.24 1.98 -0.22 67 | v 0.23 1.98 -0.22 68 | v 0.23 1.98 0.16 69 | 70 | g light 71 | usemtl light 72 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Empty-RG.mtl: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with red and blue walls 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 | 13 | newmtl leftWall 14 | Ns 10.0000 15 | Ni 1.5000 16 | illum 2 17 | Ka 0.63 0.065 0.05 # Red 18 | Kd 0.63 0.065 0.05 19 | Ks 0 0 0 20 | Ke 0 0 0 21 | 22 | 23 | newmtl rightWall 24 | Ns 10.0000 25 | Ni 1.5000 26 | illum 2 27 | Ka 0.14 0.45 0.091 # Green 28 | Kd 0.14 0.45 0.091 29 | Ks 0 0 0 30 | Ke 0 0 0 31 | 32 | 33 | newmtl floor 34 | Ns 10.0000 35 | Ni 1.0000 36 | illum 2 37 | Ka 0.725 0.71 0.68 # White 38 | Kd 0.725 0.71 0.68 39 | Ks 0 0 0 40 | Ke 0 0 0 41 | 42 | 43 | newmtl ceiling 44 | Ns 10.0000 45 | Ni 1.0000 46 | illum 2 47 | Ka 0.725 0.71 0.68 # White 48 | Kd 0.725 0.71 0.68 49 | Ks 0 0 0 50 | Ke 0 0 0 51 | 52 | 53 | newmtl backWall 54 | Ns 10.0000 55 | Ni 1.0000 56 | illum 2 57 | Ka 0.725 0.71 0.68 # White 58 | Kd 0.725 0.71 0.68 59 | Ks 0 0 0 60 | Ke 0 0 0 61 | 62 | newmtl light 63 | Ns 10.0000 64 | Ni 1.0000 65 | illum 2 66 | Ka 0.78 0.78 0.78 # White 67 | Kd 0.78 0.78 0.78 68 | Ks 0 0 0 69 | Ke 17 12 4 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Empty-RG.obj: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with red and blue walls 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 | mtllib CornellBox-Empty-RG.mtl 13 | 14 | # Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | # Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | # Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object light 65 | v -0.24 1.98 0.16 66 | v -0.24 1.98 -0.22 67 | v 0.23 1.98 -0.22 68 | v 0.23 1.98 0.16 69 | 70 | g light 71 | usemtl light 72 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Empty-Squashed.mtl: -------------------------------------------------------------------------------- 1 | # The empty water Cornell Box as seen in Henrik Jensen's 2 | # "Realistic Image Synthesis Using Photon Mapping" (Page 109 Fig. 9.14) in OBJ format. 3 | # Note that the real box is not a perfect cube, so 4 | # the faces are imperfect in this data set. 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://www.graphics.cornell.edu/online/box/data.html 11 | # 12 | 13 | newmtl floor 14 | Ns 10.0000 15 | Ni 1.5000 16 | illum 2 17 | Ka 0.7250 0.7100 0.6800 18 | Kd 0.7250 0.7100 0.6800 19 | Ks 0 0 0 20 | 21 | newmtl ceiling 22 | Ns 10.0000 23 | Ni 1.5000 24 | illum 2 25 | Ka 0.7250 0.7100 0.6800 26 | Kd 0.7250 0.7100 0.6800 27 | Ks 0.0000 0.0000 0.0000 28 | 29 | newmtl backWall 30 | Ns 10.0000 31 | Ni 1.5000 32 | illum 2 33 | Ka 0.7250 0.7100 0.6800 34 | Kd 0.7250 0.7100 0.6800 35 | Ks 0.0000 0.0000 0.0000 36 | Ke 0.0000 0.0000 0.0000 37 | 38 | newmtl rightWall 39 | Ns 10.0000 40 | illum 2 41 | Ka 0.161 0.133 0.427 # Blue 42 | Kd 0.161 0.133 0.427 43 | Ks 0 0 0 44 | 45 | newmtl leftWall 46 | Ns 10.0000 47 | illum 2 48 | Ka 0.6300 0.0650 0.0500 49 | Kd 0.6300 0.0650 0.0500 50 | Ks 0 0 0 51 | 52 | newmtl light 53 | Ns 10.0000 54 | Ni 1.5000 55 | d 1.0000 56 | Tr 0.0000 57 | Tf 1.0000 1.0000 1.0000 58 | illum 2 59 | Ka 0.7800 0.7800 0.7800 60 | Kd 0.7800 0.7800 0.7800 61 | Ke 10 10 10 62 | Ks 0 0 0 63 | 64 | newmtl water 65 | Ka 0.01 0.01 0.01 66 | Kd 0.01 0.01 0.01 67 | Ks 0.30 0.30 0.30 68 | Tf 0.10 0.10 0.10 69 | Ns 200 70 | Ni 1.33 71 | illum 7 72 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Empty-White.mtl: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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.5000 15 | illum 2 16 | Ka 1 1 1 17 | Kd 1 1 1 18 | Ks 0 0 0 19 | Ke 0 0 0 20 | 21 | 22 | newmtl rightWall 23 | Ns 10.0000 24 | Ni 1.5000 25 | illum 2 26 | Ka 1 1 1 27 | Kd 1 1 1 28 | Ks 0 0 0 29 | Ke 0 0 0 30 | 31 | newmtl floor 32 | Ns 10.0000 33 | Ni 1.0000 34 | illum 2 35 | Ka 1 1 1 36 | Kd 1 1 1 37 | Ks 0 0 0 38 | Ke 0 0 0 39 | 40 | 41 | newmtl ceiling 42 | Ns 10.0000 43 | Ni 1.0000 44 | illum 2 45 | Ka 1 1 1 46 | Kd 1 1 1 47 | Ks 0 0 0 48 | Ke 0 0 0 49 | 50 | 51 | newmtl backWall 52 | Ns 10.0000 53 | Ni 1.0000 54 | illum 2 55 | Ka 1 1 1 56 | Kd 1 1 1 57 | Ks 0 0 0 58 | Ke 0 0 0 59 | 60 | newmtl light 61 | Ns 10.0000 62 | Ni 1.5000 63 | d 1.0000 64 | Tr 0.0000 65 | Tf 1.0000 1.0000 1.0000 66 | illum 2 67 | Ka 0.7800 0.7800 0.7800 68 | Kd 0.7800 0.7800 0.7800 69 | Ke 10 10 10 70 | Ks 0 0 0 71 | 72 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Empty-White.obj: -------------------------------------------------------------------------------- 1 | # An empty Cornell Box with cyan and orange walls 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 | mtllib CornellBox-Empty-White.mtl 13 | 14 | # Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | # Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | # Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object light 65 | v -0.24 1.98 0.16 66 | v -0.24 1.98 -0.22 67 | v 0.23 1.98 -0.22 68 | v 0.23 1.98 0.16 69 | 70 | g light 71 | usemtl light 72 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Glossy.mtl: -------------------------------------------------------------------------------- 1 | # The glossy 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 | # This can be matched with Henrik Jensen's "Global Illumination using Photon Maps" Page 17 Fig. 6 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://scholar.google.com/scholar?q=global+illumination+using+photon+maps+jensen&hl=en&as_sdt=0&as_vis=1&oi=scholart 11 | # 12 | newmtl sphere 13 | Ns 32 14 | d 1 15 | Tr 0 16 | Tf 1 1 1 17 | illum 2 18 | Ka 0.486 0.631 0.663 # Cyan 19 | Kd 0.486 0.631 0.663 20 | Ks 0.700 0.700 0.700 21 | Ke 0.000 0.000 0.000 22 | 23 | newmtl shortBox 24 | Ns 10.0000 25 | Ni 1.0000 26 | illum 2 27 | Ka 0.725 0.71 0.68 # White 28 | Kd 0.725 0.71 0.68 29 | Ks 0 0 0 30 | Ke 0 0 0 31 | 32 | newmtl floor 33 | Ns 80 34 | Ni 1.5000 35 | d 1.0000 36 | Tr 0.0000 37 | Tf 1.0000 1.0000 1.0000 38 | illum 2 39 | Ka 0.7250 0.7100 0.6800 40 | Kd 0.7250 0.7100 0.6800 41 | Ks 0.3000 0.3000 0.3000 42 | Ke 0.0000 0.0000 0.0000 43 | 44 | newmtl ceiling 45 | Ns 10.0000 46 | Ni 1.5000 47 | d 1.0000 48 | Tr 0.0000 49 | Tf 1.0000 1.0000 1.0000 50 | illum 2 51 | Ka 0.7250 0.7100 0.6800 52 | Kd 0.7250 0.7100 0.6800 53 | Ks 0.0000 0.0000 0.0000 54 | Ke 0.0000 0.0000 0.0000 55 | 56 | newmtl backWall 57 | Ns 10.0000 58 | Ni 1.0000 59 | illum 2 60 | Ka 0.725 0.71 0.68 # White 61 | Kd 0.725 0.71 0.68 62 | Ks 0 0 0 63 | Ke 0 0 0 64 | 65 | newmtl leftWall 66 | Ns 10.0000 67 | Ni 1.5000 68 | illum 2 69 | Ka 0.63 0.065 0.05 # Red 70 | Kd 0.63 0.065 0.05 71 | Ks 0 0 0 72 | Ke 0 0 0 73 | 74 | 75 | newmtl rightWall 76 | Ns 10.0000 77 | Ni 1.5000 78 | illum 2 79 | Ka 0.3725 0.6480 0.3137 # Green 80 | Kd 0.3725 0.6480 0.3137 81 | Ks 0 0 0 82 | Ke 0 0 0 83 | 84 | 85 | newmtl light 86 | Ns 10.0000 87 | Ni 1.5000 88 | d 1.0000 89 | Tr 0.0000 90 | Tf 1.0000 1.0000 1.0000 91 | illum 2 92 | Ka 0.7800 0.7800 0.7800 93 | Kd 0.7800 0.7800 0.7800 94 | Ke 10 10 10 95 | Ks 0 0 0 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Mirror.mtl: -------------------------------------------------------------------------------- 1 | # The mirror 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 | # http://www.graphics.cornell.edu/online/box/compare.html 11 | # 12 | 13 | newmtl leftWall 14 | Ns 10.0000 15 | Ni 1.5000 16 | illum 2 17 | Ka 0.63 0.065 0.05 # Red 18 | Kd 0.63 0.065 0.05 19 | Ks 0 0 0 20 | Ke 0 0 0 21 | 22 | 23 | newmtl rightWall 24 | Ns 10.0000 25 | Ni 1.5000 26 | illum 2 27 | Ka 0.14 0.45 0.091 # Green 28 | Kd 0.14 0.45 0.091 29 | Ks 0 0 0 30 | Ke 0 0 0 31 | 32 | 33 | newmtl floor 34 | Ns 10.0000 35 | Ni 1.0000 36 | illum 2 37 | Ka 0.725 0.71 0.68 # White 38 | Kd 0.725 0.71 0.68 39 | Ks 0 0 0 40 | Ke 0 0 0 41 | 42 | 43 | newmtl ceiling 44 | Ns 10.0000 45 | Ni 1.0000 46 | illum 2 47 | Ka 0.725 0.71 0.68 # White 48 | Kd 0.725 0.71 0.68 49 | Ks 0 0 0 50 | Ke 0 0 0 51 | 52 | 53 | newmtl backWall 54 | Ns 10.0000 55 | Ni 1.0000 56 | illum 2 57 | Ka 0.725 0.71 0.68 # White 58 | Kd 0.725 0.71 0.68 59 | Ks 0 0 0 60 | Ke 0 0 0 61 | 62 | 63 | newmtl shortBox 64 | Ns 10.0000 65 | Ni 1.0000 66 | illum 2 67 | Ka 0.725 0.71 0.68 # White 68 | Kd 0.725 0.71 0.68 69 | Ks 0 0 0 70 | Ke 0 0 0 71 | 72 | #the mirror mtl 73 | newmtl tallBox 74 | Ka 0.01 0.01 0.01 75 | Kd 0.01 0.01 0.01 76 | Ks 0.950 0.95 0.95 77 | Ns 1000 78 | illum 5 79 | 80 | newmtl light 81 | Ns 10.0000 82 | Ni 1.0000 83 | illum 2 84 | Ka 0.78 0.78 0.78 # White 85 | Kd 0.78 0.78 0.78 86 | Ks 0 0 0 87 | Ke 17 12 4 88 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Mirror.obj: -------------------------------------------------------------------------------- 1 | # The mirror 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 | # http://www.graphics.cornell.edu/online/box/compare.html 11 | # 12 | 13 | mtllib CornellBox-Mirror.mtl 14 | 15 | # Object floor 16 | v -1.01 0.00 0.99 17 | v 1.00 0.00 0.99 18 | v 1.00 0.00 -1.04 19 | v -0.99 0.00 -1.04 20 | 21 | g floor 22 | usemtl floor 23 | f -4 -3 -2 -1 24 | 25 | # Object ceiling 26 | v -1.02 1.99 0.99 27 | v -1.02 1.99 -1.04 28 | v 1.00 1.99 -1.04 29 | v 1.00 1.99 0.99 30 | 31 | g ceiling 32 | usemtl ceiling 33 | f -4 -3 -2 -1 34 | 35 | # Object backwall 36 | v -0.99 0.00 -1.04 37 | v 1.00 0.00 -1.04 38 | v 1.00 1.99 -1.04 39 | v -1.02 1.99 -1.04 40 | 41 | g backWall 42 | usemtl backWall 43 | f -4 -3 -2 -1 44 | 45 | ## Object rightwall 46 | v 1.00 0.00 -1.04 47 | v 1.00 0.00 0.99 48 | v 1.00 1.99 0.99 49 | v 1.00 1.99 -1.04 50 | 51 | g rightWall 52 | usemtl rightWall 53 | f -4 -3 -2 -1 54 | 55 | ## Object leftWall 56 | v -1.01 0.00 0.99 57 | v -0.99 0.00 -1.04 58 | v -1.02 1.99 -1.04 59 | v -1.02 1.99 0.99 60 | 61 | g leftWall 62 | usemtl leftWall 63 | f -4 -3 -2 -1 64 | 65 | ## Object shortBox 66 | usemtl shortBox 67 | 68 | # Top Face 69 | v 0.53 0.60 0.75 70 | v 0.70 0.60 0.17 71 | v 0.13 0.60 0.00 72 | v -0.05 0.60 0.57 73 | f -4 -3 -2 -1 74 | 75 | # Left Face 76 | v -0.05 0.00 0.57 77 | v -0.05 0.60 0.57 78 | v 0.13 0.60 0.00 79 | v 0.13 0.00 0.00 80 | f -4 -3 -2 -1 81 | 82 | # Front Face 83 | v 0.53 0.00 0.75 84 | v 0.53 0.60 0.75 85 | v -0.05 0.60 0.57 86 | v -0.05 0.00 0.57 87 | f -4 -3 -2 -1 88 | 89 | # Right Face 90 | v 0.70 0.00 0.17 91 | v 0.70 0.60 0.17 92 | v 0.53 0.60 0.75 93 | v 0.53 0.00 0.75 94 | f -4 -3 -2 -1 95 | 96 | # Back Face 97 | v 0.13 0.00 0.00 98 | v 0.13 0.60 0.00 99 | v 0.70 0.60 0.17 100 | v 0.70 0.00 0.17 101 | f -4 -3 -2 -1 102 | 103 | # Bottom Face 104 | v 0.53 0.00 0.75 105 | v 0.70 0.00 0.17 106 | v 0.13 0.00 0.00 107 | v -0.05 0.00 0.57 108 | f -12 -11 -10 -9 109 | 110 | g shortBox 111 | usemtl shortBox 112 | 113 | ## Object tallBox 114 | usemtl tallBox 115 | 116 | # Top Face 117 | v -0.53 1.20 0.09 118 | v 0.04 1.20 -0.09 119 | v -0.14 1.20 -0.67 120 | v -0.71 1.20 -0.49 121 | f -4 -3 -2 -1 122 | 123 | # Left Face 124 | v -0.53 0.00 0.09 125 | v -0.53 1.20 0.09 126 | v -0.71 1.20 -0.49 127 | v -0.71 0.00 -0.49 128 | f -4 -3 -2 -1 129 | 130 | # Back Face 131 | v -0.71 0.00 -0.49 132 | v -0.71 1.20 -0.49 133 | v -0.14 1.20 -0.67 134 | v -0.14 0.00 -0.67 135 | f -4 -3 -2 -1 136 | 137 | # Right Face 138 | v -0.14 0.00 -0.67 139 | v -0.14 1.20 -0.67 140 | v 0.04 1.20 -0.09 141 | v 0.04 0.00 -0.09 142 | f -4 -3 -2 -1 143 | 144 | # Front Face 145 | v 0.04 0.00 -0.09 146 | v 0.04 1.20 -0.09 147 | v -0.53 1.20 0.09 148 | v -0.53 0.00 0.09 149 | f -4 -3 -2 -1 150 | 151 | # Bottom Face 152 | v -0.53 0.00 0.09 153 | v 0.04 0.00 -0.09 154 | v -0.14 0.00 -0.67 155 | v -0.71 0.00 -0.49 156 | f -8 -7 -6 -5 157 | 158 | g tallBox 159 | usemtl tallBox 160 | 161 | ## Object light 162 | v -0.24 1.98 0.16 163 | v -0.24 1.98 -0.22 164 | v 0.23 1.98 -0.22 165 | v 0.23 1.98 0.16 166 | 167 | g light 168 | usemtl light 169 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/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.5000 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.5000 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 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Original.obj: -------------------------------------------------------------------------------- 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 | mtllib CornellBox-Original.mtl 13 | 14 | ## Object floor 15 | v -1.01 0.00 0.99 16 | v 1.00 0.00 0.99 17 | v 1.00 0.00 -1.04 18 | v -0.99 0.00 -1.04 19 | 20 | g floor 21 | usemtl floor 22 | f -4 -3 -2 -1 23 | 24 | ## Object ceiling 25 | v -1.02 1.99 0.99 26 | v -1.02 1.99 -1.04 27 | v 1.00 1.99 -1.04 28 | v 1.00 1.99 0.99 29 | 30 | g ceiling 31 | usemtl ceiling 32 | f -4 -3 -2 -1 33 | 34 | ## Object backwall 35 | v -0.99 0.00 -1.04 36 | v 1.00 0.00 -1.04 37 | v 1.00 1.99 -1.04 38 | v -1.02 1.99 -1.04 39 | 40 | g backWall 41 | usemtl backWall 42 | f -4 -3 -2 -1 43 | 44 | ## Object rightwall 45 | v 1.00 0.00 -1.04 46 | v 1.00 0.00 0.99 47 | v 1.00 1.99 0.99 48 | v 1.00 1.99 -1.04 49 | 50 | g rightWall 51 | usemtl rightWall 52 | f -4 -3 -2 -1 53 | 54 | ## Object leftWall 55 | v -1.01 0.00 0.99 56 | v -0.99 0.00 -1.04 57 | v -1.02 1.99 -1.04 58 | v -1.02 1.99 0.99 59 | 60 | g leftWall 61 | usemtl leftWall 62 | f -4 -3 -2 -1 63 | 64 | ## Object shortBox 65 | usemtl shortBox 66 | 67 | # Top Face 68 | v 0.53 0.60 0.75 69 | v 0.70 0.60 0.17 70 | v 0.13 0.60 0.00 71 | v -0.05 0.60 0.57 72 | f -4 -3 -2 -1 73 | 74 | # Left Face 75 | v -0.05 0.00 0.57 76 | v -0.05 0.60 0.57 77 | v 0.13 0.60 0.00 78 | v 0.13 0.00 0.00 79 | f -4 -3 -2 -1 80 | 81 | # Front Face 82 | v 0.53 0.00 0.75 83 | v 0.53 0.60 0.75 84 | v -0.05 0.60 0.57 85 | v -0.05 0.00 0.57 86 | f -4 -3 -2 -1 87 | 88 | # Right Face 89 | v 0.70 0.00 0.17 90 | v 0.70 0.60 0.17 91 | v 0.53 0.60 0.75 92 | v 0.53 0.00 0.75 93 | f -4 -3 -2 -1 94 | 95 | # Back Face 96 | v 0.13 0.00 0.00 97 | v 0.13 0.60 0.00 98 | v 0.70 0.60 0.17 99 | v 0.70 0.00 0.17 100 | f -4 -3 -2 -1 101 | 102 | # Bottom Face 103 | v 0.53 0.00 0.75 104 | v 0.70 0.00 0.17 105 | v 0.13 0.00 0.00 106 | v -0.05 0.00 0.57 107 | f -12 -11 -10 -9 108 | 109 | g shortBox 110 | usemtl shortBox 111 | 112 | ## Object tallBox 113 | usemtl tallBox 114 | 115 | # Top Face 116 | v -0.53 1.20 0.09 117 | v 0.04 1.20 -0.09 118 | v -0.14 1.20 -0.67 119 | v -0.71 1.20 -0.49 120 | f -4 -3 -2 -1 121 | 122 | # Left Face 123 | v -0.53 0.00 0.09 124 | v -0.53 1.20 0.09 125 | v -0.71 1.20 -0.49 126 | v -0.71 0.00 -0.49 127 | f -4 -3 -2 -1 128 | 129 | # Back Face 130 | v -0.71 0.00 -0.49 131 | v -0.71 1.20 -0.49 132 | v -0.14 1.20 -0.67 133 | v -0.14 0.00 -0.67 134 | f -4 -3 -2 -1 135 | 136 | # Right Face 137 | v -0.14 0.00 -0.67 138 | v -0.14 1.20 -0.67 139 | v 0.04 1.20 -0.09 140 | v 0.04 0.00 -0.09 141 | f -4 -3 -2 -1 142 | 143 | # Front Face 144 | v 0.04 0.00 -0.09 145 | v 0.04 1.20 -0.09 146 | v -0.53 1.20 0.09 147 | v -0.53 0.00 0.09 148 | f -4 -3 -2 -1 149 | 150 | # Bottom Face 151 | v -0.53 0.00 0.09 152 | v 0.04 0.00 -0.09 153 | v -0.14 0.00 -0.67 154 | v -0.71 0.00 -0.49 155 | f -8 -7 -6 -5 156 | 157 | g tallBox 158 | usemtl tallBox 159 | 160 | ## Object light 161 | v -0.24 1.98 0.16 162 | v -0.24 1.98 -0.22 163 | v 0.23 1.98 -0.22 164 | v 0.23 1.98 0.16 165 | 166 | g light 167 | usemtl light 168 | f -4 -3 -2 -1 -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Sphere.mtl: -------------------------------------------------------------------------------- 1 | # The sphere Cornell Box as seen in Henrik Jensen's 2 | # "Realistic Image Synthesis Using Photon Mapping" (Page 107 Fig. 9.10) in OBJ format. 3 | # Note that the real box is not a perfect cube, so 4 | # the faces are imperfect in this data set. 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://www.graphics.cornell.edu/online/box/data.html 11 | # http://www.cs.cmu.edu/~djames/15-864/pics/cornellBox.jpg 12 | # 13 | 14 | 15 | newmtl leftSphere 16 | Ka 0.01 0.01 0.01 17 | Kd 0.01 0.01 0.01 18 | Ks 0.95 0.95 0.95 19 | Ns 1000 20 | illum 5 21 | 22 | newmtl rightSphere 23 | Ka 0.01 0.01 0.01 24 | Kd 0.01 0.01 0.01 25 | Ks 0.30 0.30 0.30 26 | Tf 0.10 0.10 0.10 27 | Ns 200 28 | Ni 2.5 29 | illum 7 30 | 31 | newmtl floor 32 | Ns 10.0000 33 | Ni 1.5000 34 | illum 2 35 | Ka 0.7250 0.7100 0.6800 36 | Kd 0.7250 0.7100 0.6800 37 | Ks 0 0 0 38 | 39 | newmtl ceiling 40 | Ns 10.0000 41 | Ni 1.5000 42 | illum 2 43 | Ka 0.7250 0.7100 0.6800 44 | Kd 0.7250 0.7100 0.6800 45 | Ks 0.0000 0.0000 0.0000 46 | 47 | newmtl backWall 48 | Ns 10.0000 49 | Ni 1.5000 50 | illum 2 51 | Ka 0.7250 0.7100 0.6800 52 | Kd 0.7250 0.7100 0.6800 53 | Ks 0.0000 0.0000 0.0000 54 | Ke 0.0000 0.0000 0.0000 55 | 56 | newmtl rightWall 57 | Ns 10.0000 58 | illum 2 59 | Ka 0.161 0.133 0.427 # Blue 60 | Kd 0.161 0.133 0.427 61 | Ks 0 0 0 62 | 63 | newmtl leftWall 64 | Ns 10.0000 65 | illum 2 66 | Ka 0.6300 0.0650 0.0500 67 | Kd 0.6300 0.0650 0.0500 68 | Ks 0 0 0 69 | 70 | newmtl light 71 | Ns 10.0000 72 | Ni 1.5000 73 | d 1.0000 74 | Tr 0.0000 75 | Tf 1.0000 1.0000 1.0000 76 | illum 2 77 | Ka 0.7800 0.7800 0.7800 78 | Kd 0.7800 0.7800 0.7800 79 | Ke 10 10 10 80 | Ks 0 0 0 81 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/CornellBox-Water.mtl: -------------------------------------------------------------------------------- 1 | # The water Cornell Box as seen in Henrik Jensen's 2 | # "Realistic Image Synthesis Using Photon Mapping" (Page 109 Fig. 9.14) in OBJ format. 3 | # Note that the real box is not a perfect cube, so 4 | # the faces are imperfect in this data set. 5 | # 6 | # Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011 7 | # Released into the Public Domain. 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # http://www.graphics.cornell.edu/online/box/data.html 11 | # 12 | newmtl leftSphere 13 | Ka 0.01 0.01 0.01 14 | Kd 0.01 0.01 0.01 15 | Ks 0.95 0.95 0.95 16 | Ns 1000 17 | illum 5 18 | 19 | newmtl rightSphere 20 | Ka 0.01 0.01 0.01 21 | Kd 0.01 0.01 0.01 22 | Ks 0.30 0.30 0.30 23 | Tf 0.10 0.10 0.10 24 | Ns 200 25 | Ni 2.5 26 | illum 7 27 | 28 | newmtl floor 29 | Ns 10.0000 30 | Ni 1.5000 31 | illum 2 32 | Ka 0.7250 0.7100 0.6800 33 | Kd 0.7250 0.7100 0.6800 34 | Ks 0 0 0 35 | 36 | newmtl ceiling 37 | Ns 10.0000 38 | Ni 1.5000 39 | illum 2 40 | Ka 0.7250 0.7100 0.6800 41 | Kd 0.7250 0.7100 0.6800 42 | Ks 0.0000 0.0000 0.0000 43 | 44 | newmtl backWall 45 | Ns 10.0000 46 | Ni 1.5000 47 | illum 2 48 | Ka 0.7250 0.7100 0.6800 49 | Kd 0.7250 0.7100 0.6800 50 | Ks 0.0000 0.0000 0.0000 51 | Ke 0.0000 0.0000 0.0000 52 | 53 | newmtl rightWall 54 | Ns 10.0000 55 | illum 2 56 | Ka 0.161 0.133 0.427 # Blue 57 | Kd 0.161 0.133 0.427 58 | Ks 0 0 0 59 | 60 | newmtl leftWall 61 | Ns 10.0000 62 | illum 2 63 | Ka 0.6300 0.0650 0.0500 64 | Kd 0.6300 0.0650 0.0500 65 | Ks 0 0 0 66 | 67 | newmtl light 68 | Ns 10.0000 69 | Ni 1.5000 70 | d 1.0000 71 | Tr 0.0000 72 | Tf 1.0000 1.0000 1.0000 73 | illum 2 74 | Ka 0.7800 0.7800 0.7800 75 | Kd 0.7800 0.7800 0.7800 76 | Ke 10 10 10 77 | Ks 0 0 0 78 | 79 | newmtl water 80 | Ka 0.01 0.01 0.01 81 | Kd 0.01 0.01 0.01 82 | Ks 0.30 0.30 0.30 83 | Tf 0.10 0.10 0.10 84 | Ns 200 85 | Ni 1.33 86 | illum 7 87 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/copyright.txt: -------------------------------------------------------------------------------- 1 | # A set of eight Cornell Boxes 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 | # Attribution 3.0 Unported (CC BY 3.0) License 7 | # http://creativecommons.org/licenses/by/3.0/ 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # 11 | 12 | 13 | -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/cornell-box/CornellBox/index.png -------------------------------------------------------------------------------- /scenes/cornell-box/CornellBox/index.txt: -------------------------------------------------------------------------------- 1 | We are trying to create scenes similar to those in previous publications, but this 2 | is necessarily not a perfect match because in many cases, the original data are not 3 | available. 4 | 5 | 6 | 7 | 8 | CornellBox-Original.obj 9 | 10 | This can be matched with http://www.graphics.cornell.edu/online/box/data.html 11 | 12 | 13 | 14 | 15 | CornellBox-Mirror.obj 16 | 17 | This can be matched with http://www.graphics.cornell.edu/online/box/compare.html 18 | 19 | 20 | 21 | 22 | CornellBox-Empty-RG.obj 23 | 24 | This is the original Cornell Box without the small boxes inside of it. 25 | 26 | 27 | 28 | 29 | CornellBox-Empty-CO.obj 30 | 31 | This matches the colors of, simulation of the Cornell box was done by Michael F. Cohen and Donald P. Greenberg 32 | for the 1985 paper The Hemi-Cube, A Radiosity Solution for Complex Environments, 33 | Vol. 19, No. 3, July 1985, pp. 31-40 34 | 35 | 36 | 37 | 38 | CornellBox-Water.obj 39 | 40 | This can be matched with Henrik Jensen's "Realistic Image Synthesis Using Photon Mapping" Page 109 Fig. 9.14 41 | 42 | 43 | 44 | 45 | CornellBox-Sphere.obj 46 | 47 | This can be matched with Henrik Jensen's "Realistic Image Synthesis Using Photon Mapping" Page 107 Fig. 9.10 48 | 49 | 50 | 51 | 52 | CornellBox-Glossy.obj 53 | 54 | This can be matched with Henrik Jensen's "Global Illumination using Photon Maps" Page 17 Fig. 6 55 | Google Scholar link to paper: 56 | http://scholar.google.com/scholar?q=global+illumination+using+photon+maps+jensen&hl=en&as_sdt=0&as_vis=1&oi=schol 57 | 58 | 59 | 60 | 61 | CornellBox-Empty-Squashed.obj 62 | 63 | This is the box used in CornellBox-Water.obj, CornellBox-Sphere.obj, and CornellBox-Glossy.obj, with no spheres or water on the inside. 64 | 65 | 66 | 67 | 68 | Water.obj 69 | 70 | This is the water.obj used in CornellBox-Water.obj -------------------------------------------------------------------------------- /scenes/cornell-box/copyright.txt: -------------------------------------------------------------------------------- 1 | # A set of eight Cornell Boxes 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 | # Attribution 3.0 Unported (CC BY 3.0) License 7 | # http://creativecommons.org/licenses/by/3.0/ 8 | # 9 | # http://graphics.cs.williams.edu/data 10 | # 11 | 12 | 13 | -------------------------------------------------------------------------------- /scenes/cornell-box/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/cornell-box/index.png -------------------------------------------------------------------------------- /scenes/cornell-box/index.txt: -------------------------------------------------------------------------------- 1 | We are trying to create scenes similar to those in previous publications, but this 2 | is necessarily not a perfect match because in many cases, the original data are not 3 | available. 4 | 5 | 6 | 7 | 8 | CornellBox-Original.obj 9 | 10 | This can be matched with http://www.graphics.cornell.edu/online/box/data.html 11 | 12 | 13 | 14 | 15 | CornellBox-Mirror.obj 16 | 17 | This can be matched with http://www.graphics.cornell.edu/online/box/compare.html 18 | 19 | 20 | 21 | 22 | CornellBox-Empty-RG.obj 23 | 24 | This is the original Cornell Box without the small boxes inside of it. 25 | 26 | 27 | 28 | 29 | CornellBox-Empty-CO.obj 30 | 31 | This matches the colors of, simulation of the Cornell box was done by Michael F. Cohen and Donald P. Greenberg 32 | for the 1985 paper The Hemi-Cube, A Radiosity Solution for Complex Environments, 33 | Vol. 19, No. 3, July 1985, pp. 31-40 34 | 35 | 36 | 37 | 38 | CornellBox-Water.obj 39 | 40 | This can be matched with Henrik Jensen's "Realistic Image Synthesis Using Photon Mapping" Page 109 Fig. 9.14 41 | 42 | 43 | 44 | 45 | CornellBox-Sphere.obj 46 | 47 | This can be matched with Henrik Jensen's "Realistic Image Synthesis Using Photon Mapping" Page 107 Fig. 9.10 48 | 49 | 50 | 51 | 52 | CornellBox-Glossy.obj 53 | 54 | This can be matched with Henrik Jensen's "Global Illumination using Photon Maps" Page 17 Fig. 6 55 | Google Scholar link to paper: 56 | http://scholar.google.com/scholar?q=global+illumination+using+photon+maps+jensen&hl=en&as_sdt=0&as_vis=1&oi=schol 57 | 58 | 59 | 60 | 61 | CornellBox-Empty-Squashed.obj 62 | 63 | This is the box used in CornellBox-Water.obj, CornellBox-Sphere.obj, and CornellBox-Glossy.obj, with no spheres or water on the inside. 64 | 65 | 66 | 67 | 68 | Water.obj 69 | 70 | This is the water.obj used in CornellBox-Water.obj -------------------------------------------------------------------------------- /scenes/cube.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cubes/cube.obj", 3 | "output-file": "cube.exr", 4 | "output-width": 900, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [2.5, 2.85, -3.0], 8 | "lookat": [0.0, 1.0, 0.0], 9 | "focal": 1.6 10 | }, 11 | "lights": [ 12 | { "position": [4.5, 6.5, 3.0], "color255": [255, 255, 200], "intensity": 100.0 }, 13 | { "position": [4.5, 6.5, 3.2], "color255": [255, 255, 200], "intensity": 100.0 }, 14 | { "position": [4.5, 6.5, 3.4], "color255": [255, 255, 200], "intensity": 100.0 } 15 | ], 16 | "multisample": 100 17 | } 18 | -------------------------------------------------------------------------------- /scenes/cube1.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cubes/cube1.obj", 3 | "output-file": "cube1.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [2.5, 2.85, -3.0], 8 | "lookat": [0.0, 1.0, 0.0], 9 | "focal": 1.6 10 | }, 11 | "lights": [ 12 | { "position": [4.5, 6.5, 3.0], "color255": [255, 255, 200], "intensity": 70.0 }, 13 | { "position": [4.5, 6.5, 3.1], "color255": [255, 255, 200], "intensity": 70.0 }, 14 | { "position": [4.5, 6.5, 3.2], "color255": [255, 255, 200], "intensity": 70.0 }, 15 | { "position": [4.5, 5.5, -2.3], "color255": [255, 255, 200], "intensity": 70.0 } 16 | ], 17 | "multisample": 20, 18 | "rounds": 20 19 | } 20 | -------------------------------------------------------------------------------- /scenes/cube3-b.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cubes/cube3.obj", 3 | "output-file": "cube3-b.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [-0.5, 1.85, -4.5], 8 | "lookat": [1.0, 1.0, 1.0], 9 | "focal": 1.6, 10 | "lens-size": 0.03, 11 | "focus-plane": 1.75 12 | }, 13 | "lights": [ 14 | { "position": [4.5, 6.5, -2.0], "color255": [255, 255, 200], "intensity": 200.0, "size": 0.4 } 15 | ], 16 | "multisample": 40, 17 | "rounds": 20, 18 | "clamp": 5.0, 19 | "brdf": "ltc_beckmann", 20 | "russian": 0.6 21 | } 22 | -------------------------------------------------------------------------------- /scenes/cube3.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cubes/cube3.obj", 3 | "output-file": "cube3.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [1.5, 2.85, -4.0], 8 | "lookat": [1.0, 1.0, 1.0], 9 | "focal": 1.6 10 | }, 11 | "lights": [ 12 | { "position": [3.0, 6.0, -2.0], "color255": [255, 255, 200], "intensity": 400.0, "size": 0.4 } 13 | ], 14 | "multisample": 40, 15 | "rounds": 20, 16 | "clamp": 10.0, 17 | "brdf": "ltc_beckmann", 18 | "russian": 0.6 19 | } 20 | -------------------------------------------------------------------------------- /scenes/cube4.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cubes/cube4.obj", 3 | "output-file": "cube4.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [2.5, 2.85, -2.0], 8 | "lookat": [0.0, 1.0, 0.0], 9 | "focal": 2.0 10 | }, 11 | "lights": [ 12 | { "position": [4.5, 6.5, 3.0], "color255x": [255, 255, 200], "intensity": 15.0 } 13 | ], 14 | "multisample": 20, 15 | "rounds": 10 16 | } 17 | -------------------------------------------------------------------------------- /scenes/cube_flat.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cubes/cube_flat.obj", 3 | "output-file": "cube_flat.exr", 4 | "output-width": 800, 5 | "output-height": 800, 6 | "camera": { 7 | "position": [4.0, 0.0, 0.0], 8 | "lookat": [0.0, 0.0, 0.0], 9 | "focal": 2.0 10 | }, 11 | "lights": [ 12 | { "position": [4.5, 1.0, 2.0], "color255": [255, 255, 200], "intensity": 150.0 } 13 | ], 14 | "multisample": 20, 15 | "rounds": 10 16 | } 17 | -------------------------------------------------------------------------------- /scenes/cubes/cube.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'cube.blend' 2 | # Material Count: 2 3 | 4 | newmtl Material.001 5 | Ns 30.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.106281 0.119845 0.401702 8 | Ks 0.200000 0.200000 0.200000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | 13 | newmtl Material.002 14 | Ns 30.078431 15 | Ka 0.000000 0.000000 0.000000 16 | Kd 0.196956 0.028494 0.017628 17 | Ks 0.200000 0.200000 0.200000 18 | Ni 1.000000 19 | d 1.000000 20 | illum 2 21 | -------------------------------------------------------------------------------- /scenes/cubes/cube.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: 'cube.blend' 2 | # www.blender.org 3 | mtllib cube.mtl 4 | o Cube.001_Cube.002 5 | v -1.000000 0.000000 1.000000 6 | v -1.000000 2.000000 1.000000 7 | v -1.000000 0.000000 -1.000000 8 | v -1.000000 2.000000 -1.000000 9 | v 1.000000 0.000000 1.000000 10 | v 1.000000 2.000000 1.000000 11 | v 1.000000 0.000000 -1.000000 12 | v 1.000000 2.000000 -1.000000 13 | vn -1.000000 0.000000 0.000000 14 | vn 0.000000 0.000000 -1.000000 15 | vn 1.000000 0.000000 0.000000 16 | vn 0.000000 0.000000 1.000000 17 | vn 0.000000 -1.000000 0.000000 18 | vn 0.000000 1.000000 0.000000 19 | usemtl Material.001 20 | s off 21 | f 2//1 4//1 3//1 1//1 22 | f 4//2 8//2 7//2 3//2 23 | f 8//3 6//3 5//3 7//3 24 | f 6//4 2//4 1//4 5//4 25 | f 1//5 3//5 7//5 5//5 26 | f 6//6 8//6 4//6 2//6 27 | o Cube_Cube.001 28 | v -5.000000 0.000000 5.000000 29 | v -5.000000 10.000000 5.000000 30 | v -5.000000 0.000000 -5.000000 31 | v -5.000000 10.000000 -5.000000 32 | v 5.000000 0.000000 5.000000 33 | v 5.000000 10.000000 5.000000 34 | v 5.000000 0.000000 -5.000000 35 | v 5.000000 10.000000 -5.000000 36 | vn 1.000000 0.000000 0.000000 37 | vn 0.000000 0.000000 1.000000 38 | vn -1.000000 0.000000 0.000000 39 | vn 0.000000 0.000000 -1.000000 40 | vn 0.000000 1.000000 0.000000 41 | vn 0.000000 -1.000000 0.000000 42 | usemtl Material.002 43 | s off 44 | f 10//7 12//7 11//7 9//7 45 | f 12//8 16//8 15//8 11//8 46 | f 16//9 14//9 13//9 15//9 47 | f 14//10 10//10 9//10 13//10 48 | f 9//11 11//11 15//11 13//11 49 | f 14//12 16//12 12//12 10//12 50 | -------------------------------------------------------------------------------- /scenes/cubes/cube1.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'cube.blend' 2 | # Material Count: 2 3 | 4 | newmtl Material.001 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.106281 0.119845 0.401702 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | 13 | newmtl Material.002 14 | Ns 27.450980 15 | Ka 0.000000 0.000000 0.000000 16 | Kd 0.183861 0.026600 0.016456 17 | Ks 0.115563 0.056453 0.032751 18 | Ni 1.000000 19 | d 1.000000 20 | illum 2 21 | -------------------------------------------------------------------------------- /scenes/cubes/cube1.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: 'cube.blend' 2 | # www.blender.org 3 | mtllib cube1.mtl 4 | o Cube.003 5 | v -2.364373 -0.733273 0.976544 6 | v -2.364373 1.266726 0.976544 7 | v -2.364373 -0.733273 -1.023456 8 | v -2.364373 1.266726 -1.023456 9 | v -0.364373 -0.733273 0.976544 10 | v -0.364373 1.266726 0.976544 11 | v -0.364373 -0.733273 -1.023456 12 | v -0.364373 1.266726 -1.023456 13 | vn -1.000000 0.000000 0.000000 14 | vn 0.000000 0.000000 -1.000000 15 | vn 1.000000 0.000000 0.000000 16 | vn 0.000000 0.000000 1.000000 17 | vn 0.000000 -1.000000 0.000000 18 | vn 0.000000 1.000000 0.000000 19 | usemtl Material.001 20 | s off 21 | f 2//1 4//1 3//1 1//1 22 | f 4//2 8//2 7//2 3//2 23 | f 8//3 6//3 5//3 7//3 24 | f 6//4 2//4 1//4 5//4 25 | f 1//5 3//5 7//5 5//5 26 | f 6//6 8//6 4//6 2//6 27 | o Cube.002_Cube.000 28 | v -1.716310 -0.485418 2.496402 29 | v -1.716310 1.514582 2.496402 30 | v -1.716310 -0.485418 0.496402 31 | v -1.716310 1.514582 0.496402 32 | v 0.283690 -0.485418 2.496402 33 | v 0.283690 1.514582 2.496402 34 | v 0.283690 -0.485418 0.496402 35 | v 0.283690 1.514582 0.496402 36 | vn -1.000000 0.000000 0.000000 37 | vn 0.000000 0.000000 -1.000000 38 | vn 1.000000 0.000000 0.000000 39 | vn 0.000000 0.000000 1.000000 40 | vn 0.000000 -1.000000 0.000000 41 | vn 0.000000 1.000000 0.000000 42 | usemtl Material.001 43 | s off 44 | f 10//7 12//7 11//7 9//7 45 | f 12//8 16//8 15//8 11//8 46 | f 16//9 14//9 13//9 15//9 47 | f 14//10 10//10 9//10 13//10 48 | f 9//11 11//11 15//11 13//11 49 | f 14//12 16//12 12//12 10//12 50 | o Cube.001_Cube.002 51 | v -3.351130 0.000000 2.178533 52 | v -3.351130 2.000000 2.178533 53 | v -3.351130 0.000000 0.178533 54 | v -3.351130 2.000000 0.178533 55 | v -1.351130 0.000000 2.178533 56 | v -1.351130 2.000000 2.178533 57 | v -1.351130 0.000000 0.178533 58 | v -1.351130 2.000000 0.178533 59 | vn -1.000000 0.000000 0.000000 60 | vn 0.000000 0.000000 -1.000000 61 | vn 1.000000 0.000000 0.000000 62 | vn 0.000000 0.000000 1.000000 63 | vn 0.000000 -1.000000 0.000000 64 | vn 0.000000 1.000000 0.000000 65 | usemtl Material.001 66 | s off 67 | f 18//13 20//13 19//13 17//13 68 | f 20//14 24//14 23//14 19//14 69 | f 24//15 22//15 21//15 23//15 70 | f 22//16 18//16 17//16 21//16 71 | f 17//17 19//17 23//17 21//17 72 | f 22//18 24//18 20//18 18//18 73 | o Cube_Cube.001 74 | v -5.000000 0.000000 5.000000 75 | v -5.000000 10.000000 5.000000 76 | v -5.000000 0.000000 -5.000000 77 | v -5.000000 10.000000 -5.000000 78 | v 5.000000 0.000000 5.000000 79 | v 5.000000 10.000000 5.000000 80 | v 5.000000 0.000000 -5.000000 81 | v 5.000000 10.000000 -5.000000 82 | vn 1.000000 0.000000 0.000000 83 | vn 0.000000 0.000000 1.000000 84 | vn -1.000000 0.000000 0.000000 85 | vn 0.000000 0.000000 -1.000000 86 | vn 0.000000 1.000000 0.000000 87 | vn 0.000000 -1.000000 0.000000 88 | usemtl Material.002 89 | s off 90 | f 26//19 25//19 27//19 28//19 91 | f 28//20 27//20 31//20 32//20 92 | f 32//21 31//21 29//21 30//21 93 | f 30//22 29//22 25//22 26//22 94 | f 25//23 29//23 31//23 27//23 95 | f 30//24 26//24 28//24 32//24 96 | -------------------------------------------------------------------------------- /scenes/cubes/cube2.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'cube2.blend' 2 | # Material Count: 6 3 | 4 | newmtl Material.001 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.578434 0.578434 0.578434 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | 13 | newmtl Material.002 14 | Ns 96.078431 15 | Ka 0.000000 0.000000 0.000000 16 | Kd 0.358383 0.000962 0.000000 17 | Ks 0.500000 0.500000 0.500000 18 | Ni 1.000000 19 | d 1.000000 20 | illum 2 21 | 22 | newmtl Material.003 23 | Ns 96.078431 24 | Ka 0.000000 0.000000 0.000000 25 | Kd 0.001318 0.000000 0.191641 26 | Ks 0.500000 0.500000 0.500000 27 | Ni 1.000000 28 | d 1.000000 29 | illum 2 30 | 31 | newmtl Material.004 32 | Ns 96.078431 33 | Ka 0.000000 0.000000 0.000000 34 | Kd 0.000000 0.242558 0.001358 35 | Ks 0.500000 0.500000 0.500000 36 | Ni 1.000000 37 | d 1.000000 38 | illum 2 39 | 40 | newmtl Material.005 41 | Ns 96.078431 42 | Ka 0.000000 0.000000 0.000000 43 | Kd 0.640000 0.061934 0.000000 44 | Ks 0.500000 0.500000 0.500000 45 | Ni 1.000000 46 | d 1.000000 47 | illum 2 48 | 49 | newmtl Material.006 50 | Ns 96.078431 51 | Ka 0.000000 0.000000 0.000000 52 | Kd 0.640000 0.431849 0.017919 53 | Ks 0.500000 0.500000 0.500000 54 | Ni 1.000000 55 | d 1.000000 56 | illum 2 57 | -------------------------------------------------------------------------------- /scenes/cubes/cube2.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: 'cube2.blend' 2 | # www.blender.org 3 | mtllib cube2.mtl 4 | o Cube.005_Cube.006 5 | v -5.000000 -15.000000 5.000000 6 | v -5.000000 -5.000000 5.000000 7 | v -5.000000 -15.000000 -5.000000 8 | v -5.000000 -5.000000 -5.000000 9 | v 5.000000 -15.000000 5.000000 10 | v 5.000000 -5.000000 5.000000 11 | v 5.000000 -15.000000 -5.000000 12 | v 5.000000 -5.000000 -5.000000 13 | vn -1.000000 0.000000 0.000000 14 | vn 0.000000 0.000000 -1.000000 15 | vn 1.000000 0.000000 0.000000 16 | vn 0.000000 0.000000 1.000000 17 | vn 0.000000 -1.000000 0.000000 18 | vn 0.000000 1.000000 0.000000 19 | usemtl Material.006 20 | s off 21 | f 2//1 4//1 3//1 1//1 22 | f 4//2 8//2 7//2 3//2 23 | f 8//3 6//3 5//3 7//3 24 | f 6//4 2//4 1//4 5//4 25 | f 1//5 3//5 7//5 5//5 26 | f 6//6 8//6 4//6 2//6 27 | o Cube.004_Cube.005 28 | v -5.000000 -5.000000 15.000000 29 | v -5.000000 5.000000 15.000000 30 | v -5.000000 -5.000000 5.000000 31 | v -5.000000 5.000000 5.000000 32 | v 5.000000 -5.000000 15.000000 33 | v 5.000000 5.000000 15.000000 34 | v 5.000000 -5.000000 5.000000 35 | v 5.000000 5.000000 5.000000 36 | vn -1.000000 0.000000 0.000000 37 | vn 0.000000 0.000000 -1.000000 38 | vn 1.000000 0.000000 0.000000 39 | vn 0.000000 0.000000 1.000000 40 | vn 0.000000 -1.000000 0.000000 41 | vn 0.000000 1.000000 0.000000 42 | usemtl Material.004 43 | s off 44 | f 10//7 12//7 11//7 9//7 45 | f 12//8 16//8 15//8 11//8 46 | f 16//9 14//9 13//9 15//9 47 | f 14//10 10//10 9//10 13//10 48 | f 9//11 11//11 15//11 13//11 49 | f 14//12 16//12 12//12 10//12 50 | o Cube.003_Cube.004 51 | v -5.000000 -5.000000 -5.000000 52 | v -5.000000 5.000000 -5.000000 53 | v -5.000000 -5.000000 -15.000000 54 | v -5.000000 5.000000 -15.000000 55 | v 5.000000 -5.000000 -5.000000 56 | v 5.000000 5.000000 -5.000000 57 | v 5.000000 -5.000000 -15.000000 58 | v 5.000000 5.000000 -15.000000 59 | vn -1.000000 0.000000 0.000000 60 | vn 0.000000 0.000000 -1.000000 61 | vn 1.000000 0.000000 0.000000 62 | vn 0.000000 0.000000 1.000000 63 | vn 0.000000 -1.000000 0.000000 64 | vn 0.000000 1.000000 0.000000 65 | usemtl Material.003 66 | s off 67 | f 18//13 20//13 19//13 17//13 68 | f 20//14 24//14 23//14 19//14 69 | f 24//15 22//15 21//15 23//15 70 | f 22//16 18//16 17//16 21//16 71 | f 17//17 19//17 23//17 21//17 72 | f 22//18 24//18 20//18 18//18 73 | o Cube.002_Cube.003 74 | v -15.000000 -5.000000 5.000000 75 | v -15.000000 5.000000 5.000000 76 | v -15.000000 -5.000000 -5.000000 77 | v -15.000000 5.000000 -5.000000 78 | v -5.000000 -5.000000 5.000000 79 | v -5.000000 5.000000 5.000000 80 | v -5.000000 -5.000000 -5.000000 81 | v -5.000000 5.000000 -5.000000 82 | vn -1.000000 0.000000 0.000000 83 | vn 0.000000 0.000000 -1.000000 84 | vn 1.000000 0.000000 0.000000 85 | vn 0.000000 0.000000 1.000000 86 | vn 0.000000 -1.000000 0.000000 87 | vn 0.000000 1.000000 0.000000 88 | usemtl Material.005 89 | s off 90 | f 26//19 28//19 27//19 25//19 91 | f 28//20 32//20 31//20 27//20 92 | f 32//21 30//21 29//21 31//21 93 | f 30//22 26//22 25//22 29//22 94 | f 25//23 27//23 31//23 29//23 95 | f 30//24 32//24 28//24 26//24 96 | o Cube.001_Cube.002 97 | v -5.000000 5.000000 5.000000 98 | v -5.000000 15.000000 5.000000 99 | v -5.000000 5.000000 -5.000000 100 | v -5.000000 15.000000 -5.000000 101 | v 5.000000 5.000000 5.000000 102 | v 5.000000 15.000000 5.000000 103 | v 5.000000 5.000000 -5.000000 104 | v 5.000000 15.000000 -5.000000 105 | vn -1.000000 0.000000 0.000000 106 | vn 0.000000 0.000000 -1.000000 107 | vn 1.000000 0.000000 0.000000 108 | vn 0.000000 0.000000 1.000000 109 | vn 0.000000 -1.000000 0.000000 110 | vn 0.000000 1.000000 0.000000 111 | usemtl Material.001 112 | s off 113 | f 34//25 36//25 35//25 33//25 114 | f 36//26 40//26 39//26 35//26 115 | f 40//27 38//27 37//27 39//27 116 | f 38//28 34//28 33//28 37//28 117 | f 33//29 35//29 39//29 37//29 118 | f 38//30 40//30 36//30 34//30 119 | o Cube_Cube.001 120 | v 5.000000 -5.000000 5.000000 121 | v 5.000000 5.000000 5.000000 122 | v 5.000000 -5.000000 -5.000000 123 | v 5.000000 5.000000 -5.000000 124 | v 15.000000 -5.000000 5.000000 125 | v 15.000000 5.000000 5.000000 126 | v 15.000000 -5.000000 -5.000000 127 | v 15.000000 5.000000 -5.000000 128 | vn -1.000000 0.000000 0.000000 129 | vn 0.000000 0.000000 -1.000000 130 | vn 1.000000 0.000000 0.000000 131 | vn 0.000000 0.000000 1.000000 132 | vn 0.000000 -1.000000 0.000000 133 | vn 0.000000 1.000000 0.000000 134 | usemtl Material.002 135 | s off 136 | f 42//31 44//31 43//31 41//31 137 | f 44//32 48//32 47//32 43//32 138 | f 48//33 46//33 45//33 47//33 139 | f 46//34 42//34 41//34 45//34 140 | f 41//35 43//35 47//35 45//35 141 | f 46//36 48//36 44//36 42//36 142 | -------------------------------------------------------------------------------- /scenes/cubes/cube3.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'cube3.blend' 2 | # Material Count: 5 3 | 4 | newmtl Material.001 5 | Ns 5.764706 6 | Kd 0.202354 0.111246 0.008121 7 | Ks 0.032258 0.032258 0.032258 8 | 9 | newmtl Material.002_refl 10 | Ns 8000 11 | Ks 0.80 0.80 1.00 12 | Kd 0.01 0.04 0.01 13 | 14 | newmtl Material.003_refl 15 | Ns 8000 16 | Ks 1.00 1.00 0.60 17 | Kd 0.04 0.02 0.00 18 | 19 | newmtl Material_refl 20 | Ns 8000 21 | Ks 1.00 0.60 1.00 22 | Kd 0.00 0.02 0.04 23 | 24 | newmtl Material.004 25 | Ns 5.078431 26 | Kd 0.640000 0.640000 0.640000 27 | Ks 0.500000 0.500000 0.500000 28 | 29 | -------------------------------------------------------------------------------- /scenes/cubes/cube4.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'cube4.blend' 2 | # Material Count: 3 3 | 4 | newmtl Material 5 | Ns 31.372549 6 | Ka 0.064516 0.064516 0.064516 7 | Kd 0.373761 0.000000 0.000439 8 | Ks 0.387097 0.352803 0.352803 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 3 13 | 14 | newmtl Material.001 15 | Ns 11.764706 16 | Ka 1.000000 1.000000 1.000000 17 | Kd 0.510616 0.293287 0.030699 18 | Ks 0.032258 0.032258 0.032258 19 | Ke 0.000000 0.000000 0.000000 20 | Ni 1.000000 21 | d 1.000000 22 | illum 2 23 | 24 | newmtl Material.002 25 | Ns 31.372549 26 | Ka 0.064516 0.064516 0.064516 27 | Kd 0.000000 0.373761 0.347522 28 | Ks 0.387097 0.387097 0.387097 29 | Ke 0.000000 0.000000 0.000000 30 | Ni 1.000000 31 | d 1.000000 32 | illum 3 33 | -------------------------------------------------------------------------------- /scenes/cubes/cube_flat.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'cube_flat.blend' 2 | # Material Count: 2 3 | 4 | newmtl Material.001 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.106316 0.048700 0.181267 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | 13 | newmtl Material.002 14 | Ns 96.078431 15 | Ka 0.000000 0.000000 0.000000 16 | Kd 0.007227 0.640000 0.042597 17 | Ks 0.500000 0.500000 0.500000 18 | Ni 1.000000 19 | d 1.000000 20 | illum 2 21 | -------------------------------------------------------------------------------- /scenes/cubes/cube_flat.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: 'cube_flat.blend' 2 | # www.blender.org 3 | mtllib cube_flat.mtl 4 | o Cube.001_Cube.002 5 | v -1.000000 -1.000000 1.000000 6 | v -1.000000 1.000000 1.000000 7 | v -1.000000 -1.000000 -1.000000 8 | v -1.000000 1.000000 -1.000000 9 | v 1.000000 -1.000000 1.000000 10 | v 1.000000 1.000000 1.000000 11 | v 1.000000 -1.000000 -1.000000 12 | v 1.000000 1.000000 -1.000000 13 | vn -1.000000 0.000000 0.000000 14 | vn 0.000000 0.000000 -1.000000 15 | vn 1.000000 0.000000 0.000000 16 | vn 0.000000 0.000000 1.000000 17 | vn 0.000000 -1.000000 0.000000 18 | vn 0.000000 1.000000 0.000000 19 | usemtl Material.002 20 | s off 21 | f 2//1 4//1 3//1 1//1 22 | f 4//2 8//2 7//2 3//2 23 | f 8//3 6//3 5//3 7//3 24 | f 6//4 2//4 1//4 5//4 25 | f 1//5 3//5 7//5 5//5 26 | f 6//6 8//6 4//6 2//6 27 | o Cube_Cube.001 28 | v -5.000000 -5.000000 5.000000 29 | v -5.000000 5.000000 5.000000 30 | v -5.000000 -5.000000 -5.000000 31 | v -5.000000 5.000000 -5.000000 32 | v 5.000000 -5.000000 5.000000 33 | v 5.000000 5.000000 5.000000 34 | v 5.000000 -5.000000 -5.000000 35 | v 5.000000 5.000000 -5.000000 36 | vn 1.000000 0.000000 0.000000 37 | vn 0.000000 0.000000 1.000000 38 | vn -1.000000 0.000000 0.000000 39 | vn 0.000000 0.000000 -1.000000 40 | vn 0.000000 1.000000 0.000000 41 | vn 0.000000 -1.000000 0.000000 42 | usemtl Material.001 43 | s off 44 | f 10//7 9//7 11//7 12//7 45 | f 12//8 11//8 15//8 16//8 46 | f 16//9 15//9 13//9 14//9 47 | f 14//10 13//10 9//10 10//10 48 | f 9//11 13//11 15//11 11//11 49 | f 14//12 10//12 12//12 16//12 50 | -------------------------------------------------------------------------------- /scenes/dragon-sponza.json: -------------------------------------------------------------------------------- 1 | { 2 | "materials": [{ 3 | "name": "sp_00_pod", 4 | "specular255": [209, 197, 181], 5 | "exponent": 800.0, 6 | "diffuse-texture": "sponza-fixed/KAMEN.JPG", 7 | "bump-map": "sponza-fixed/KAMEN-bump.jpg" 8 | }], 9 | "scene": [{ 10 | "file": "dragon-sponza/dragon.obj", 11 | "import-materials": true 12 | }], 13 | "output-file": "dragon-sponza.exr", 14 | "output-width": 1280, 15 | "output-height": 720, 16 | "camera": { 17 | "position": [-1.3, 2.2, -0.5], 18 | "lookat": [0.0, 1.9, 0.0], 19 | "focal": 1.0 20 | }, 21 | "lights": [{ // Direct sun lighting 22 | "position": [-5.0, 35.0, -15.0], 23 | "color": [1.0, 0.85, 0.6], 24 | "intensity": 2000.0, 25 | "size": 0.7 26 | }], 27 | "multisample": 800, 28 | "rounds": 4, 29 | "sky": { 30 | "envmap": "envmap/cloudy1.hdr", 31 | "intensity": 0.9 32 | }, 33 | "bumpscale": 12, 34 | "clamp": 5.0, 35 | "russian": 0.7, 36 | "brdf": "ltc_ggx" 37 | } 38 | -------------------------------------------------------------------------------- /scenes/envmap/cloudy1.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/envmap/cloudy1.hdr -------------------------------------------------------------------------------- /scenes/envmap/license.txt: -------------------------------------------------------------------------------- 1 | cloudy1.hdr was provided by https://www.hdri-hub.com on CC Attribution 3.0 license. 2 | -------------------------------------------------------------------------------- /scenes/floor.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "floor/floor.obj", 3 | "output-file": "floor.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 2, 7 | "camera": { 8 | "position": [3.0, 1.0, 0.3], 9 | "lookat": [0.0, 0.5, 0.0], 10 | "focal": 2.0 11 | }, 12 | "multisample": 80, 13 | "rounds": 50, 14 | "bumpscale": 0.8, 15 | "brdf": "ltc_beckmann" 16 | } 17 | -------------------------------------------------------------------------------- /scenes/floor/bump2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/floor/bump2.png -------------------------------------------------------------------------------- /scenes/floor/bump3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/floor/bump3.png -------------------------------------------------------------------------------- /scenes/floor/floor.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'floor.blend' 2 | # Material Count: 2 3 | 4 | newmtl Material.001 5 | Ns 1500.000000 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.381936 0.381936 0.381936 8 | Ks 0.822581 0.822581 0.822581 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | map_Kd grid.png 14 | map_Bump intensity.jpg 15 | 16 | newmtl light 17 | Ns 96.078431 18 | Ka 1.000000 1.000000 1.000000 19 | Kd 0.573627 0.684905 0.800000 20 | Ks 0.500000 0.500000 0.500000 21 | Ke 0.367121 0.438339 0.512000 22 | Ni 1.000000 23 | d 1.000000 24 | illum 2 25 | -------------------------------------------------------------------------------- /scenes/floor/floor.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.76 (sub 0) OBJ File: 'floor.blend' 2 | # www.blender.org 3 | mtllib floor.mtl 4 | o Plane.001 5 | v -3.656968 1.895468 0.434779 6 | v -3.656968 1.013719 0.434779 7 | v -3.656968 1.895468 -0.446969 8 | v -3.656968 1.013719 -0.446969 9 | v -3.656968 1.656996 -0.073562 10 | v -3.656968 1.656996 0.061373 11 | v -3.656968 1.522061 0.196308 12 | v -3.656968 1.387126 0.196308 13 | v -3.656968 1.387126 -0.208497 14 | v -3.656968 1.522061 -0.208497 15 | v -3.656968 1.252191 0.061373 16 | v -3.656968 1.252191 -0.073562 17 | vn 1.000000 0.000000 0.000000 18 | usemtl light 19 | s off 20 | f 12//1 9//1 5//1 21 | f 6//1 1//1 7//1 22 | f 8//1 2//1 11//1 23 | f 6//1 7//1 8//1 24 | f 10//1 3//1 5//1 25 | f 5//1 6//1 8//1 26 | f 8//1 11//1 12//1 27 | f 12//1 4//1 9//1 28 | f 9//1 10//1 5//1 29 | f 5//1 8//1 12//1 30 | o Plane 31 | v -3.664732 0.000000 3.000000 32 | v 2.335268 0.000000 3.000000 33 | v -3.664732 0.000000 -3.000000 34 | v 2.335268 0.000000 -3.000000 35 | vt 4.000000 0.000000 36 | vt 4.000000 4.000000 37 | vt 0.000000 4.000000 38 | vt 0.000100 0.000100 39 | vn 0.000000 1.000000 0.000000 40 | usemtl Material.001 41 | s off 42 | f 14/1/2 16/2/2 15/3/2 43 | f 13/4/2 14/1/2 15/3/2 44 | -------------------------------------------------------------------------------- /scenes/floor/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/floor/grid.png -------------------------------------------------------------------------------- /scenes/floor/grid2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/floor/grid2.png -------------------------------------------------------------------------------- /scenes/floor/intensity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/floor/intensity.jpg -------------------------------------------------------------------------------- /scenes/floor2.json: -------------------------------------------------------------------------------- 1 | { 2 | "output-file": "floor2.exr", 3 | "output-width": 1280, 4 | "output-height": 720, 5 | "recursion-max": 2, 6 | "camera": { 7 | "position": [3.0, 0.9, 0.2], 8 | "lookat": [0.0, 0.5, 0.0], 9 | "fov": 95 10 | }, 11 | "multisample": 400, 12 | "rounds": 3, 13 | "bumpscale": 0.9, 14 | "clamp": 150.0, 15 | "scene": [{ 16 | "primitive": "plane", 17 | "axis": "Y", 18 | "scale": [2, 1, 2], 19 | "material": "floor", 20 | "texture-scale": 4 21 | }], 22 | "materials": [{ 23 | "name": "floor", 24 | "brdf": "ltc_beckmann", 25 | "specular": [0.9, 0.9, 0.9], 26 | "diffuse-texture": "floor/grid2.png", 27 | "bump-map": "floor/intensity.jpg", 28 | "exponent": 1500 29 | }], 30 | "sky": { 31 | "envmap": "envmap/cloudy1.hdr", 32 | "rotate": 90, 33 | "intensity": 1.0 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /scenes/floor3.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "output-file": "floor3.exr", 4 | "output-width": 1280, 5 | "output-height": 720, 6 | "recursion-max": 2, 7 | "camera": { 8 | "position": [3.0, 0.9, 0.2], 9 | "lookat": [0.0, 0.5, 0.0], 10 | "fov": 95 11 | }, 12 | "multisample": 200, 13 | "rounds": 3, 14 | "bumpscale": 2.0, 15 | "clamp": 150.0, 16 | "scene": [{ 17 | "primitive": "plane", 18 | "axis": "Y", 19 | "scale": [2, 1, 2], 20 | "material": "floor", 21 | "texture-scale": 4 22 | },{ 23 | "file": "teapot/teapot.obj", 24 | "material": "teapot", 25 | "scale": [0.0, 0.0, 0.0] 26 | }], 27 | "materials": [{ 28 | "name": "floor", 29 | "brdf": "diffuse", 30 | "specular": [0.4, 0.4, 0.4], 31 | "diffuse-texture": "floor/grid2.png", 32 | "bump-map": "floor/intensity.jpg" 33 | },{ 34 | "name": "teapot", 35 | "brdf": "ltc_beckmann", 36 | "specular": [0.4, 0.4, 0.4], 37 | "diffuse": [0.55, 0.55, 0.55], 38 | "exponent": 1500 39 | }], 40 | "sky": { 41 | "envmap": "envmap/cloudy1.hdr", 42 | "rotate": 90, 43 | "intensity": 1.0 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /scenes/json/sponza-global4.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "../sponza-fixed/sponza.obj", 3 | "output-file": "sponza-global4.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "multisample": 40, 7 | "rounds": 40, 8 | "sky": { 9 | "color": [185, 220, 240], 10 | "intensity": 0.9 11 | }, 12 | "bumpscale": 20, 13 | "clamp": 5.0, 14 | "russian": 0.6, 15 | "brdf": "ltc_ggx", 16 | 17 | "camera": { 18 | "position": [-13, 1.8, -1.2], 19 | "lookat": [3.0, 3.5, 3.2], 20 | "upvector": [0.0, 1.0, 0.0], 21 | "focal": 1.2 22 | }, 23 | "lights": [ 24 | { // Sun light 25 | "position": [-5.0, 50.0, -20.0], 26 | "color": [255, 240, 200], 27 | "intensity": 20000.0, 28 | "size": 1.0 29 | } 30 | ] 31 | /* 32 | "materials": [ 33 | { 34 | 35 | } 36 | ], 37 | "scene" : [ 38 | { 39 | "file": "../sponza-fixed/sponza.obj", 40 | "named-materials": true, 41 | "import-materials": true 42 | } 43 | ] 44 | */ 45 | } 46 | -------------------------------------------------------------------------------- /scenes/primitives1.json: -------------------------------------------------------------------------------- 1 | { 2 | "scene": [{ 3 | "primitive": "cube", 4 | "scale": [3.0, 1.0, 2.0], 5 | "translate": [0, 0, 0], 6 | "rotate": [0, -80, 0], 7 | "material": "mat1" 8 | },{ 9 | "primitive": "plane", 10 | "scale": [5.0, 1.0, 5.0], 11 | "translate": [0, -0.5, 0], 12 | "material": "mat2" 13 | }], 14 | "materials": [{ 15 | "name": "mat1", 16 | "brdf": "diffuse", 17 | "diffuse255": [180, 200, 150] 18 | },{ 19 | "name": "mat2", 20 | "brdf": "diffuse", 21 | "diffuse255": [240, 120, 80] 22 | }], 23 | "output-file": "primitives1.exr", 24 | "output-width": 600, 25 | "output-height": 360, 26 | "multisample": 60, 27 | "rounds": 30, 28 | "russian": 0.6, 29 | "sky": { 30 | "envmap": "envmap/cloudy1.hdr", 31 | "rotate": 40, 32 | "intensity": 1.0 33 | }, 34 | "camera": { 35 | "position": [6, 2.5, 8], 36 | "lookat": [0, 2, 0], 37 | "fov": 90 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /scenes/rubiks-bump.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "rubiks-bump/rubiks.obj", 3 | "output-file": "rubiks-bump.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [3.2, 2.0, -2.3], 8 | "lookat": [0.0, 0.0, 0.0], 9 | "focal": 1.6 10 | }, 11 | "lights": [{ 12 | "position": [4.0, 4.0, -4.0], 13 | "color255": [255, 255, 255], 14 | "intensity": 300.0 15 | }], 16 | "multisample": 40, 17 | "rounds": 10, 18 | "bumpscale": 15, 19 | "russian": 0.75 20 | } 21 | -------------------------------------------------------------------------------- /scenes/rubiks-bump/bump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/rubiks-bump/bump.png -------------------------------------------------------------------------------- /scenes/rubiks-bump/rubiks.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'rubik.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material.001 5 | Ns 3.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | map_Kd rubiks.png 13 | map_bump bump.png 14 | -------------------------------------------------------------------------------- /scenes/rubiks-bump/rubiks.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: 'rubik.blend' 2 | # www.blender.org 3 | mtllib rubiks.mtl 4 | o Cube 5 | v 1.000000 -1.000000 -1.000000 # 6 | v 1.000000 -1.000000 1.000000 # 7 | v -1.000000 -1.000000 1.000000 # 8 | v -1.000000 -1.000000 -1.000000 # 9 | v 1.000000 1.000000 -0.999999 # 10 | v 0.999999 1.000000 1.000000 # 11 | v -1.000000 1.000000 1.000000 # 12 | v -1.000000 1.000000 -1.000000 # 13 | vt -0.000002 1.000000 14 | vt 0.000001 0.500007 15 | vt 0.333331 0.500036 16 | vt 0.000002 0.000003 17 | vt 0.333337 -0.000002 18 | vt 0.666668 0.500000 19 | vt 1.000004 1.000002 20 | vt 0.666666 1.000000 21 | vt 0.333332 1.000006 22 | vt 1.000038 0.500144 23 | vt 0.666690 -0.000009 24 | vt 1.000069 0.500140 25 | vt 1.000001 0.000002 26 | vn 0.000000 -1.000000 0.000000 27 | vn 0.000000 1.000000 0.000000 28 | vn 1.000000 0.000000 0.000000 29 | vn -0.000000 0.000000 1.000000 30 | vn -1.000000 -0.000000 -0.000000 31 | vn 0.000000 0.000000 -1.000000 32 | usemtl Material.001 33 | s off 34 | f 2/1/1 3/2/1 4/3/1 35 | f 8/2/2 7/4/2 6/5/2 36 | f 5/6/3 6/3/3 2/5/3 37 | f 6/7/4 7/8/4 3/6/4 38 | f 3/9/5 7/3/5 8/6/5 39 | f 1/10/6 4/6/6 8/11/6 40 | f 1/9/1 2/1/1 4/3/1 41 | f 5/3/2 8/2/2 6/5/2 42 | f 1/11/3 5/6/3 2/5/3 43 | f 2/12/4 6/7/4 3/6/4 44 | f 4/8/5 3/9/5 8/6/5 45 | f 5/13/6 1/10/6 8/11/6 46 | -------------------------------------------------------------------------------- /scenes/rubiks-bump/rubiks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/rubiks-bump/rubiks.png -------------------------------------------------------------------------------- /scenes/rubiks-jpg/rubiks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/rubiks-jpg/rubiks.jpg -------------------------------------------------------------------------------- /scenes/rubiks-jpg/rubiks.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'rubik.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material.001 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | map_Kd rubiks.jpg 13 | -------------------------------------------------------------------------------- /scenes/rubiks-jpg/rubiks.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: 'rubik.blend' 2 | # www.blender.org 3 | mtllib rubiks.mtl 4 | o Cube 5 | v 1.000000 -1.000000 -1.000000 # 6 | v 1.000000 -1.000000 1.000000 # 7 | v -1.000000 -1.000000 1.000000 # 8 | v -1.000000 -1.000000 -1.000000 # 9 | v 1.000000 1.000000 -0.999999 # 10 | v 0.999999 1.000000 1.000000 # 11 | v -1.000000 1.000000 1.000000 # 12 | v -1.000000 1.000000 -1.000000 # 13 | vt -0.000002 1.000000 14 | vt 0.000001 0.500007 15 | vt 0.333331 0.500036 16 | vt 0.000002 0.000003 17 | vt 0.333337 -0.000002 18 | vt 0.666668 0.500000 19 | vt 1.000004 1.000002 20 | vt 0.666666 1.000000 21 | vt 0.333332 1.000006 22 | vt 1.000038 0.500144 23 | vt 0.666690 -0.000009 24 | vt 1.000069 0.500140 25 | vt 1.000001 0.000002 26 | vn 0.000000 -1.000000 0.000000 27 | vn 0.000000 1.000000 0.000000 28 | vn 1.000000 0.000000 0.000000 29 | vn -0.000000 0.000000 1.000000 30 | vn -1.000000 -0.000000 -0.000000 31 | vn 0.000000 0.000000 -1.000000 32 | usemtl Material.001 33 | s off 34 | f 2/1/1 3/2/1 4/3/1 35 | f 8/2/2 7/4/2 6/5/2 36 | f 5/6/3 6/3/3 2/5/3 37 | f 6/7/4 7/8/4 3/6/4 38 | f 3/9/5 7/3/5 8/6/5 39 | f 1/10/6 4/6/6 8/11/6 40 | f 1/9/1 2/1/1 4/3/1 41 | f 5/3/2 8/2/2 6/5/2 42 | f 1/11/3 5/6/3 2/5/3 43 | f 2/12/4 6/7/4 3/6/4 44 | f 4/8/5 3/9/5 8/6/5 45 | f 5/13/6 1/10/6 8/11/6 46 | -------------------------------------------------------------------------------- /scenes/rubiks.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "rubiks/rubiks.obj", 3 | "output-file": "rubiks.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [3.2, 2.0, -2.3], 8 | "lookat": [0.0, 0.0, 0.0], 9 | "focal": 1.6 10 | }, 11 | "lights": [{ 12 | "position": [4.0, 4.0, -4.0], 13 | "color255": [255, 255, 255], 14 | "intensity": 300.0 15 | }], 16 | "multisample": 40, 17 | "rounds": 10, 18 | "russian": 0.75 19 | } 20 | -------------------------------------------------------------------------------- /scenes/rubiks/rubiks.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'rubik.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material.001 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | map_Kd rubiks.png 13 | -------------------------------------------------------------------------------- /scenes/rubiks/rubiks.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.74 (sub 0) OBJ File: 'rubik.blend' 2 | # www.blender.org 3 | mtllib rubiks.mtl 4 | o Cube 5 | v 1.000000 -1.000000 -1.000000 # 6 | v 1.000000 -1.000000 1.000000 # 7 | v -1.000000 -1.000000 1.000000 # 8 | v -1.000000 -1.000000 -1.000000 # 9 | v 1.000000 1.000000 -0.999999 # 10 | v 0.999999 1.000000 1.000000 # 11 | v -1.000000 1.000000 1.000000 # 12 | v -1.000000 1.000000 -1.000000 # 13 | vt -0.000002 1.000000 14 | vt 0.000001 0.500007 15 | vt 0.333331 0.500036 16 | vt 0.000002 0.000003 17 | vt 0.333337 -0.000002 18 | vt 0.666668 0.500000 19 | vt 1.000004 1.000002 20 | vt 0.666666 1.000000 21 | vt 0.333332 1.000006 22 | vt 1.000038 0.500144 23 | vt 0.666690 -0.000009 24 | vt 1.000069 0.500140 25 | vt 1.000001 0.000002 26 | vn 0.000000 -1.000000 0.000000 27 | vn 0.000000 1.000000 0.000000 28 | vn 1.000000 0.000000 0.000000 29 | vn -0.000000 0.000000 1.000000 30 | vn -1.000000 -0.000000 -0.000000 31 | vn 0.000000 0.000000 -1.000000 32 | usemtl Material.001 33 | s off 34 | f 2/1/1 3/2/1 4/3/1 35 | f 8/2/2 7/4/2 6/5/2 36 | f 5/6/3 6/3/3 2/5/3 37 | f 6/7/4 7/8/4 3/6/4 38 | f 3/9/5 7/3/5 8/6/5 39 | f 1/10/6 4/6/6 8/11/6 40 | f 1/9/1 2/1/1 4/3/1 41 | f 5/3/2 8/2/2 6/5/2 42 | f 1/11/3 5/6/3 2/5/3 43 | f 2/12/4 6/7/4 3/6/4 44 | f 4/8/5 3/9/5 8/6/5 45 | f 5/13/6 1/10/6 8/11/6 46 | -------------------------------------------------------------------------------- /scenes/rubiks/rubiks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/rubiks/rubiks.png -------------------------------------------------------------------------------- /scenes/sibenik.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "sibenik/sibenik.obj", 3 | "output-file": "sibenik.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [-12.0, -12.0, 2.0], 8 | "lookat": [0.0, -8.0, 0.0], 9 | "focal": 1.2, 10 | "lens-size": 0.035, 11 | "focus-plane": 14.0 12 | }, 13 | "lights": [{ 14 | "position": [5.0, -1.0, 0.0], 15 | "color255": [255, 250, 210], 16 | "intensity": 0.8, 17 | "size": 0.8 18 | }], 19 | "multisample": 50, 20 | "rounds": 10, 21 | "bumpscale": 10, 22 | "russian": 0.8, 23 | "clamp": 0.4, 24 | "brdf": "ltc_ggx" 25 | } 26 | -------------------------------------------------------------------------------- /scenes/sibenik/KAMEN-stup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sibenik/KAMEN-stup.png -------------------------------------------------------------------------------- /scenes/sibenik/copyright.txt: -------------------------------------------------------------------------------- 1 | Sibenik Cathedral model by Marko Dabrovic. 2 | Modified Rafał Cieślak 2016, fixed normals & triangulation. 3 | Downloaded from http://graphics.cs.williams.edu/data/meshes.xml 4 | where it was present with the following copyright notice: 5 | 6 | ====== 7 | 8 | Sibenik by Marko Dabrovic, with holes corrected by Kenzie Lamar at 9 | Vicarious Visions and high-resolution texture and bump maps painted by 10 | Morgan McGuire. 11 | 12 | Downloaded from http://igad.nhtv.nl/~bikker/ 13 | 14 | Originally from http://hdri.cgtechniques.com/~sibenik2/download/ 15 | "The Sibenik cathedral is a project by Marko Dabrovic form www.RNA.HR . 16 | It's very rich modeled but isn't completly finished yet... there are some holes in the mesh which only hurts if you look at them." 17 | -------------------------------------------------------------------------------- /scenes/sibenik/kamen-bump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sibenik/kamen-bump.png -------------------------------------------------------------------------------- /scenes/sibenik/kamen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sibenik/kamen.png -------------------------------------------------------------------------------- /scenes/sibenik/mramor6x6-bump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sibenik/mramor6x6-bump.png -------------------------------------------------------------------------------- /scenes/sibenik/mramor6x6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sibenik/mramor6x6.png -------------------------------------------------------------------------------- /scenes/sibenik/sibenik.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 15 3 | 4 | newmtl kamen_zid 5 | Ns 7.843137 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.734118 0.730588 0.674118 8 | Ks 0.000000 0.000000 0.000000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.500000 11 | d 1.000000 12 | illum 2 13 | map_Kd kamen.png 14 | map_Bump kamen-bump.png 15 | map_Ka kamen.png 16 | 17 | newmtl kamen_zid_parapet 18 | Ns 7.843137 19 | Ka 0.000000 0.000000 0.000000 20 | Kd 0.734118 0.730588 0.674118 21 | Ks 0.000000 0.000000 0.000000 22 | Ke 0.000000 0.000000 0.000000 23 | Ni 1.500000 24 | d 1.000000 25 | illum 2 26 | map_Kd KAMEN-stup.png 27 | map_Ka KAMEN-stup.png 28 | 29 | newmtl kamen_zid_prozor 30 | Ns 7.843137 31 | Ka 0.000000 0.000000 0.000000 32 | Kd 0.734118 0.730588 0.674118 33 | Ks 0.000000 0.000000 0.000000 34 | Ke 0.000000 0.000000 0.000000 35 | Ni 1.500000 36 | d 1.000000 37 | illum 2 38 | map_Kd kamen.png 39 | map_Bump kamen-bump.png 40 | map_Ka kamen.png 41 | 42 | newmtl pod 43 | Ns 7.843137 44 | Ka 0.000000 0.000000 0.000000 45 | Kd 0.734118 0.709412 0.674118 46 | Ks 0.000000 0.000000 0.000000 47 | Ke 0.000000 0.000000 0.000000 48 | Ni 1.500000 49 | d 1.000000 50 | illum 2 51 | map_Kd mramor6x6.png 52 | map_Bump mramor6x6-bump.png 53 | map_Ka mramor6x6.png 54 | 55 | newmtl pod_rub 56 | Ns 7.843137 57 | Ka 0.000000 0.000000 0.000000 58 | Kd 0.734118 0.730588 0.674118 59 | Ks 0.000000 0.000000 0.000000 60 | Ke 0.000000 0.000000 0.000000 61 | Ni 1.500000 62 | d 1.000000 63 | illum 2 64 | map_Kd kamen.png 65 | map_Bump kamen-bump.png 66 | map_Ka kamen.png 67 | 68 | newmtl pod_tepih 69 | Ns 7.843137 70 | Ka 0.000000 0.000000 0.000000 71 | Kd 0.546274 0.219608 0.183922 72 | Ks 0.000000 0.000000 0.000000 73 | Ke 0.000000 0.000000 0.000000 74 | Ni 1.500000 75 | d 1.000000 76 | illum 2 77 | 78 | newmtl rozeta 79 | Ns 7.843137 80 | Ka 0.000000 0.000000 0.000000 81 | Kd 0.734118 0.730588 0.674118 82 | Ks 0.000000 0.000000 0.000000 83 | Ke 0.000000 0.000000 0.000000 84 | Ni 1.500000 85 | d 1.000000 86 | illum 2 87 | map_Kd KAMEN-stup.png 88 | map_Ka KAMEN-stup.png 89 | 90 | newmtl sprljci 91 | Ns 7.843137 92 | Ka 0.000000 0.000000 0.000000 93 | Kd 0.784314 0.784314 0.784314 94 | Ks 0.000000 0.000000 0.000000 95 | Ke 0.000000 0.000000 0.000000 96 | Ni 1.500000 97 | d 1.000000 98 | illum 2 99 | 100 | newmtl staklo 101 | Ns 254.901961 102 | Ka 0.000000 0.000000 0.000000 103 | Kd 0.784314 0.784314 0.784314 104 | Ks 0.784314 0.784314 0.784314 105 | Ke 0.000000 0.000000 0.000000 106 | Ni 1.500000 107 | d 0.100000 108 | illum 2 109 | 110 | newmtl staklo_crveno 111 | Ns 254.901961 112 | Ka 0.000000 0.000000 0.000000 113 | Kd 0.441176 0.103922 0.049020 114 | Ks 0.882353 0.207843 0.098039 115 | Ke 0.000000 0.000000 0.000000 116 | Ni 1.500000 117 | d 0.800000 118 | illum 2 119 | 120 | newmtl staklo_plavo 121 | Ns 254.901961 122 | Ka 0.000000 0.000000 0.000000 123 | Kd 0.041177 0.072549 0.392157 124 | Ks 0.800000 0.800000 0.800000 125 | Ke 0.000000 0.000000 0.000000 126 | Ni 1.500000 127 | d 1.000000 128 | illum 6 129 | 130 | newmtl staklo_zeleno 131 | Ns 254.901961 132 | Ka 0.000000 0.000000 0.000000 133 | Kd 0.033333 0.315686 0.037255 134 | Ks 0.800000 0.800000 0.800000 135 | Ke 0.000000 0.000000 0.000000 136 | Ni 1.500000 137 | d 1.000000 138 | illum 6 139 | 140 | newmtl staklo_zuto 141 | Ns 254.901961 142 | Ka 0.000000 0.000000 0.000000 143 | Kd 0.500000 0.445098 0.003922 144 | Ks 0.800000 0.800000 0.800000 145 | Ke 0.000000 0.000000 0.000000 146 | Ni 1.500000 147 | d 1.000000 148 | illum 2 149 | 150 | newmtl stupovi 151 | Ns 7.843137 152 | Ka 0.000000 0.000000 0.000000 153 | Kd 0.734118 0.730588 0.674118 154 | Ks 0.000000 0.000000 0.000000 155 | Ke 0.000000 0.000000 0.000000 156 | Ni 1.500000 157 | d 1.000000 158 | illum 2 159 | map_Kd KAMEN-stup.png 160 | map_Ka KAMEN-stup.png 161 | 162 | newmtl zid_vani 163 | Ns 7.843137 164 | Ka 0.000000 0.000000 0.000000 165 | Kd 0.734118 0.730588 0.674118 166 | Ks 0.000000 0.000000 0.000000 167 | Ke 0.000000 0.000000 0.000000 168 | Ni 1.500000 169 | d 1.000000 170 | illum 2 171 | map_Kd kamen.png 172 | map_Bump kamen-bump.png 173 | map_Ka kamen.png 174 | -------------------------------------------------------------------------------- /scenes/sibenik2.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "sibenik/sibenik.obj", 3 | "output-file": "sibenik2.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [-8.0, -6.0, 1.5], 8 | "lookat": [-16.0, -5.0, -1.0], 9 | "focal": 1.6 10 | }, 11 | "lights": [{ 12 | "position": [-45.0, 15.0, 20.0], 13 | "color255": [255, 250, 210], 14 | "intensity": 15000.0, 15 | "size": 0.15 16 | }], 17 | "multisample": 50, 18 | "rounds": 20, 19 | "sky":{ 20 | "color255": [246, 249, 254], 21 | "intensity": 0.2 22 | }, 23 | "bumpscale": 10, 24 | "russian": 0.8, 25 | "clamp": 4.0, 26 | "brdf": "ltc_beckmann", 27 | "thinglass": ["staklo"] 28 | } 29 | -------------------------------------------------------------------------------- /scenes/sibenik3.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "sibenik/sibenik.obj", 3 | "output-file": "sibenik3.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [-18.0, -14.0, 1.2], 8 | "lookat": [0.0, -9.0, 0.0], 9 | "focal": 1.5 10 | }, 11 | "lights": [{ 12 | "position": [-5.0, 30.0, -20.0], 13 | "color255": [255, 250, 210], 14 | "intensity": 15000.0, 15 | "size": 0.2 16 | }], 17 | "multisample": 60, 18 | "rounds": 40, 19 | "sky":{ 20 | "color255": [246, 249, 254], 21 | "intensity": 0.15 22 | }, 23 | "bumpscale": 8, 24 | "russian": 0.8, 25 | "clamp": 4.0, 26 | "brdf": "ltc_beckmann", 27 | "thinglass": ["staklo"] 28 | } 29 | -------------------------------------------------------------------------------- /scenes/sponza-fixed/00_skap.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/00_skap.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/01_STUB-bump.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/01_STUB-bump.jpg -------------------------------------------------------------------------------- /scenes/sponza-fixed/01_STUB.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/01_STUB.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/01_S_ba.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/01_S_ba.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/01_St_kp-bump.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/01_St_kp-bump.jpg -------------------------------------------------------------------------------- /scenes/sponza-fixed/01_St_kp.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/01_St_kp.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/KAMEN-bump.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/KAMEN-bump.jpg -------------------------------------------------------------------------------- /scenes/sponza-fixed/KAMEN-stup.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/KAMEN-stup.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/KAMEN.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/KAMEN.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/copyright.txt: -------------------------------------------------------------------------------- 1 | Dabrovic Sponza model, originally by Marco Dabrovic. 2 | Downloaded from http://graphics.cs.williams.edu/data/meshes.xml 3 | 4 | Copyright 2002 Marko Dabrovic 5 | Morgan McGuire painted bump maps. 6 | Kenzie Lamar assigned UVs and converted to OBJ. 7 | 8 | Modified by Rafał Cieślak 2016, converted to Blender, minor fixes. 9 | -------------------------------------------------------------------------------- /scenes/sponza-fixed/prozor1.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/prozor1.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/reljef-bump.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/reljef-bump.jpg -------------------------------------------------------------------------------- /scenes/sponza-fixed/reljef.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/reljef.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/sp_luk-bump.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/sp_luk-bump.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/sp_luk.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/sp_luk.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/vrata_ko.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/vrata_ko.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/vrata_kr.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/vrata_kr.JPG -------------------------------------------------------------------------------- /scenes/sponza-fixed/x01_st.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafalcieslak/RGK/664e4e43a6b601d5f6415879afc8e37a50a291cd/scenes/sponza-fixed/x01_st.JPG -------------------------------------------------------------------------------- /scenes/sponza.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "sponza-fixed/sponza.obj", 3 | "output-file": "sponza.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 2, 7 | "camera": { 8 | "position": [-9.5, 1.5, -1.5], 9 | "lookat": [3.0, 3.0, -0.5], 10 | "focal": 1.6 11 | }, 12 | "lights": [{ // Sun lighting 13 | "position": [-16.0, 100.0, -10.0], 14 | "color255": [255, 240, 200], 15 | "intensity": 20000.0 16 | }], 17 | "multisample": 40, 18 | "rounds": 20, 19 | "sky": { 20 | "color255": [145, 200, 235], 21 | "intensity": 0.3 22 | }, 23 | "bumpscale": 10 24 | } 25 | -------------------------------------------------------------------------------- /scenes/sponza.rtc: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "cubes/cube3.obj", 3 | "output-file": "cube3.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "camera": { 7 | "position": [1.5, 2.85, -4.0], 8 | "lookat": [1.0, 1.0, 1.0], 9 | "focal": 1.6 10 | }, 11 | "lights": [ 12 | { "position": [3.0, 6.0, -2.0], "color": [255, 255, 200], "intensity": 400.0, "size": 0.4 } 13 | ], 14 | "multisample": 40, 15 | "rounds": 20, 16 | "clamp": 10.0, 17 | "brdf": "ltc_beckmann", 18 | "russian": 0.6 19 | } 20 | -------------------------------------------------------------------------------- /scenes/sponza2.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "sponza-fixed/sponza.obj", 3 | "output-file": "sponza2.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera": { 8 | "position": [-13, 1.8, -1.2], 9 | "lookat": [3.0, 3.5, 3.2], 10 | "focal": 1.2 11 | }, 12 | "lights": [{ // Sun lighting 13 | "position": [-16.0, 100.0, -10.0], 14 | "color255": [255, 240, 200], 15 | "intensity": 20000.0, 16 | "size": 1.0 17 | }], 18 | "multisample": 40, 19 | "rounds": 40, 20 | "sky": { 21 | "color255": [185, 220, 240], 22 | "intensity": 1.2 23 | }, 24 | "bumpscale": 20, 25 | "clamp": 5.0, 26 | "russian": 0.6, 27 | "brdf": "ltc_ggx" 28 | } 29 | -------------------------------------------------------------------------------- /scenes/sponza3.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "sponza-fixed/sponza.obj", 3 | "output-file": "sponza3.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera": { 8 | "position": [-1.8, 7.2, -4.7], 9 | "lookat": [3.0, 6.7, 1.2], 10 | "focal": 1.4 11 | }, 12 | "lights": [{ // Sun lighting 13 | "position": [-16.0, 100.0, -10.0], 14 | "color255": [255, 240, 200], 15 | "intensity": 20000.0, 16 | "size": 1.0 17 | }], 18 | "multisample": 40, 19 | "rounds": 40, 20 | "sky": { 21 | "color255": [185, 220, 240], 22 | "intensity": 0.4 23 | }, 24 | "bumpscale": 20, 25 | "clamp": 5.0, 26 | "russian": 0.6, 27 | "brdf": "ltc_ggx" 28 | } 29 | -------------------------------------------------------------------------------- /scenes/sponza4.json: -------------------------------------------------------------------------------- 1 | { 2 | "model-file": "sponza-fixed/sponza.obj", 3 | "output-file": "sponza4.exr", 4 | "output-width": 1200, 5 | "output-height": 900, 6 | "recursion-max": 4, 7 | "camera": { 8 | "position": [-13, 1.8, -1.2], 9 | "lookat": [3.0, 3.5, 3.2], 10 | "focal": 1.2 11 | }, 12 | "lights": [{ // Sun lighting 13 | "position": [-5.0, 50.0, -20.0], 14 | "color255": [255, 240, 200], 15 | "intensity": 20000.0, 16 | "size": 1.0 17 | }], 18 | "multisample": 40, 19 | "rounds": 40, 20 | "sky": { 21 | "color255": [185, 220, 240], 22 | "intensity": 0.9 23 | }, 24 | "bumpscale": 20, 25 | "clamp": 5.0, 26 | "russian": 0.6, 27 | "brdf": "ltc_ggx" 28 | } 29 | -------------------------------------------------------------------------------- /scenes/sponza4b.json: -------------------------------------------------------------------------------- 1 | { 2 | "materials": [{ 3 | "name": "sp_00_pod", 4 | "brdf": "ltc_ggx_diffuse", 5 | "specular255": [209, 197, 181], 6 | "roughness": 0.1, 7 | "diffuse-texture": "sponza-fixed/KAMEN.JPG", 8 | "bump-map": "sponza-fixed/KAMEN-bump.jpg" 9 | }], 10 | "scene": [{ 11 | "file": "sponza-fixed/sponza.obj", 12 | "import-materials": true 13 | }], 14 | "output-file": "sponza4.exr", 15 | "output-width": 1280, 16 | "output-height": 720, 17 | "camera": { 18 | "position": [-13, 1.8, -1.2], 19 | "lookat": [3.0, 3.5, 3.2], 20 | "fov": 90, 21 | "lens-size": 0.02, 22 | "focus-plane": 15 23 | }, 24 | "lights": [{ // Sun lighting 25 | //"position": [-5.0, 50.0, -20.0], 26 | //"position": [-2.0, 50.0, -5.0], 27 | "position": [-2.0, 50.0, -50.0], 28 | "color": [1.0, 0.85, 0.6], 29 | "intensity": 2000.0, 30 | "size": 1.0 31 | }], 32 | "multisample": 90, 33 | "rounds": 40, 34 | "sky": { 35 | "color255": [185, 220, 240], 36 | "intensity": 0.9 37 | }, 38 | "bumpscale": 10, 39 | "clamp": 5.0, 40 | "russian": 0.6 41 | } 42 | -------------------------------------------------------------------------------- /scenes/sponza4c.json: -------------------------------------------------------------------------------- 1 | { 2 | "materials": [{ 3 | "name": "sp_00_pod", 4 | "brdf": "ltc_ggx", 5 | //"specular255": [209, 197, 181], 6 | "exponent": 400.0, 7 | "color-texture": "sponza-fixed/KAMEN.JPG", 8 | "bump-map": "sponza-fixed/KAMEN-bump.jpg" 9 | }], 10 | "scene": [{ 11 | "file": "sponza-fixed/sponza.obj", 12 | "import-materials": true 13 | }], 14 | "output-file": "sponza4c.exr", 15 | "output-width": 1280, 16 | "output-height": 900, 17 | "camera": { 18 | "position": [-11.3, 7.2, -1.9], 19 | "lookat": [3.0, 7.5, 6.2], 20 | "fov": 85 21 | }, 22 | "lights": [{ // Direct sun lighting 23 | "position": [-5.0, 35.0, -15.0], 24 | "color": [1.0, 0.85, 0.6], 25 | "intensity": 2000.0, 26 | "size": 0.7 27 | }], 28 | "multisample": 900, 29 | "rounds": 4, 30 | "sky": { 31 | "envmap": "envmap/cloudy1.hdr", 32 | "intensity": 0.9 33 | }, 34 | "bumpscale": 10, 35 | "clamp": 5.0, 36 | "russian": 0.7 37 | } 38 | -------------------------------------------------------------------------------- /scenes/teapot.json: -------------------------------------------------------------------------------- 1 | { 2 | // The teapot model can be downloaded from http://graphics.cs.williams.edu/data/meshes.xml 3 | "output-file": "teapot.exr", 4 | "output-width": 1280, 5 | "output-height": 720, 6 | "recursion-max": 3, 7 | "camera": { 8 | "position": [1.0, 1.6, -2.4], 9 | "lookat": [0.0, 0.3, 0.0], 10 | "fov": 95 11 | }, 12 | "multisample": 200, 13 | "rounds": 5, 14 | "clamp": 150.0, 15 | "scene": [{ 16 | "primitive": "plane", 17 | "axis": "Y", 18 | "scale": [1.8, 1, 1.8], 19 | "material": "floor" 20 | },{ 21 | "file": "teapot/teapot.obj", 22 | "scale": [0.01, 0.01, 0.01], 23 | "translate": [1.0, 0.0, 1.0], 24 | "smooth-normals": true, 25 | "material": "teapot1" 26 | },{ 27 | "file": "teapot/teapot.obj", 28 | "scale": [0.01, 0.01, 0.01], 29 | "translate": [0.0, 0.0, 0.0], 30 | "smooth-normals": true, 31 | "material": "teapot2" 32 | },{ 33 | "file": "teapot/teapot.obj", 34 | "scale": [0.01, 0.01, 0.01], 35 | "translate": [-1.0, 0.0, -1.0], 36 | "smooth-normals": true, 37 | "material": "teapot3" 38 | }], 39 | "materials": [{ 40 | "name": "floor", 41 | "brdf": "diffuse", 42 | "diffuse": [0.35, 0.28, 0.2] 43 | },{ 44 | "name": "teapot1", 45 | "brdf": "ltc_ggx", 46 | "specular": [0.2, 0.2, 0.2], 47 | "diffuse": [0.8, 0.8, 0.8], 48 | "roughness": 0.1 49 | },{ 50 | "name": "teapot2", 51 | "brdf": "ltc_beckmann", 52 | "specular": [0.8, 0.8, 0.8], 53 | "diffuse": [0.2, 0.2, 0.2], 54 | "roughness": 0.1 55 | },{ 56 | "name": "teapot3", 57 | "brdf": "ltc_beckmann", 58 | "specular": [0.8, 0.6, 0.6], 59 | "diffuse": [0.2, 0.16, 0.16], 60 | "rougnhess": 0.6 61 | }], 62 | "sky": { 63 | "envmap": "envmap/cloudy1.hdr", 64 | "rotate": 90, 65 | "intensity": 1.0 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /scenes/teapots.json: -------------------------------------------------------------------------------- 1 | { 2 | // The teapot model can be downloaded from http://graphics.cs.williams.edu/data/meshes.xml 3 | "output-file": "teapots.exr", 4 | "output-width": 1280, 5 | "output-height": 720, 6 | "recursion-max": 10, 7 | "camera": { 8 | "position": [1.0, 1.2, -2.4], 9 | "lookat": [0.0, 0.3, 0.0], 10 | "fov": 95 11 | }, 12 | "multisample": 200, 13 | "rounds": 5, 14 | "clamp": 45.0, 15 | "bumpscale": 1.0, 16 | "output-scale": 1.2, 17 | "scene": [{ 18 | "primitive": "plane", 19 | "axis": "Y", 20 | "scale": [2.0, 1, 2.0], 21 | "texture-scale": [2.0, 2.0, 2.0], 22 | "material": "floor" 23 | },{ 24 | "file": "teapot/teapot.obj", 25 | "scale": [0.01, 0.01, 0.01], 26 | "translate": [1.0, 0.0, 1.0], 27 | "smooth-normals": true, 28 | "material": "teapot1" 29 | },{ 30 | "file": "teapot/teapot.obj", 31 | "scale": [0.01, 0.01, 0.01], 32 | "translate": [0.0, 0.0, 0.0], 33 | "smooth-normals": true, 34 | "material": "teapot2" 35 | },{ 36 | "file": "teapot/teapot.obj", 37 | "scale": [0.01, 0.01, 0.01], 38 | "translate": [-1.0, 0.0, -1.0], 39 | "smooth-normals": true, 40 | "material": "teapot3" 41 | }], 42 | "materials": [{ 43 | "name": "floor", 44 | "brdf": "ltc_beckmann", 45 | "color": [0.7, 0.7, 0.7], 46 | "bump-map": "floor/intensity.jpg", 47 | "exponent": 800 48 | },{ 49 | "name": "teapot1_m1", 50 | "brdf": "ltc_ggx", 51 | "color": [0.2, 0.2, 0.2], 52 | "exponent": 1500 53 | },{ 54 | "name": "teapot1_m2", 55 | "brdf": "diffuse", 56 | "diffuse": [0.4, 0.8, 0.6] 57 | },{ 58 | "name": "teapot1", 59 | "brdf": "mix", 60 | "material1": "teapot1_m1", 61 | "material2": "teapot1_m2", 62 | "amount": 0.5 63 | },{ 64 | "name": "teapot2", 65 | "brdf": "ltc_beckmann", 66 | "color": [0.8, 0.8, 0.8], 67 | "exponent": 15000 68 | },{ 69 | "name": "teapot3", 70 | "brdf": "ltc_beckmann", 71 | "color": [0.8, 0.6, 0.6], 72 | "exponent": 80 73 | }], 74 | "sky": { 75 | "envmap": "envmap/cloudy1.hdr", 76 | "rotate": 90, 77 | "intensity": 1.0 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | link_directories( 2 | ${png++_LIBRARY_DIRS} 3 | ${assimp_LIBRARY_DIRS} 4 | ${JPEG_LIBRARY_DIRS} 5 | ${OPENEXR_LIBRARY_DIRS} 6 | ) 7 | 8 | include_directories( 9 | ${GLM_INCLUDE_DIRS} 10 | ${png++_INCLUDE_DIRS} 11 | ${assimp_INCLUDE_DIRS} 12 | ${JPEG_INCLUDE_DIRS} 13 | ${OPENEXR_INCLUDE_DIRS} 14 | SYSTEM ../external/ 15 | ) 16 | 17 | add_definitions( 18 | -std=c++11 19 | -Wall 20 | -Wextra 21 | -Werror 22 | # Debug config: 23 | # -g 24 | # Test config: 25 | -O3 26 | # Release config: 27 | # -O3 -DNDEBUG -Wno-unused 28 | ) 29 | 30 | file(GLOB SOURCES 31 | ./*.cpp 32 | ./LTC/*.cpp 33 | ./bxdf/*.cpp 34 | ../external/*.cpp 35 | ) 36 | 37 | add_executable( 38 | ${EXECUTABLE_NAME} 39 | ${SOURCES} 40 | ) 41 | 42 | ## SET_TARGET_PROPERTIES(RGK PROPERTIES LINK_FLAGS -pg) 43 | 44 | target_link_libraries( 45 | ${EXECUTABLE_NAME} 46 | ${assimp_LIBRARIES} 47 | ${PNG_LIBRARY} 48 | ${JPEG_LIBRARY} 49 | ${OPENEXR_LIBRARIES} 50 | pthread 51 | ) 52 | 53 | add_custom_command( 54 | TARGET ${EXECUTABLE_NAME} POST_BUILD 55 | COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" "${CMAKE_BINARY_DIR}/" 56 | ) 57 | -------------------------------------------------------------------------------- /src/LRU.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __LRU_HPP__ 2 | #define __LRU_HPP__ 3 | 4 | #include 5 | #include 6 | 7 | /* Least Recently Used cache buffer implementation. 8 | * All operations are O(1). 9 | */ 10 | template 11 | class LRUBuffer{ 12 | public: 13 | LRUBuffer(unsigned int maxsize) : maxsize_(maxsize) {} 14 | unsigned int size() const {return elements_.size();} 15 | void Use(T elem){ 16 | // Test if this element already exists in the buffer 17 | if(elem_map_.count(elem) > 0){ 18 | // Erase it from the current position 19 | typename std::list::iterator it = elem_map_[elem]; 20 | elements_.erase(it); 21 | } 22 | // Add the element to the head of the list 23 | auto it = elements_.insert(elements_.begin(), elem); 24 | // Place the iterator in the map 25 | elem_map_[elem] = it; 26 | // If the buffer is too large now 27 | if(elements_.size() > maxsize_){ 28 | // Erase the least recently used element 29 | elem_map_.erase(elements_.back()); 30 | elements_.pop_back(); 31 | } 32 | } 33 | typename std::list::iterator begin() {return elements_.begin();} 34 | typename std::list::iterator end() {return elements_.end();} 35 | private: 36 | unsigned int maxsize_; 37 | std::list elements_; 38 | std::unordered_map::iterator> elem_map_; 39 | }; 40 | 41 | #endif // __LRU_HPP__ 42 | -------------------------------------------------------------------------------- /src/LTC/ltc.hpp: -------------------------------------------------------------------------------- 1 | #include "../global_config.hpp" 2 | #include "../glm.hpp" 3 | 4 | struct mat33 5 | { 6 | operator glm::mat3() const 7 | { 8 | return glm::mat3(m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8]); 9 | } 10 | 11 | double m[9]; 12 | }; 13 | 14 | struct LTCdef{ 15 | const int size; 16 | const mat33* tabM; 17 | const float* tabAmplitude; 18 | }; 19 | 20 | class LTC{ 21 | public: 22 | // Returns PDF value of a LTC approximation for a given normal 23 | // vector, incoming/reflected vectors, and roughness. 24 | static float GetPDF(LTCdef ltc, glm::vec3 N, glm::vec3 Vr, glm::vec3 Vi, float alpha, bool debug = false); 25 | static float GetPDFZ(LTCdef ltc, glm::vec3 Vr, glm::vec3 Vi, float alpha, bool debug = false); 26 | // Given a random Z-oriented vector rand_hscos, this method 27 | // applies the linear transform that approximates the LTC BRDF. 28 | static glm::vec3 GetRandom(LTCdef ltc, glm::vec3 normal, glm::vec3 incoming, float roughness, glm::vec3 rand_hscos, bool debug = false); 29 | static glm::vec3 GetRandomZ(LTCdef ltc, glm::vec3 incoming, float roughness, glm::vec3 rand_hscos, bool debug = false); 30 | 31 | static const LTCdef Beckmann; 32 | static const LTCdef GGX; 33 | private: 34 | static std::pair get_bilinear(LTCdef ltc, const float theta, const float alpha, bool debug = false); 35 | }; 36 | -------------------------------------------------------------------------------- /src/brdf.hpp: -------------------------------------------------------------------------------- 1 | /*#ifndef __BRDF_HPP__ 2 | #define __BRDF_HPP__ 3 | 4 | #include "glm.hpp" 5 | #include "radiance.hpp" 6 | #include 7 | #include 8 | 9 | class BRDF{ 10 | public: 11 | virtual float PdfSpec(glm::vec3 N, glm::vec3 Vi, glm::vec3 Vr, bool debug = false) const = 0; 12 | virtual float PdfDiff() const = 0; 13 | Spectrum Apply(Spectrum kD, Spectrum kS, glm::vec3 N, glm::vec3 Vi, glm::vec3 Vr, bool debug = false) const{ 14 | float d = PdfDiff(); 15 | float s = PdfSpec(N,Vi,Vr, debug); 16 | IFDEBUG std::cout << "d = " << d << ", s = " << s << std::endl; 17 | return kD*d + kS*s; 18 | } 19 | virtual std::tuple GetRay(glm::vec3 normal, glm::vec3 inc, Spectrum diffuse, Spectrum specular, glm::vec2 sample, bool debug = false) const; 20 | }; 21 | 22 | class BRDFDiffuseCosine : public BRDF{ 23 | public: 24 | virtual float PdfSpec(glm::vec3 N, glm::vec3 Vi, glm::vec3 Vr, bool debug = false) const override; 25 | virtual float PdfDiff() const override; 26 | }; 27 | 28 | class BRDFPhongEnergy : public BRDF{ 29 | public: 30 | BRDFPhongEnergy(float exponent) : exponent(exponent) {} 31 | virtual float PdfSpec(glm::vec3 N, glm::vec3 Vi, glm::vec3 Vr, bool debug = false) const override; 32 | virtual float PdfDiff() const override; 33 | private: 34 | float exponent; 35 | }; 36 | 37 | class BRDFCookTorr : public BRDF{ 38 | public: 39 | BRDFCookTorr(float phong_exponent, float ior); 40 | virtual float PdfSpec(glm::vec3 N, glm::vec3 Vi, glm::vec3 Vr, bool debug = false) const override; 41 | virtual float PdfDiff() const override; 42 | private: 43 | float roughness; 44 | float F0; 45 | }; 46 | 47 | class BRDFLTCBeckmann : public BRDF{ 48 | public: 49 | BRDFLTCBeckmann(float phong_exponent); 50 | virtual float PdfSpec(glm::vec3 N, glm::vec3 Vi, glm::vec3 Vr, bool debug = false) const override; 51 | virtual float PdfDiff() const override; 52 | virtual std::tuple GetRay(glm::vec3 normal, glm::vec3 inc, Spectrum diffuse, Spectrum specular, glm::vec2 sample, bool debug = false) const override; 53 | private: 54 | float roughness; 55 | }; 56 | class BRDFLTCGGX : public BRDF{ 57 | public: 58 | BRDFLTCGGX(float phong_exponent); 59 | virtual float PdfSpec(glm::vec3 N, glm::vec3 Vi, glm::vec3 Vr, bool debug = false) const override; 60 | virtual float PdfDiff() const override; 61 | virtual std::tuple GetRay(glm::vec3 normal, glm::vec3 inc, Spectrum diffuse, Spectrum specular, glm::vec2 sample, bool debug = false) const override; 62 | private: 63 | float roughness; 64 | }; 65 | 66 | #endif // __BRDF_HPP__ 67 | */ 68 | -------------------------------------------------------------------------------- /src/camera.cpp: -------------------------------------------------------------------------------- 1 | #include "camera.hpp" 2 | 3 | #include "utils.hpp" 4 | #include "glm.hpp" 5 | #include "random_utils.hpp" 6 | 7 | Camera::Camera(glm::vec3 pos, glm::vec3 la, glm::vec3 up, float yview, float xview, int xres, int yres, float focus_plane, float ls){ 8 | origin = pos; 9 | lookat = la; 10 | cameraup = up; 11 | 12 | xsize = xres; 13 | ysize = yres; 14 | 15 | lens_size = ls; 16 | 17 | direction = glm::normalize( lookat - origin); 18 | cameraleft = glm::normalize(glm::cross(cameraup, direction)); 19 | cameraup = glm::normalize(glm::cross(cameraleft, direction)); 20 | 21 | viewscreen_x = - xview * cameraleft * focus_plane; 22 | viewscreen_y = yview * cameraup * focus_plane; 23 | viewscreen = origin + direction * focus_plane - 0.5f * viewscreen_y - 0.5f * viewscreen_x; 24 | } 25 | 26 | glm::vec3 Camera::GetViewScreenPoint(float x, float y) const { 27 | glm::vec3 xo = x * viewscreen_x; 28 | glm::vec3 yo = y * viewscreen_y; 29 | return viewscreen + xo + yo; 30 | } 31 | 32 | Ray Camera::GetPixelRay(int x, int y, int xres, int yres, glm::vec2 subcoords) const { 33 | glm::vec2 off = subcoords; 34 | glm::vec3 p = GetViewScreenPoint( (x + off.x) / (float)(xres), 35 | (y + off.y) / (float)(yres) ); 36 | glm::vec3 o = origin; 37 | return Ray(o, p - o); 38 | } 39 | Ray Camera::GetPixelRayLens(int x, int y, int xres, int yres, glm::vec2 subcoords, glm::vec2 lenssample) const{ 40 | glm::vec2 off = subcoords; 41 | glm::vec3 p = GetViewScreenPoint( (x + off.x) / (float)(xres), 42 | (y + off.y) / (float)(yres) ); 43 | glm::vec2 lenso = RandomUtils::Sample2DToDiscUniform(lenssample) * lens_size; 44 | glm::vec3 o = origin + lenso.x * cameraleft + lenso.y * cameraup; 45 | return Ray(o, p - o); 46 | } 47 | 48 | bool Camera::GetCoordsFromDirection(glm::vec3 dir, int& /*out*/ x, int& /*out*/ y, bool debug) const{ 49 | (void)debug; 50 | // TODO: Rewrite this entirely. 51 | 52 | glm::vec3 N = direction; 53 | float q = glm::dot(dir, N); 54 | if(q < 0.0001) return false; // parallel 55 | float t = glm::dot(viewscreen - origin,N) / q; 56 | if(t <= 0) return false; // oriented outside camera 57 | //IFDEBUG std::cout << "t: " << t << std::endl; 58 | glm::vec3 p = origin + dir * t; 59 | 60 | glm::vec3 V = viewscreen; 61 | glm::vec3 v1 = viewscreen_x; 62 | glm::vec3 v2 = viewscreen_y; 63 | 64 | glm::vec3 vp = p - V; 65 | //IFDEBUG std::cout << "vp: " << vp << std::endl; 66 | float plen = glm::length(vp); 67 | // Cast vp onto v1 and v2 68 | float v1_cast_len = plen * (glm::dot(glm::normalize(vp), glm::normalize(v1))); 69 | float v2_cast_len = plen * (glm::dot(glm::normalize(vp), glm::normalize(v2))); 70 | //IFDEBUG std::cout << "lens: " << v1_cast_len << " " << v2_cast_len << std::endl; 71 | float x_ratio = v1_cast_len / glm::length(v1); 72 | float y_ratio = v2_cast_len / glm::length(v2); 73 | 74 | //IFDEBUG std::cout << "ratios: " << x_ratio << " " << y_ratio << std::endl; 75 | 76 | if(x_ratio < 0.0f || x_ratio > 1.0f || y_ratio < 0.0f || y_ratio > 1.0f) return false; 77 | 78 | x = xsize * x_ratio; 79 | y = ysize * y_ratio; 80 | 81 | return true; 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/camera.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __CAMERA_HPP__ 2 | #define __CAMERA_HPP__ 3 | 4 | #include "glm.hpp" 5 | #include "ray.hpp" 6 | 7 | class Camera{ 8 | public: 9 | Camera(glm::vec3 pos, glm::vec3 la, glm::vec3 up, float yview, float xview, int xsize, int ysize, float focus_plane = 1.0f, float lens_size = 0.0f); 10 | 11 | /* xres, yres - targetted output image resolution 12 | x, y - pixel coordinates 13 | subres - grid resolution for dividning the (x,y) pixel into subpixels 14 | subx, suby - the coordinates of subpixel within (x,y) pixel for requesting ray 15 | */ 16 | 17 | Ray GetRay(glm::vec2 coords) const; 18 | 19 | Ray GetPixelRay(int x, int y, int xres, int yres, glm::vec2 subcoords) const; 20 | Ray GetPixelRayLens(int x, int y, int xres, int yres, glm::vec2 subcoords, glm::vec2 lenssample) const; 21 | 22 | bool IsSimple() const {return lens_size == 0.0f;} 23 | 24 | // Returns false if direction is not within camera view 25 | bool GetCoordsFromDirection(glm::vec3 dir, int& /*out*/ x, int& /*out*/ y, bool debug = false) const; 26 | public: 27 | glm::vec3 origin; 28 | glm::vec3 lookat; 29 | glm::vec3 direction; 30 | 31 | glm::vec3 cameraup; 32 | glm::vec3 cameraleft; 33 | 34 | glm::vec3 viewscreen; 35 | glm::vec3 viewscreen_x; 36 | glm::vec3 viewscreen_y; 37 | 38 | float lens_size; 39 | 40 | int xsize; 41 | int ysize; 42 | 43 | glm::vec3 GetViewScreenPoint(float x, float y) const; 44 | 45 | }; 46 | 47 | #endif // __CAMERA_HPP__ 48 | -------------------------------------------------------------------------------- /src/config.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_HPP__ 2 | #define __CONFIG_HPP__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "glm.hpp" 10 | #include "primitives.hpp" 11 | #include "camera.hpp" 12 | #include "../external/json/json.h" 13 | 14 | class Scene; 15 | 16 | struct ConfigFileException : public std::runtime_error{ 17 | ConfigFileException(const std::string& what ) : std::runtime_error(what) {} 18 | }; 19 | 20 | enum class RenderLimitMode{ 21 | Rounds, 22 | Timed, 23 | }; 24 | 25 | class Config{ 26 | public: 27 | std::string config_file_path; 28 | 29 | std::string comment; 30 | std::string output_file; 31 | unsigned int recursion_level = 40; 32 | unsigned int xres, yres; 33 | unsigned int multisample = 1; 34 | float bumpmap_scale = 10.0f; 35 | float clamp = 100000.0f; 36 | float russian = -1.0f; 37 | float output_scale = -1.0f; 38 | RenderLimitMode render_limit_mode = RenderLimitMode::Rounds; 39 | unsigned int render_rounds = 1; 40 | unsigned int render_minutes = -1; 41 | bool force_fresnell = false; 42 | unsigned int reverse = 0; 43 | //std::string brdf = "cooktorr"; 44 | std::vector thinglass; 45 | 46 | virtual Camera GetCamera(float rotation) const = 0; 47 | virtual void InstallLights(Scene& scene) const = 0; 48 | virtual void InstallScene(Scene& scene) const = 0; 49 | virtual void InstallMaterials(Scene& scene) const = 0; 50 | virtual void InstallSky(Scene& scene) const = 0; 51 | virtual void PerformPostCheck() const = 0; 52 | protected: 53 | Config(){}; 54 | }; 55 | 56 | class ConfigRTC : public Config{ 57 | public: 58 | static std::shared_ptr CreateFromFile(std::string path); 59 | virtual Camera GetCamera(float rotation) const override; 60 | virtual void InstallLights(Scene& scene) const override; 61 | virtual void InstallScene(Scene& scene) const override; 62 | virtual void InstallMaterials(Scene& scene) const override; 63 | virtual void InstallSky(Scene& scene) const override; 64 | virtual void PerformPostCheck() const override; 65 | private: 66 | ConfigRTC(){}; 67 | 68 | // Pre-fetching all values when the file is loaded 69 | std::string model_file; 70 | glm::vec3 camera_position; 71 | glm::vec3 camera_lookat; 72 | glm::vec3 camera_upvector; 73 | float yview; 74 | std::vector lights; 75 | float lens_size = 0.0f; 76 | float focus_plane = 1.0f; 77 | Color sky_color = Color(0.0, 0.0, 0.0); 78 | float sky_brightness = 2.0; 79 | std::string brdf; 80 | }; 81 | 82 | class ConfigJSON : public Config{ 83 | public: 84 | static std::shared_ptr CreateFromFile(std::string path); 85 | virtual Camera GetCamera(float rotation) const override; 86 | virtual void InstallLights(Scene& scene) const override; 87 | virtual void InstallScene(Scene& scene) const override; 88 | virtual void InstallMaterials(Scene& scene) const override; 89 | virtual void InstallSky(Scene& scene) const override; 90 | virtual void PerformPostCheck() const override; 91 | private: 92 | ConfigJSON(){}; 93 | 94 | mutable Json::Value root; 95 | }; 96 | 97 | #endif // __CONFIG_HPP__ 98 | -------------------------------------------------------------------------------- /src/glm.cpp: -------------------------------------------------------------------------------- 1 | #include "glm.hpp" 2 | 3 | glm::quat RotationBetweenVectors(glm::vec3 start, glm::vec3 dest){ 4 | start = normalize(start); 5 | dest = normalize(dest); 6 | 7 | float cosTheta = dot(start, dest); 8 | glm::vec3 rotationAxis; 9 | 10 | if (cosTheta < -1 + 0.001f){ 11 | // special case when vectors in opposite directions: 12 | // there is no "ideal" rotation axis 13 | // So guess one; any will do as long as it's perpendicular to start 14 | rotationAxis = glm::cross(glm::vec3(0.0f, 1.0f, 0.0f), start); 15 | if (glm::length(rotationAxis) < 0.01 ) // bad luck, they were parallel, try again! 16 | rotationAxis = glm::cross(glm::vec3(1.0f, 0.0f, 0.0f), start); 17 | 18 | rotationAxis = normalize(rotationAxis); 19 | //std::cout << "Rotation axis = " << rotationAxis << std::endl; 20 | return glm::angleAxis(glm::pi(), rotationAxis); 21 | } 22 | 23 | rotationAxis = cross(start, dest); 24 | 25 | float s = sqrt( (1+cosTheta)*2 ); 26 | float invs = 1 / s; 27 | 28 | return glm::quat(s * 0.5f, 29 | rotationAxis.x * invs, 30 | rotationAxis.y * invs, 31 | rotationAxis.z * invs 32 | ); 33 | } 34 | // Same as above, optimized for vector [0, 1, 0] 35 | glm::quat RotationFromY(glm::vec3 dest){ 36 | dest = normalize(dest); 37 | 38 | float cosTheta = dest.y; 39 | glm::vec3 rotationAxis; 40 | 41 | if (cosTheta < -1 + 0.00001f){ 42 | // special case when vectors in opposite directions: 43 | // there is no "ideal" rotation axis 44 | // So guess one; any will do as long as it's perpendicular to start 45 | rotationAxis = glm::vec3(1.0,0.0,0.0); 46 | return glm::angleAxis(glm::pi(), rotationAxis); 47 | } 48 | 49 | rotationAxis = glm::cross(glm::vec3(0.0, 1.0, 0.0), dest); 50 | 51 | float s = sqrt( (1+cosTheta)*2 ); 52 | float invs = 1 / s; 53 | 54 | return glm::quat(s * 0.5f, 55 | rotationAxis.x * invs, 56 | rotationAxis.y * invs, 57 | rotationAxis.z * invs 58 | ); 59 | } 60 | -------------------------------------------------------------------------------- /src/glm.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __GLM_HPP__ 2 | #define __GLM_HPP__ 3 | 4 | #include "global_config.hpp" 5 | 6 | #define GLM_FORCE_RADIANS 7 | #define GLM_SWIZZLE 8 | #include 9 | #include 10 | #include 11 | 12 | glm::quat RotationBetweenVectors(glm::vec3 start, glm::vec3 dest); 13 | 14 | // Same as above, optimized for vector [0, 1, 0] 15 | glm::quat RotationFromY(glm::vec3 dest); 16 | 17 | 18 | class SystemTransform{ 19 | public: 20 | SystemTransform() {} 21 | SystemTransform(glm::vec3 global, glm::vec3 local) 22 | : global_to_local(RotationBetweenVectors(global, local)), 23 | //local_to_global(RotationBetweenVectors(local, global)) 24 | local_to_global(glm::inverse(global_to_local)) 25 | {} 26 | inline glm::vec3 toGlobal(glm::vec3 local) const{ 27 | return local_to_global * local; 28 | } 29 | inline glm::vec3 toLocal(glm::vec3 global) const{ 30 | return global_to_local * global; 31 | } 32 | private: 33 | glm::quat global_to_local; 34 | glm::quat local_to_global; 35 | }; 36 | 37 | #endif // __GLM_HPP__ 38 | -------------------------------------------------------------------------------- /src/global_config.cpp: -------------------------------------------------------------------------------- 1 | #define NO_EXTERN 2 | #include "global_config.hpp" 3 | #undef NO_EXTERN 4 | 5 | #if ENABLE_DEBUG 6 | bool debug_trace = false; 7 | unsigned int debug_x, debug_y; 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | void assert_fail(std::string text,std::string file,int line,std::string function){ 14 | std::cerr << "Assertion failed." << std::endl; 15 | std::cerr << file << ":" << line << ", in " << function << std::endl; 16 | std::cerr << "because " << text << std::endl; 17 | raise(SIGABRT); 18 | } 19 | -------------------------------------------------------------------------------- /src/global_config.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifdef NDEBUG 3 | #define ENABLE_DEBUG 0 4 | #else 5 | #define ENABLE_DEBUG 1 6 | #endif 7 | 8 | #define TILE_SIZE 32 9 | 10 | #define PREVIEW_DIMENTIONS_RATIO 4 11 | #define PREVIEW_RAYS_RATIO 2 12 | #define PREVIEW_SPEED_RATIO (PREVIEW_DIMENTIONS_RATIO*PREVIEW_DIMENTIONS_RATIO*PREVIEW_RAYS_RATIO) 13 | 14 | #define BARSIZE 75 15 | 16 | // ======================================= 17 | 18 | #ifdef NDEBUG 19 | #undef ENABLE_DEBUG 20 | #define ENABLE_DEBUG 0 21 | #endif 22 | 23 | #if ENABLE_DEBUG 24 | #include 25 | #define IFDEBUG if(debug) 26 | #else 27 | #define IFDEBUG if(0) 28 | #undef assert 29 | #define assert(x) (void)0 30 | #endif 31 | 32 | #if ENABLE_DEBUG 33 | #ifndef NO_EXTERN 34 | extern bool debug_trace; 35 | extern unsigned int debug_x, debug_y; 36 | #endif // NO_EXTERN 37 | #else 38 | #ifndef NDEBUG 39 | #define NDEBUG 40 | #endif 41 | #endif 42 | 43 | // ===== Extra stuff 44 | 45 | #include 46 | 47 | #define NEAR(x,y) (x < y + 0.001f && x > y - 0.001f) 48 | 49 | 50 | #if ENABLE_DEBUG 51 | 52 | void assert_fail(std::string text,std::string file,int line,std::string function); 53 | #define qassert_true(cond) ( (cond) ? \ 54 | static_cast(0): \ 55 | assert_fail ("condition " + std::string(#cond) + " is not true" , __FILE__, __LINE__, __PRETTY_FUNCTION__) \ 56 | ) 57 | #define qassert_false(cond) ( !(cond) ? \ 58 | static_cast(0): \ 59 | assert_fail ("condition " + std::string(#cond) + " is not false" , __FILE__, __LINE__, __PRETTY_FUNCTION__) \ 60 | ) 61 | #define qassert_less(a,b) ( a(0): \ 63 | assert_fail ("value " + #a + " = " + a + " is not less than " + #b + " = " + b , __FILE__, __LINE__, __PRETTY_FUNCTION__) \ 64 | ) 65 | #define qassert_directed(a,b) ( glm::dot(a,b)>0 ? \ 66 | static_cast(0): \ 67 | assert_fail (std::string("vector ") + #a + " = " + glm::to_string(a) + " is not in the direction of vector " + #b + " = " + glm::to_string(b) + ", dot is " + std::to_string(glm::dot(a,b)) , __FILE__, __LINE__, __PRETTY_FUNCTION__) \ 68 | ) 69 | 70 | #else 71 | #define qassert_true(x) ((void)0) 72 | #define qassert_false(x) ((void)0) 73 | #define qassert_less(a,b) ((void)0) 74 | #define qassert_directed(a,b) ((void)0) 75 | #endif 76 | -------------------------------------------------------------------------------- /src/jsonutils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __JSONUTILS_HPP__ 2 | #define __JSONUTILS_HPP__ 3 | 4 | #include 5 | 6 | #include "../external/json/json.h" 7 | #include "glm.hpp" 8 | 9 | class JsonUtils{ 10 | public: 11 | static void SetFileLocationName(std::string name){ 12 | fileloc_name = name; 13 | } 14 | 15 | static std::string getRequiredString(const Json::Value& node, std::string key); 16 | static int getRequiredInt (const Json::Value& node, std::string key); 17 | static float getRequiredFloat (const Json::Value& node, std::string key); 18 | static glm::vec3 getRequiredVec3 (const Json::Value& node, std::string key); 19 | static glm::vec3 getRequiredVec3_255(const Json::Value& node, std::string key); 20 | 21 | static std::string getOptionalString(const Json::Value& node, std::string key, std::string def); 22 | static int getOptionalInt (const Json::Value& node, std::string key, int def); 23 | static float getOptionalFloat (const Json::Value& node, std::string key, float def); 24 | static bool getOptionalBool (const Json::Value& node, std::string key, bool def); 25 | static glm::vec3 getOptionalVec3 (const Json::Value& node, std::string key, glm::vec3 def); 26 | static glm::vec3 getOptionalVec3_255(const Json::Value& node, std::string key, glm::vec3 def); 27 | 28 | static void prepareNodeMetadata(Json::Value& node, bool recursive=1); 29 | static void markNodeUsed(Json::Value& node); 30 | static void markNodeUnused(Json::Value& node); 31 | static bool getNodeUsed(const Json::Value& node); 32 | // Note: Semantic name may not contain a | character 33 | static void setNodeSemanticName(Json::Value& node, std::string name); 34 | static std::string getNodeSemanticName(const Json::Value& node); 35 | 36 | static std::vector< std::string > findUnusedNodes(const Json::Value& root); 37 | private: 38 | static bool JSONToVec3(Json::Value v, glm::vec3& out); 39 | static std::string fileloc_name; 40 | }; 41 | 42 | #endif // __JSONUTILS_HPP__ 43 | -------------------------------------------------------------------------------- /src/out.cpp: -------------------------------------------------------------------------------- 1 | #include "out.hpp" 2 | 3 | unsigned int out::verbosity_level = 2; 4 | -------------------------------------------------------------------------------- /src/out.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __OUT_HPP__ 2 | #define __OUT_HPP__ 3 | 4 | #include 5 | 6 | class out{ 7 | private: 8 | out(std::ostream& o, bool discard) : o(o), discard(discard) {} 9 | 10 | std::ostream& o; 11 | bool discard = false; 12 | public: 13 | void flush(){ std::flush(o); } 14 | 15 | static out cout(unsigned int level){ 16 | return out(std::cout, level > verbosity_level); 17 | } 18 | static out cerr(unsigned int level){ 19 | return out(std::cerr, level > verbosity_level); 20 | } 21 | 22 | template 23 | out& operator<<(const T& t){ 24 | if(!discard) o << t; 25 | return *this; 26 | } 27 | 28 | out& operator<<(std::ostream& (*f)(std::ostream&)){ 29 | if(!discard) f(o); 30 | return *this; 31 | } 32 | 33 | static unsigned int verbosity_level; 34 | }; 35 | 36 | 37 | 38 | 39 | #endif // __OUT_HPP__ 40 | -------------------------------------------------------------------------------- /src/path_tracer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __PATH_TRACER_HPP__ 2 | #define __PATH_TRACER_HPP__ 3 | 4 | #include "tracer.hpp" 5 | #include "primitives.hpp" 6 | class Sampler; 7 | 8 | class PathTracer : public Tracer{ 9 | public: 10 | PathTracer(const Scene& scene, 11 | const Camera& camera, 12 | unsigned int xres, 13 | unsigned int yres, 14 | unsigned int multisample, 15 | unsigned int depth, 16 | float clamp, 17 | float russian, 18 | float bumpmap_scale, 19 | bool force_fresnell, 20 | unsigned int reverse, 21 | unsigned int samplerSeed); 22 | 23 | protected: 24 | PixelRenderResult RenderPixel(int x, int y, unsigned int & raycount, bool debug = false) override; 25 | 26 | private: 27 | PixelRenderResult TracePath(const Ray& r, unsigned int& raycount, Sampler& sampler, bool debug = false); 28 | 29 | struct PathPoint{ 30 | bool infinity = false; 31 | // Point position 32 | glm::vec3 pos; 33 | // Normal vectors 34 | glm::vec3 lightN; 35 | glm::vec3 faceN; 36 | SystemTransform transform; 37 | // reflected direction (pointing towards previous path point) 38 | glm::vec3 Vr; 39 | // incoming direction (pointing towards next path point) 40 | glm::vec3 Vi; 41 | // Material properties at hitpoint 42 | const Material* mat; 43 | glm::vec2 texUV; 44 | Radiance emission; 45 | // Thinglass encountered on the way of the ray that generated this point 46 | ThinglassIsections thinglass_isect; 47 | // Currection for rusian roulette 48 | float russian_coefficient; 49 | // These take into account sampling, BRDF, color. Symmetric in both directions. 50 | Spectrum transfer_coefficients; 51 | // Same coefficients as above, but cumulated thorough the 52 | // path. This indicates how much does the light from this 53 | // point contribute to the beginning of the path. 54 | Spectrum contribution = Spectrum(1.0f, 1.0f, 1.0f); 55 | // 56 | Radiance light_from_source; 57 | // True if the ray hit the face from outside (CCW) 58 | bool backside = false; 59 | }; 60 | 61 | std::vector GeneratePath(Ray direction, unsigned int& raycount, unsigned int depth__, float russian__, Sampler& sampler, bool debug = false) const; 62 | 63 | Radiance ApplyThinglass(Radiance input, const ThinglassIsections& isections, glm::vec3 ray_direction) const; 64 | 65 | //Radiance sky_radiance; 66 | float clamp; 67 | float russian; 68 | unsigned int depth; 69 | bool force_fresnell; 70 | unsigned int reverse; 71 | mutable unsigned int samplerSeed; 72 | }; 73 | 74 | #endif // __PATH_TRACER_HPP__ 75 | -------------------------------------------------------------------------------- /src/primitives.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __PRIMITITES_HPP__ 2 | #define __PRIMITITES_HPP__ 3 | 4 | #include 5 | 6 | #include "glm.hpp" 7 | 8 | #include "radiance.hpp" 9 | #include "ray.hpp" 10 | #include 11 | #include 12 | 13 | class BRDF; 14 | 15 | // I have to be c++11 compatible! :( 16 | namespace std{ 17 | template 18 | std::unique_ptr make_unique(Args... a){ 19 | return std::unique_ptr(new T(a...)); 20 | } 21 | } 22 | 23 | class Scene; 24 | class ReadableTexture; 25 | 26 | struct Light{ 27 | enum Type{ 28 | FULL_SPHERE, 29 | HEMISPHERE, 30 | }; 31 | Light(Type t) : type(t) {} 32 | Type type; 33 | glm::vec3 pos; 34 | Radiance color; 35 | float intensity; 36 | // TODO: union? 37 | float size; // Only for full_sphere lights 38 | glm::vec3 normal; // Only for hemisphere lights 39 | float GetDirectionalFactor(glm::vec3 v) const{ 40 | if(type == FULL_SPHERE) return 1.0f; 41 | else return glm::max(0.0f, glm::dot(v,normal)); 42 | } 43 | }; 44 | 45 | class Material; 46 | /* 47 | struct Material{ 48 | Material(); 49 | Material(const Material&) = default; 50 | std::string name; 51 | 52 | float exponent; 53 | float refraction_index; 54 | float translucency = 0.0f; 55 | 56 | std::shared_ptr diffuse; 57 | std::shared_ptr specular; 58 | Radiance emission; 59 | std::shared_ptr bumpmap; 60 | 61 | std::shared_ptr brdf; 62 | }; 63 | */ 64 | 65 | class Triangle{ 66 | public: 67 | const Scene* parent_scene; 68 | unsigned int va, vb, vc; // Vertex and normal indices 69 | Material* mat; // Material pointer 70 | glm::vec4 p; // plane 71 | inline glm::vec3 generic_normal() const {return p.xyz();} 72 | void CalculatePlane() __attribute__((hot)); 73 | float GetArea() const; 74 | glm::vec3 GetRandomPoint(glm::vec2 sample) const; 75 | 76 | Triangle(const Scene* parent, unsigned int va, unsigned int vb, unsigned int vc, Material* mat) : 77 | parent_scene(parent), va(va), vb(vb), vc(vc), mat(mat) {} 78 | Triangle() : parent_scene(nullptr) {} 79 | 80 | const Material& GetMaterial() const; 81 | const glm::vec3 GetVertexA() const; 82 | const glm::vec3 GetVertexB() const; 83 | const glm::vec3 GetVertexC() const; 84 | const glm::vec3 GetNormalA() const; 85 | const glm::vec3 GetNormalB() const; 86 | const glm::vec3 GetNormalC() const; 87 | const glm::vec2 GetTexCoordsA() const; 88 | const glm::vec2 GetTexCoordsB() const; 89 | const glm::vec2 GetTexCoordsC() const; 90 | const glm::vec3 GetTangentA() const; 91 | const glm::vec3 GetTangentB() const; 92 | const glm::vec3 GetTangentC() const; 93 | 94 | bool TestIntersection(const Ray& r, /*out*/ float& t, float& a, float& b, bool debug = false) const __attribute__((hot)); 95 | }; 96 | 97 | typedef std::vector> ThinglassIsections; 98 | struct Intersection{ 99 | const Triangle* triangle = nullptr; 100 | float t; 101 | float a,b,c; 102 | template 103 | T Interpolate(const T& x, const T& y, const T& z) {return a*x + b*y + c*z;} 104 | // An ordered list of intersections with materials that are considered to be a thin glass. 105 | // The first element of pair is the triangle intersecting. The second is the distance from ray origin 106 | // to the intersection. The second parameter is used because triangles may get cloned during kD-tree 107 | // construction, and we need to apply a filter just once. 108 | ThinglassIsections thinglass; 109 | }; 110 | 111 | 112 | typedef std::vector> primitive_data; 113 | class Primitives{ 114 | public: 115 | static primitive_data planeY; 116 | static primitive_data trigY; 117 | static primitive_data cube; 118 | }; 119 | 120 | #endif // __PRIMITITES_HPP__ 121 | -------------------------------------------------------------------------------- /src/radiance.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __RADIANCE_HPP__ 2 | #define __RADIANCE_HPP__ 3 | 4 | #include "glm.hpp" 5 | 6 | struct Color{ 7 | Color() : r(0.0), g(0.0), b(0.0) {} 8 | Color(float r, float g, float b) : r(r), g(g), b(b) {} 9 | Color(const glm::vec3& c) : r(c.r), g(c.g), b(c.b) {} 10 | float r,g,b; // 0 - 1 11 | Color operator* (float q) const {return Color(q*r, q*g, q*b);} 12 | Color operator/ (float q) const {return Color(r/q, g/q, b/q);} 13 | Color operator* (const Color& other) const {return Color(other.r*r, other.g*g, other.b*b);} 14 | Color operator+ (const Color& o) const {return Color(r+o.r,g+o.g,b+o.b);} 15 | Color& operator+=(const Color& o) {*this = *this + o; return *this;} 16 | Color gammaEncode(float gamma = 2.2f){ 17 | return Color(glm::pow(r, 1.0f/gamma), 18 | glm::pow(g, 1.0f/gamma), 19 | glm::pow(b, 1.0f/gamma)); 20 | } 21 | Color gammaDecode(float gamma = 2.2f){ 22 | return Color(glm::pow(r, gamma), 23 | glm::pow(g, gamma), 24 | glm::pow(b, gamma)); 25 | } 26 | }; 27 | 28 | inline Color operator*(float q, const Color& c){ 29 | return Color(q*c.r, q*c.g, q*c.b); 30 | } 31 | 32 | struct Radiance{ 33 | Radiance() : r(0.0), g(0.0), b(0.0) {} 34 | Radiance(float r, float g, float b) : r(r), g(g), b(b) {} 35 | explicit Radiance(const Color& c){ 36 | // Clearly this is a wrong place to apply gamma 37 | const float gamma = 1.0; 38 | r = pow(c.r, gamma); 39 | g = pow(c.g, gamma); 40 | b = pow(c.b, gamma); 41 | } 42 | float r,g,b; // unbounded, positive 43 | Radiance operator/ (float q) const {return Radiance(r/q, g/q, b/q);} 44 | Radiance operator+ (const Radiance& o) const {return Radiance(r+o.r,g+o.g,b+o.b);} 45 | Radiance operator- (const Radiance& o) const {return Radiance(r-o.r,g-o.g,b-o.b);} 46 | Radiance& operator+=(const Radiance& o) {*this = *this + o; return *this;} 47 | Radiance& operator-=(const Radiance& o) {*this = *this - o; return *this;} 48 | float max() const {return glm::max(glm::max(r,g),b);} 49 | bool isNonZero() const {return r > 0 || g > 0 || b > 0;} 50 | void clamp(float v){ 51 | if(r > v) r = v; 52 | if(g > v) g = v; 53 | if(b > v) b = v; 54 | } 55 | }; 56 | 57 | struct Spectrum{ 58 | Spectrum() : r(1.0), g(1.0), b(1.0) {} 59 | explicit Spectrum(float f) : r(f), g(f), b(f) {} 60 | Spectrum(float r, float g, float b) : r(r), g(g), b(b) {} 61 | explicit Spectrum(const Color& c){ 62 | r = c.r; g = c.g, b = c.b; 63 | } 64 | Spectrum operator* (float q) const {return Spectrum(q*r, q*g, q*b);} 65 | Spectrum operator/ (float q) const {return Spectrum(r/q, g/q, b/q);} 66 | Spectrum operator* (const Spectrum& o) const {return Spectrum(o.r*r, o.g*g, o.b*b);} 67 | Spectrum operator*=(float q) {*this = *this * q; return *this;} 68 | Spectrum operator/=(float q) {*this = *this / q; return *this;} 69 | Spectrum operator*=(const Spectrum& o) {*this = *this * o; return *this;} 70 | 71 | Spectrum operator+ (const Spectrum& o) const {return Spectrum(r+o.r,g+o.g,b+o.b);} 72 | Spectrum operator- (const Spectrum& o) const {return Spectrum(r-o.r,g-o.g,b-o.b);} 73 | 74 | float max() const {return glm::max(glm::max(r,g),b);} 75 | 76 | float r,g,b; 77 | }; 78 | 79 | inline Radiance operator*(const Radiance& r, const Spectrum& s){ 80 | return Radiance(r.r * s.r, r.g * s.g, r.b * s.b); 81 | } 82 | inline Radiance operator*(const Spectrum& s, const Radiance& r){ 83 | return Radiance(r.r * s.r, r.g * s.g, r.b * s.b); 84 | } 85 | inline Radiance& operator *=(Radiance& r, const Spectrum& s){ 86 | r.r *= s.r; r.g *= s.g; r.b *= s.b; 87 | return r; 88 | } 89 | 90 | 91 | 92 | #endif //__RADIANCE_HPP__ 93 | -------------------------------------------------------------------------------- /src/random_utils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __RANDOM_UTILS_HPP__ 2 | #define __RANDOM_UTILS_HPP__ 3 | 4 | #include "glm.hpp" 5 | 6 | class RandomUtils{ 7 | public: 8 | static float Sample1DToRange(float sample, float begin, float end){ 9 | qassert_true(end >= begin); 10 | return begin + sample * (end - begin); 11 | } 12 | static glm::vec2 Sample2DToDiscUniform(glm::vec2 sample){ 13 | float r = glm::sqrt(sample.x); 14 | float a = sample.y * 2.0f * M_PI; 15 | return {r * glm::sin(a), r * glm::cos(a)}; 16 | } 17 | // Hemisphere of points whose Y > 0 18 | static glm::vec3 Sample2DToHemisphereUniform(glm::vec2 sample){ 19 | float k1 = sample.x; 20 | float k2 = sample.y*2.0f - 1.0f; 21 | float z = 1.0f - k2*k2; 22 | float s = glm::sqrt(z); 23 | float w = 2.0f*glm::pi()*k1; 24 | float x = glm::cos(w) * s; 25 | float y = glm::sin(w) * s; 26 | return {x,glm::abs(z),y}; 27 | } 28 | // Returns a uniformly-distributed random vector in direction of V. 29 | static glm::vec3 Sample2DToHemisphereUniformDirected(glm::vec2 sample, glm::vec3 direction){ 30 | return MoveToDir(direction, Sample2DToHemisphereUniform(sample)); 31 | } 32 | // Returns a cosine-distributed random vector on a hemisphere, such that y > 0. 33 | static glm::vec3 Sample2DToHemisphereCosine(glm::vec2 sample){ 34 | glm::vec2 p = Sample2DToDiscUniform(sample); 35 | float y = glm::sqrt(glm::max(0.00001f, 1- p.x*p.x - p.y*p.y)); 36 | return glm::vec3(p.x, y, p.y); 37 | } 38 | // Returns a cosine-distributed random vector on a hemisphere, such that z > 0. 39 | static glm::vec3 Sample2DToHemisphereCosineZ(glm::vec2 sample){ 40 | glm::vec2 p = Sample2DToDiscUniform(sample); 41 | float z = glm::sqrt(glm::max(0.00001f, 1- p.x*p.x - p.y*p.y)); 42 | return glm::vec3(p.x, p.y, z); 43 | } 44 | // Returns a cosine-distributed random vector in direction of V. 45 | static glm::vec3 Sample2DToHemisphereCosineDirected(glm::vec2 sample, glm::vec3 direction){ 46 | return MoveToDir(direction, Sample2DToHemisphereCosine(sample)); 47 | } 48 | // Returns a uniformly random vector on a sphere 49 | static glm::vec3 Sample2DToSphereUniform(glm::vec2 sample){ 50 | float z = sample.x * 2.0f - 1.0f; 51 | float a = sample.y * 6.283185; 52 | float r = glm::sqrt(1 - z * z); 53 | float x = r * glm::cos(a); 54 | float y = r * glm::sin(a); 55 | return glm::vec3(x, y, z); 56 | } 57 | // This function is useful for reusing the same sample multiple 58 | // times. It returns whether the sample is within requested 59 | // probability range, and then scales the sample so that, under 60 | // the tested condition, it still has range 0-1. 61 | // For example usage, see BRDFLTCBeckmann::GetRay which gets only 62 | // two samples, but needs three. 63 | static bool DecideAndRescale(float& sample, float probability){ 64 | if(probability == 0.0f) return false; 65 | if(probability == 1.0f) return true; 66 | if(sample < probability){ 67 | sample /= probability; 68 | return true; 69 | }else{ 70 | sample = (sample - probability) / (1.0f - probability); 71 | return false; 72 | } 73 | } 74 | private: 75 | // TODO: This should be a generic function 76 | static glm::vec3 MoveToDir(glm::vec3 direction, glm::vec3 r){ 77 | return RotationFromY(direction) * r; 78 | } 79 | }; 80 | 81 | #endif //__RANDOM_UTILS_HPP__ 82 | -------------------------------------------------------------------------------- /src/ray.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __RAY_HPP__ 2 | #define __RAY_HPP__ 3 | 4 | #include "glm.hpp" 5 | 6 | class Ray{ 7 | public: 8 | Ray() {} 9 | // Directional constructor (half-line). 10 | Ray(glm::vec3 from, glm::vec3 dir) : 11 | origin(from){ 12 | direction = glm::normalize(dir); 13 | } 14 | // From-to constructor. Sets near and far. 15 | Ray(glm::vec3 from, glm::vec3 to, float epsillon){ 16 | origin = from; 17 | glm::vec3 diff = to-from; 18 | direction = glm::normalize(diff); 19 | float length = glm::length(diff); 20 | near = 0.0f + epsillon; 21 | far = length - epsillon; 22 | } 23 | glm::vec3 origin; 24 | glm::vec3 direction; 25 | float near = 0.0f; 26 | float far = 10000.0f; 27 | glm::vec3 t(float t) const {return origin + t*direction;} 28 | inline glm::vec3 operator[](float t_) const {return t(t_);} 29 | }; 30 | 31 | #endif // __RAY_HPP__ 32 | -------------------------------------------------------------------------------- /src/render_driver.hpp: -------------------------------------------------------------------------------- 1 | #include "config.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "tracer.hpp" 8 | 9 | class RenderDriver{ 10 | public: 11 | static void RenderFrame(const Scene& scene, 12 | std::shared_ptr cfg, 13 | const Camera& camera, 14 | std::string output_file 15 | ); 16 | private: 17 | 18 | static void FrameMonitorThread(RenderLimitMode render_limit_mode, 19 | unsigned int limit_rounds, 20 | unsigned int limit_minutes, 21 | unsigned int pixels_per_round); 22 | static void RenderRound(const Scene& scene, 23 | std::shared_ptr cfg, 24 | const Camera& camera, 25 | const std::vector& tasks, 26 | unsigned int& seedcount, 27 | const int seedstart, 28 | unsigned int concurrency, 29 | EXRTexture& total_ob 30 | ); 31 | 32 | static std::chrono::high_resolution_clock::time_point frame_render_start; 33 | static std::atomic stop_monitor; 34 | 35 | // Performance counters 36 | static std::atomic rounds_done; 37 | static std::atomic pixels_done; 38 | static std::atomic rays_done; 39 | static void ResetCounters(); 40 | }; 41 | -------------------------------------------------------------------------------- /src/stbi.cpp: -------------------------------------------------------------------------------- 1 | #define STB_IMAGE_IMPLEMENTATION 2 | #define STBI_ONLY_HDR 3 | #include 4 | -------------------------------------------------------------------------------- /src/stbi.hpp: -------------------------------------------------------------------------------- 1 | #define STBI_ONLY_HDR 2 | #include "../external/stb_image.h" 3 | #undef STBI_ONLY_HDR 4 | -------------------------------------------------------------------------------- /src/texture.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TEXTURE_HPP__ 2 | #define __TEXTURE_HPP__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "radiance.hpp" 9 | 10 | class ReadableTexture{ 11 | public: 12 | virtual Color GetPixel(int x, int y) const = 0; 13 | virtual Color GetPixelInterpolated(glm::vec2 pos, bool debug = false) const = 0; 14 | virtual float GetSlopeRight(glm::vec2 pos) const = 0; 15 | virtual float GetSlopeBottom(glm::vec2 pos) const = 0; 16 | inline Color operator[](const glm::vec2& pos) const { 17 | return GetPixelInterpolated(pos); 18 | } 19 | inline Color Get(const glm::vec2& pos) const { 20 | return GetPixelInterpolated(pos); 21 | } 22 | inline Spectrum GetSpectrum(const glm::vec2& pos) const { 23 | return Spectrum(GetPixelInterpolated(pos)); 24 | } 25 | virtual bool Empty() const = 0; 26 | }; 27 | 28 | class WritableTexture{ 29 | virtual void SetPixel(int x, int y, Color c) = 0; 30 | }; 31 | 32 | class FileTexture : public ReadableTexture, 33 | public WritableTexture{ 34 | public: 35 | FileTexture(int xsize, int ysize); 36 | 37 | bool Write(std::string path) const; 38 | void WriteToPNG(std::string path) const; 39 | void WriteToBMP(std::string path) const; 40 | virtual void SetPixel(int x, int y, Color c) override; 41 | virtual Color GetPixel(int x, int y) const override; 42 | 43 | // Finite differentes for bump maps 44 | virtual float GetSlopeRight(glm::vec2 pos) const override; 45 | virtual float GetSlopeBottom(glm::vec2 pos) const override; 46 | 47 | virtual Color GetPixelInterpolated(glm::vec2 pos, bool debug = false) const override; 48 | 49 | static FileTexture* CreateNewFromPNG(std::string path); 50 | static FileTexture* CreateNewFromJPEG(std::string path); 51 | static FileTexture* CreateNewFromHDR(std::string path); 52 | 53 | void FillStripes(unsigned int size, Color a, Color b); 54 | 55 | virtual bool Empty() const override {return false;} 56 | private: 57 | // Fixed size is kept manually. 58 | std::vector data; 59 | unsigned int xsize, ysize; 60 | 61 | FileTexture(); 62 | }; 63 | 64 | class SolidTexture : public ReadableTexture{ 65 | public: 66 | SolidTexture(Color color) : color(color) {} 67 | virtual Color GetPixel(int, int) const override {return color;} 68 | virtual Color GetPixelInterpolated(glm::vec2, bool) const override {return color;} 69 | virtual float GetSlopeRight(glm::vec2) const override {return 0;} 70 | virtual float GetSlopeBottom(glm::vec2) const override {return 0;} 71 | virtual bool Empty() const override {return false;} 72 | private: 73 | Color color; 74 | }; 75 | 76 | class EmptyTexture : public SolidTexture{ 77 | public: 78 | EmptyTexture() : SolidTexture(Color(0,0,0)) {} 79 | virtual bool Empty() const override {return true;} 80 | }; 81 | 82 | 83 | class EXRTexture{ 84 | public: 85 | EXRTexture(int xsize = 0, int ysize = 0); 86 | EXRTexture(const EXRTexture& other) : 87 | xsize(other.xsize), ysize(other.ysize), 88 | data(other.data), count(other.count) { 89 | } 90 | EXRTexture(EXRTexture&& other){ 91 | std::swap(xsize,other.xsize); 92 | std::swap(ysize,other.ysize); 93 | std::swap(data,other.data); 94 | std::swap(count,other.count); 95 | } 96 | EXRTexture& operator=(EXRTexture&& other){ 97 | std::swap(xsize,other.xsize); 98 | std::swap(ysize,other.ysize); 99 | std::swap(data,other.data); 100 | std::swap(count,other.count); 101 | return *this; 102 | } 103 | bool Write(std::string path) const; 104 | void AddPixel(int x, int y, Radiance c, unsigned int n = 1); 105 | Radiance GetPixel(int x, int y) const; 106 | // A positive value will be applied as a scaling factor to the entire texture. 107 | // A negative value enables automatic scaling factor detection 108 | EXRTexture Normalize(float val) const; 109 | 110 | void Accumulate(const EXRTexture& other); 111 | 112 | private: 113 | unsigned int xsize, ysize; 114 | std::vector data; 115 | std::vector count; 116 | 117 | mutable std::mutex mx; 118 | }; 119 | 120 | #endif // __TEXTURE_HPP__ 121 | -------------------------------------------------------------------------------- /src/tracer.cpp: -------------------------------------------------------------------------------- 1 | #include "tracer.hpp" 2 | #include "texture.hpp" 3 | #include "global_config.hpp" 4 | #include "utils.hpp" 5 | 6 | void Tracer::Render(const RenderTask& task, EXRTexture* output, std::atomic& pixel_count, std::atomic& ray_count){ 7 | unsigned int pxdone = 0, raysdone = 0; 8 | for(unsigned int y = task.yrange_start; y < task.yrange_end; y++){ 9 | for(unsigned int x = task.xrange_start; x < task.xrange_end; x++){ 10 | bool debug = false; 11 | #if ENABLE_DEBUG 12 | if(debug_trace && x == debug_x && y == debug_y) debug = true; 13 | #endif 14 | PixelRenderResult px = RenderPixel(x, y, raysdone, debug); 15 | 16 | // Temporarily disabled for light tracing 17 | // output->AddPixel(x, y, px.main_pixel, multisample); 18 | output->AddPixel(x, y, px.main_pixel, multisample); 19 | 20 | for(const auto& t : px.side_effects){ 21 | int x2 = std::get<0>(t); 22 | int y2 = std::get<1>(t); 23 | Radiance r = std::get<2>(t); 24 | IFDEBUG std::cout << "Setting extra pixel at: " << x2 << " " << y2 << " to " << r << std::endl; 25 | output->AddPixel(x2, y2, r, 0); 26 | } 27 | 28 | pxdone++; 29 | if(pxdone % 100 == 0){ 30 | pixel_count += 100; 31 | pxdone = 0; 32 | } 33 | } 34 | } 35 | pixel_count += pxdone; 36 | ray_count += raysdone; 37 | } 38 | -------------------------------------------------------------------------------- /src/tracer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACER_HPP__ 2 | #define __TRACER_HPP__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "glm.hpp" 9 | #include "radiance.hpp" 10 | class Scene; 11 | class Camera; 12 | class EXRTexture; 13 | 14 | struct RenderTask{ 15 | RenderTask(unsigned int xres, unsigned int yres, unsigned int x1, unsigned int x2, unsigned int y1, unsigned int y2) 16 | : xres(xres), yres(yres), xrange_start(x1), xrange_end(x2), yrange_start(y1), yrange_end(y2) 17 | { 18 | midpoint = glm::vec2((xrange_start + xrange_end)/2.0f, (yrange_start + yrange_end)/2.0f); 19 | } 20 | unsigned int xres, yres; 21 | unsigned int xrange_start, xrange_end; 22 | unsigned int yrange_start, yrange_end; 23 | glm::vec2 midpoint; 24 | }; 25 | 26 | struct PixelRenderResult{ 27 | PixelRenderResult() {}; 28 | PixelRenderResult(Radiance main) : main_pixel(main) {} 29 | Radiance main_pixel; 30 | std::vector> side_effects; 31 | }; 32 | 33 | class Tracer{ 34 | protected: 35 | Tracer(const Scene& scene, 36 | const Camera& camera, 37 | unsigned int xres, 38 | unsigned int yres, 39 | unsigned int multisample, 40 | float bumpmap_scale = 10.0) 41 | : scene(scene), 42 | camera(camera), 43 | xres(xres), yres(yres), 44 | multisample(multisample), 45 | bumpmap_scale(bumpmap_scale) 46 | {} 47 | 48 | public: 49 | void Render(const RenderTask& task, EXRTexture* output, std::atomic& pixel_count, std::atomic& ray_count); 50 | 51 | protected: 52 | virtual PixelRenderResult RenderPixel(int x, int y, unsigned int & raycount, bool debug = false) = 0; 53 | 54 | const Scene& scene; 55 | const Camera& camera; 56 | unsigned int xres, yres; 57 | unsigned int multisample; 58 | 59 | float bumpmap_scale; 60 | }; 61 | 62 | #endif // __TRACER_HPP__ 63 | -------------------------------------------------------------------------------- /src/utils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __UTILS_HPP__ 2 | #define __UTILS_HPP__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "glm.hpp" 10 | 11 | #include "primitives.hpp" 12 | 13 | inline std::ostream& operator<<(std::ostream& stream, const glm::vec3& v){ 14 | stream << "[" << v.x << ", " << v.y << ", " << v.z << "]"; 15 | return stream; 16 | } 17 | 18 | inline std::ostream& operator<<(std::ostream& stream, const glm::mat3& v){ 19 | stream << "[" << v[0][0] << ", " << v[0][1] << ", " << v[0][2] << "]" << std::endl; 20 | stream << "[" << v[1][0] << ", " << v[1][1] << ", " << v[1][2] << "]" << std::endl; 21 | stream << "[" << v[2][0] << ", " << v[2][1] << ", " << v[2][2] << "]" << std::endl; 22 | return stream; 23 | } 24 | inline std::ostream& operator<<(std::ostream& stream, const glm::vec2& v){ 25 | stream << "[" << v.x << ", " << v.y << "]"; 26 | return stream; 27 | } 28 | inline std::ostream& operator<<(std::ostream& stream, const Color& c){ 29 | stream << "{" << c.r << ", " << c.g << ", " << c.b << "}"; 30 | return stream; 31 | } 32 | inline std::ostream& operator<<(std::ostream& stream, const Radiance& c){ 33 | stream << "{" << c.r << ", " << c.g << ", " << c.b << "}"; 34 | return stream; 35 | } 36 | inline std::ostream& operator<<(std::ostream& stream, const Spectrum& c){ 37 | stream << "{" << c.r << ", " << c.g << ", " << c.b << "}"; 38 | return stream; 39 | } 40 | 41 | class Utils{ 42 | public: 43 | static std::string Trim(std::string); 44 | static std::vector SplitString(std::string str, std::string delimiter, bool skip_empty = true); 45 | static std::string JoinString(std::vector str, std::string c); 46 | static std::string FormatIntThousands(unsigned int value); 47 | static std::string FormatFraction5(float value); 48 | static std::string FormatInt5(unsigned int value); 49 | static std::string FormatTime(float seconds); 50 | static std::string FormatPercent(float f); 51 | static std::string GetDir(std::string path); 52 | // Extracts filename from a path 53 | static std::string GetFilename(std::string path); 54 | // Splits filename into name and extension 55 | static std::pair GetFileExtension(std::string fname); 56 | static std::string InsertFileSuffix(std::string path, std::string suffix); 57 | static bool GetFileExists(std::string path); 58 | 59 | class LowPass{ 60 | public: 61 | LowPass(unsigned int size); 62 | float Add(float value); 63 | private: 64 | unsigned int m_size; 65 | std::list data; 66 | }; 67 | }; 68 | 69 | #endif // __UTILS_HPP__ 70 | --------------------------------------------------------------------------------