Skip to content

Commit

Permalink
Merge pull request #60 from LumenPT/dev
Browse files Browse the repository at this point in the history
Merge dev into main branch
  • Loading branch information
Wopsie authored Jul 1, 2021
2 parents cdb68e3 + 291c13b commit bacfbf4
Show file tree
Hide file tree
Showing 1,111 changed files with 1,018,941 additions and 25,117 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
**/Sandbox/Sandbox.dir/**
**/Lumen/vendor/Glad/Glad.dir/**
**/Lumen/vendor/imgui/ImGui.dir/**
**/LumenPT/vendor/RayTracingDenoiser
**/LumenPT/vendor/DLSS_Private
**/LumenPT/vendor/TestProject

G:\RandomCode\LumenRenderer\Lumen_Engine\Sandbox\assets\models\Sponza

Expand Down Expand Up @@ -475,3 +478,15 @@ Lumen_Engine/LumenPT/Assets/PrecompiledShaders/
Lumen_Engine/LumenPT/Assets/PrecompiledShaders/Debug/draw_solid_color.ptx
*.bmp
*.ptx

Lumen_Engine/Config.json

*.ollad

Lumen_Engine/Screenshots/

Lumen_Engine/Sandbox/assets/models/Astronaut/

Lumen_Engine/Sandbox/assets/gltfExternalAssets

Lumen_Engine/Sandbox/assets/models/ConferenceRoom/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "Lumen_Engine/LumenPT/vendor/RayTracingDenoiser"]
path = Lumen_Engine/LumenPT/vendor/RayTracingDenoiser
url = https://github.com/LumenPT/RayTracingDenoiser.git
[submodule "Lumen_Engine/LumenPT/vendor/DLSS_Private"]
path = Lumen_Engine/LumenPT/vendor/DLSS_Private
url = https://github.com/LumenPT/DLSS_Private.git
57 changes: 54 additions & 3 deletions Lumen_Engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.16)
cmake_minimum_required (VERSION 3.20)

#project name (i.e. VS solution)
project ("Lumen_Engine" LANGUAGES C CXX)
Expand All @@ -11,7 +11,27 @@ set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)

option(USE_WAVEFRONT "Use the Wavefront rendering pipeline?" ON)
#Add option to use wavefront
#option(USE_WAVEFRONT "Use the Wavefront rendering pipeline?" ON)
set(USE_WAVEFRONT ON)
option(USE_DENOISER "Use Nvidia denoiser (if available)?" OFF)
option(USE_UPSCALING "Use Nvidia denoiser (if available)?" OFF)
option(INCLUDE_TESTPROJECT "Include test project" OFF)

SET(USE_NVIDIA_DENOISER FALSE)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LumenPT/vendor/RayTracingDenoiser" AND USE_DENOISER)
SET(USE_NVIDIA_DENOISER TRUE)
endif()

SET(USE_NVIDIA_DLSS FALSE)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LumenPT/vendor/DLSS_Private" AND USE_UPSCALING)
SET(USE_NVIDIA_DLSS TRUE)
endif()

#If wavefront is used, add compile definition.
if(${USE_WAVEFRONT})
add_compile_definitions(WAVEFRONT)
endif()

