Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ build
.LSOverride

# Icon must end with two \r
Icon
Icon


# Thumbnails
._*
Expand Down Expand Up @@ -558,3 +559,5 @@ xcuserdata
*.xccheckout
*.moved-aside
*.xcuserstate

scenes/*
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# Enable C++11 for host code
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Expand All @@ -23,9 +23,9 @@ endif()
########################################
# CUDA Setup
########################################
find_package(CUDA 10 REQUIRED)
find_package(CUDA 12 REQUIRED)
include(${CMAKE_MODULE_PATH}/CUDAComputesList.cmake)

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --extended-lambda)
list(APPEND CUDA_NVCC_FLAGS ${CUDA_GENERATE_CODE})
list(APPEND CUDA_NVCC_FLAGS_DEBUG "-g -G")
set(CUDA_VERBOSE_BUILD ON)
Expand Down Expand Up @@ -65,13 +65,13 @@ include_directories(${GLM_INCLUDE_DIRS})
set(headers
src/main.h
src/image.h
src/interactions.h
src/intersections.h
src/glslUtility.hpp
src/pathtrace.h
src/scene.h
src/sceneStructs.h
src/preview.h
src/material.h
src/utilities.h
src/ImGui/imconfig.h

Expand All @@ -95,6 +95,7 @@ set(sources
src/scene.cpp
src/preview.cpp
src/utilities.cpp
src/bvh.cpp

src/ImGui/imgui.cpp
src/ImGui/imgui_demo.cpp
Expand Down
278 changes: 273 additions & 5 deletions README.md

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions Settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"GLTF": {
"from file": true,
"path": "D:/OneDrive/GitHub/glTF-Sample-Models/2.0/ABeautifulGame/glTF/ABeautifulGame.gltf"
},
"RenderState": {
"camera": {
"aspect ratio": 1,
"screen height": 1200,
"focal length": 0.5,
"aperture size": 0.005,
"position": [0, 0, 0.8],
"lookAt": [0, 0.3, 0.8],
"view": [0, 0, -1],
"up": [0, 1, 0],
"fovy": 45
},
"iterations": 5000,
"traceDepth": 8,
"imageName": "output.png",
"antiAliasing": true,
"dof": true,
"test normal": false,
"test intersect": false,
"test color":[1,1,1]
},
"Materials": [
{
"type": 1,
"emissiveFactor": [1, 1, 1],
"alphaCutoff": 0.5,
"doubleSided": false,
"pbrMetallicRoughness": {
"baseColorFactor": [1, 0, 0, 1],
"metallicFactor": 0.5,
"roughnessFactor": 0.3
}
}
],
"procedural": {
"on": false,
"scale": 16
},
"environmentMap": {
"path":"D:/OneDrive/GitHub/Upenn/CIS_5650/Project3-CUDA-Path-Tracer/scenes/envmap/rural_asphalt_road_4k.hdr",
"on": true
}
}
3 changes: 1 addition & 2 deletions external/include/glm/gtx/intersect.inl
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ namespace glm

typename genType::value_type a = glm::dot(e1, p);

typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon();
if(a < Epsilon)
if(a < 1e-10)
return false;

typename genType::value_type f = typename genType::value_type(1.0f) / a;
Expand Down
Loading