add_subdirectory("Lumen/vendor/GLFW")
#Glad
Expand All @@ -38,6 +58,34 @@ set(ZLIB_ROOT
set(BOOST_INCLUDEDIR "${CMAKE_CURRENT_SOURCE_DIR}/LumenPT/vendor/Include")
set(BOOST_LIBRARYDIR "${CMAKE_CURRENT_SOURCE_DIR}/LumenPT/vendor/Libs/boost")

#Set config name variable to use for different IDEs
set(CONFIG_NAME "")

if( ${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005" OR
${CMAKE_GENERATOR} STREQUAL "Visual Studio 9 2008")

set(CONFIG_NAME $(ConfigurationName))

elseif(
${CMAKE_GENERATOR} STREQUAL "Visual Studio 10 2010" OR
${CMAKE_GENERATOR} STREQUAL "Visual Studio 11 2012" OR
${CMAKE_GENERATOR} STREQUAL "Visual Studio 12 2013" OR
${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 2015" OR
${CMAKE_GENERATOR} STREQUAL "Visual Studio 15 2017" OR
${CMAKE_GENERATOR} STREQUAL "Visual Studio 16 2019")

set(CONFIG_NAME $(Configuration))

elseif(
${CMAKE_GENERATOR} STREQUAL "Xcode" OR
${CMAKE_GENERATOR} STREQUAL "Ninja Multi-Config")

set(CONFIG_NAME $(CONFIGURATION))

endif()

#Add config name variable as compile definition.
add_compile_definitions(CONFIG_NAME=\"${CONFIG_NAME}\")
#OpenVDB
add_subdirectory ("LumenPT/vendor/openvdb")
#NanoVDB
Expand All @@ -46,7 +94,10 @@ add_subdirectory ("LumenPT/vendor/openvdb/nanovdb")
add_subdirectory ("Lumen")
#LumenPT
add_subdirectory ("LumenPT")
if(INCLUDE_TESTPROJECT)
add_subdirectory ("TestProject")
endif()
#Sandbox
add_subdirectory ("Sandbox")

set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT "Sandbox")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT "Sandbox")
136 changes: 68 additions & 68 deletions Lumen_Engine/Lumen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
cmake_minimum_required (VERSION 3.16)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

#Add header files
file(GLOB_RECURSE HEADER_FILES

${CMAKE_CURRENT_SOURCE_DIR}/src/*.h
${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp
)

#Add source files
file(GLOB_RECURSE SOURCE_FILES

${CMAKE_CURRENT_SOURCE_DIR}/src/*.c
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
)

# Add header and source files to library
add_library (Lumen STATIC ${HEADER_FILES} ${SOURCE_FILES})
set_property(TARGET Lumen APPEND PROPERTY COMPILE_DEFINITIONS LUMEN)

include(${CMAKE_SOURCE_DIR}/cmake/functions.cmake)
assign_source_group(${HEADER_FILES})
assign_source_group(${SOURCE_FILES})

#add precompiled header file
target_precompile_headers(Lumen
PRIVATE
"src/lmnpch.h"
)

# Put all libraries into a variable
set(LIBS

GLFW
Glad
ImGui
libnanovdb
)

set(INCLUDES
"vendor/GLFW/include"
"vendor/Glad/include"
"vendor/imgui"
"vendor/glm"
"vendor/spdlog/include"
"vendor/nlohmann/include"
"vendor/fx"
"vendor/stb"
"src"
${NANOVDB_HEADERS}
)

add_compile_definitions(GLFW_INCLUDE_NONE)

# Define the include DIRs
target_include_directories(Lumen PUBLIC

${INCLUDES}
)

# Define the link libraries
target_link_libraries(Lumen

${LIBS}
cmake_minimum_required (VERSION 3.20)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

#Add header files
file(GLOB_RECURSE HEADER_FILES

${CMAKE_CURRENT_SOURCE_DIR}/src/*.h
${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp
)

#Add source files
file(GLOB_RECURSE SOURCE_FILES

${CMAKE_CURRENT_SOURCE_DIR}/src/*.c
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
)

# Add header and source files to library
add_library (Lumen STATIC ${HEADER_FILES} ${SOURCE_FILES})
set_property(TARGET Lumen APPEND PROPERTY COMPILE_DEFINITIONS LUMEN)

include(${CMAKE_SOURCE_DIR}/cmake/functions.cmake)
assign_source_group(${HEADER_FILES})
assign_source_group(${SOURCE_FILES})

#add precompiled header file
target_precompile_headers(Lumen
PRIVATE
"src/lmnpch.h"
)

# Put all libraries into a variable
set(LIBS

GLFW
Glad
ImGui
libnanovdb
)

set(INCLUDES
"vendor/GLFW/include"
"vendor/Glad/include"
"vendor/imgui"
"vendor/glm"
"vendor/spdlog/include"
"vendor/nlohmann/include"
"vendor/fx"
"vendor/stb"
"src"
${NANOVDB_HEADERS}
)

add_compile_definitions(GLFW_INCLUDE_NONE)

# Define the include DIRs
target_include_directories(Lumen PUBLIC

${INCLUDES}
)

# Define the link libraries
target_link_libraries(Lumen

${LIBS}
)
5 changes: 5 additions & 0 deletions Lumen_Engine/Lumen/src/Lumen/ImGui/ImGuiLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
#include "ImGuiLayer.h"

#include "imgui.h"
#include "implot.h"
#include "examples/imgui_impl_glfw.h"
#include "examples/imgui_impl_opengl3.h"
#include "Lumen/GLTaskSystem.h"

#include "Lumen/LumenApp.h"


#include <GLFW/glfw3.h>
#include <glad/glad.h>

Expand All @@ -28,6 +30,7 @@ namespace Lumen
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImPlot::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
Expand Down Expand Up @@ -59,6 +62,7 @@ namespace Lumen

void ImGuiLayer::OnDetach()
{
ImPlot::DestroyContext();
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
Expand Down Expand Up @@ -100,5 +104,6 @@ namespace Lumen
{
static bool show = true;
ImGui::ShowDemoWindow(&show);
ImPlot::ShowDemoWindow();
}
}
Loading

0 comments on commit bacfbf4

Please sign in to comment.