Skip to content
Open
Show file tree
Hide file tree
Changes from 96 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
12f357f
First commit of the new "simple engine" tutorial. This is a VERY ear…
gpx1000 Jul 14, 2025
7e419d5
Refactor GPU optimization sections to generalize vendor-specific reco…
gpx1000 Jul 14, 2025
4644950
Refactor mobile GPU optimization sections and enhance Vulkan extensio…
gpx1000 Jul 14, 2025
2edbd75
Add detailed section on rendergraphs and synchronization in Vulkan
gpx1000 Jul 14, 2025
b476bd1
Add architectural pattern diagrams and refine related sections
gpx1000 Jul 18, 2025
f1d10cf
Add explanatory note on windowing libraries in input handling tutorial
gpx1000 Jul 18, 2025
2a350b2
closer to getting engine working.
gpx1000 Jul 20, 2025
2d46280
address feedback
gpx1000 Jul 22, 2025
3b3dc05
address feedback
gpx1000 Jul 22, 2025
6cf03fc
address feedback
gpx1000 Jul 22, 2025
50d78a7
add the flowchart to the rendering pipeline.
gpx1000 Jul 22, 2025
9b2c781
describe Rendergraphs and Dynamic Rendering
gpx1000 Jul 22, 2025
ddd1177
address comments.
gpx1000 Jul 22, 2025
5ec2035
add the requested appendix.adoc
gpx1000 Jul 22, 2025
31ded49
add the requested appendix.adoc
gpx1000 Jul 23, 2025
659ecb1
address the requested items
gpx1000 Jul 23, 2025
bd98b2d
address the requested items
gpx1000 Jul 23, 2025
8b83ead
address the requested items
gpx1000 Jul 23, 2025
9b2343a
address the requested items
gpx1000 Jul 23, 2025
7734f21
Engine now builds and runs. IMGUI having issues.
gpx1000 Jul 23, 2025
b8a9b39
Engine now renders. Bunch of validation errors and it looks like img…
gpx1000 Jul 23, 2025
e773353
address comments.
gpx1000 Jul 24, 2025
6256f77
address comments.
gpx1000 Jul 24, 2025
e6b8583
It runs now, IMGUI is happier.
gpx1000 Jul 24, 2025
e3f6fc6
everything runs and can close without validation warnings other than …
gpx1000 Jul 24, 2025
4a3b450
everything runs and can close without validation warnings other than …
gpx1000 Jul 24, 2025
0833166
audio HRTF works well and debug switch to turn on CPU only mode vs GP…
gpx1000 Jul 24, 2025
9513597
audio fully works, GPU HRTF works as well as CPU HRTF.
gpx1000 Jul 25, 2025
86c396a
The bistro scene now loads. Still have some issues with PBR but I th…
gpx1000 Jul 25, 2025
a62e4a9
make the hrtf listener sync with the camera location and rotation.
gpx1000 Jul 25, 2025
14fc6b1
Lighting working for non PBR code, and PBR code seems to be relativel…
gpx1000 Jul 25, 2025
b998a13
fix for formating the list.
gpx1000 Jul 29, 2025
8be59f4
PBR is working. KTX2 with BasisU is working.
gpx1000 Jul 29, 2025
be45542
Update 04_rendering_approaches.adoc
gpx1000 Jul 29, 2025
8bdf3d1
Update 04_rendering_approaches.adoc
gpx1000 Jul 30, 2025
e80fd23
address comments
gpx1000 Jul 30, 2025
20a9ade
Merge remote-tracking branch 'origin/Simple-Game-Engine' into Simple-…
gpx1000 Jul 30, 2025
d834c39
address comments
gpx1000 Jul 31, 2025
ea39e65
address comments
gpx1000 Jul 31, 2025
858b792
address comments
gpx1000 Jul 31, 2025
815aa79
Need to investigate a few things, (physics isn't colliding against th…
gpx1000 Jul 31, 2025
bdc1845
add in the dependences install scripts.
gpx1000 Jul 31, 2025
04c8b38
Merge branch 'refs/heads/upstream-main' into Simple-Game-Engine
gpx1000 Jul 31, 2025
cdb01db
attempt to fancy fix the windows install script.
gpx1000 Aug 1, 2025
16019ca
CMake: use PLATFORM_* defines via ANDROID, fix glfw condition, make s…
gpx1000 Aug 8, 2025
4b8198d
Fix the pathing for install_dependencies_windows.bat also fix CMakeLi…
gpx1000 Aug 8, 2025
14dcb35
Add instancing support, remove unused STB dependency, and fetch Bistr…
gpx1000 Aug 10, 2025
dd9713a
Refactor Vulkan memory handling, physics GPU initialization, and coll…
gpx1000 Aug 10, 2025
27715c0
address several comments (more still need to be addressed). And fix …
gpx1000 Aug 10, 2025
067ea74
Move Renderdoc out of the debug_system.h and into a "real world" rend…
gpx1000 Aug 11, 2025
a5edf28
the lighting in the PBR scene *looks* better. There's still a bit th…
gpx1000 Aug 11, 2025
adf461e
Remove shadows for now. We'll concentrate on them in the samples ver…
gpx1000 Aug 12, 2025
e57bc3d
Fix the string lights.
gpx1000 Aug 13, 2025
e1d7059
committing requested changes in stages.
gpx1000 Aug 15, 2025
1f17074
committing requested changes in stages.
gpx1000 Aug 15, 2025
acfbd6e
committing requested changes in stages.
gpx1000 Aug 15, 2025
5e38540
committing requested changes in stages.
gpx1000 Aug 15, 2025
a58b884
committing requested changes in stages.
gpx1000 Aug 15, 2025
4b4a243
committing requested changes in stages.
gpx1000 Aug 15, 2025
6ec7321
committing requested changes in stages.
gpx1000 Aug 15, 2025
8ecae4e
committing requested changes in stages.
gpx1000 Aug 15, 2025
345b137
committing requested changes in stages.
gpx1000 Aug 15, 2025
11e9a65
committing requested changes in stages.
gpx1000 Aug 15, 2025
5e6209c
committing requested changes in stages.
gpx1000 Aug 15, 2025
25e66d5
committing requested changes in stages.
gpx1000 Aug 15, 2025
5849fa5
switch from link to xref.
gpx1000 Aug 15, 2025
f1df3d2
addressing more comments.
gpx1000 Aug 15, 2025
7eaa47e
addressing more comments.
gpx1000 Aug 15, 2025
92c7f7d
addressing more comments.
gpx1000 Aug 15, 2025
625eb71
addressing more comments.
gpx1000 Aug 15, 2025
60ee95d
addressing more comments.
gpx1000 Aug 15, 2025
23952bc
addressing more comments.
gpx1000 Aug 15, 2025
65e5db3
addressing more comments.
gpx1000 Aug 15, 2025
e564b29
addressing more comments.
gpx1000 Aug 15, 2025
7b3e016
addressing more comments.
gpx1000 Aug 15, 2025
7bf9dab
addressing more comments.
gpx1000 Aug 15, 2025
47a6baa
addressing more comments.
gpx1000 Aug 15, 2025
44e7f38
addressing more comments.
gpx1000 Aug 15, 2025
dd51a38
addressing more comments.
gpx1000 Aug 15, 2025
f713e9c
addressing more comments.
gpx1000 Aug 15, 2025
9705b60
addressing more comments.
gpx1000 Aug 15, 2025
921eed4
addressing more comments.
gpx1000 Aug 15, 2025
2a22079
addressing more comments.
gpx1000 Aug 15, 2025
41e336e
addressing more comments.
gpx1000 Aug 15, 2025
b78f8b2
addressing more comments.
gpx1000 Aug 16, 2025
5c7a132
addressing more comments.
gpx1000 Aug 16, 2025
560b9f3
addressing more comments.
gpx1000 Aug 16, 2025
6db6b9d
addressing more comments.
gpx1000 Aug 16, 2025
02baf4d
addressing more comments.
gpx1000 Aug 16, 2025
0b0dddb
addressing more comments.
gpx1000 Aug 16, 2025
ccb5c15
addressing more comments.
gpx1000 Aug 19, 2025
aa321c0
addressing more comments.
gpx1000 Aug 19, 2025
5c4ec27
addressing more comments.
gpx1000 Aug 19, 2025
b4d6226
addressing more comments.
gpx1000 Aug 19, 2025
a8d11c6
addressing more comments.
gpx1000 Aug 19, 2025
b167c70
addressing more comments.
gpx1000 Aug 19, 2025
276d1cb
addressing more comments.
gpx1000 Aug 21, 2025
6e8adb4
implementing Spec-Gloss workflow and transmission materials.
gpx1000 Aug 25, 2025
e1ac508
updating nlohmann_json to v3.12.0.
gpx1000 Aug 25, 2025
bbbae41
update the default screenshot.
gpx1000 Aug 25, 2025
03d05cf
implementing support for asynchronous texture loading and improved Vu…
gpx1000 Aug 26, 2025
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
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ It also contains Vulkan usage clarifications, improved synchronization and new c
The repository is organized into several important directories:

* `en/` - Contains the tutorial content in English, organized by chapters
** The main tutorial covers fundamental Vulkan concepts (chapters 00-17)
** The "Building a Simple Engine" section builds upon these fundamentals to create a structured rendering engine
* `attachments/` - Contains code examples, shader files, and resources used in the tutorial
* `images/` - Contains illustrations, diagrams, and screenshots used in the tutorial
* `scripts/` - Contains utility scripts, including dependency installation scripts
Expand Down
9 changes: 9 additions & 0 deletions antora/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,13 @@
* xref:15_GLTF_KTX2_Migration.adoc[Migrating to Modern Asset Formats: glTF and KTX2]
* xref:16_Multiple_Objects.adoc[Rendering Multiple Objects]
* xref:17_Multithreading.adoc[Multithreading]
* xref:Building_a_Simple_Engine/introduction.adoc[Building a Simple Engine]
** xref:Building_a_Simple_Engine/Engine_Architecture/01_introduction.adoc[Engine Architecture]
** xref:Building_a_Simple_Engine/Camera_Transformations/01_introduction.adoc[Camera Transformations]
** xref:Building_a_Simple_Engine/Lighting_Materials/01_introduction.adoc[Lighting & Materials]
** xref:Building_a_Simple_Engine/GUI/01_introduction.adoc[GUI]
** xref:Building_a_Simple_Engine/Loading_Models/01_introduction.adoc[Loading Models]
** xref:Building_a_Simple_Engine/Subsystems/01_introduction.adoc[Subsystems]
** xref:Building_a_Simple_Engine/Tooling/01_introduction.adoc[Tooling]
** xref:Building_a_Simple_Engine/Mobile_Development/01_introduction.adoc[Mobile Development]
* xref:90_FAQ.adoc[FAQ]
Binary file not shown.
208 changes: 208 additions & 0 deletions attachments/simple_engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
cmake_minimum_required(VERSION 3.29)

# Enable C++ module dependency scanning
set(CMAKE_CXX_SCAN_FOR_MODULES ON)

project(SimpleEngine VERSION 1.0.0 LANGUAGES CXX C)

# Add CMake module path for custom find modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../CMake")

# Find required packages
find_package (glfw3 REQUIRED)
find_package (glm REQUIRED)
find_package (Vulkan REQUIRED)
find_package (tinygltf REQUIRED)
find_package (KTX REQUIRED)
find_package (OpenAL REQUIRED)

# set up Vulkan C++ module
add_library(VulkanCppModule)
add_library(Vulkan::cppm ALIAS VulkanCppModule)

target_compile_definitions(VulkanCppModule
PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_NO_STRUCT_CONSTRUCTORS=1
)
target_include_directories(VulkanCppModule
PRIVATE
"${Vulkan_INCLUDE_DIR}"
)
target_link_libraries(VulkanCppModule
PUBLIC
Vulkan::Vulkan
)

set_target_properties(VulkanCppModule PROPERTIES CXX_STANDARD 20)

target_sources(VulkanCppModule
PUBLIC
FILE_SET cxx_modules TYPE CXX_MODULES
BASE_DIRS
"${Vulkan_INCLUDE_DIR}"
FILES
"${Vulkan_INCLUDE_DIR}/vulkan/vulkan.cppm"
)


# Add the vulkan.cppm file directly as a source file
target_sources(VulkanCppModule
PRIVATE
"${Vulkan_INCLUDE_DIR}/vulkan/vulkan.cppm"
)

# Platform-specific settings
if(ANDROID)
# Android-specific settings
add_definitions(-DPLATFORM_ANDROID)
else()
# Desktop-specific settings
add_definitions(-DPLATFORM_DESKTOP)
endif()

# Shader compilation
# Find Slang shaders
file(GLOB SLANG_SHADER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/shaders/*.slang)

# Find slangc executable (optional)
find_program(SLANGC_EXECUTABLE slangc HINTS $ENV{VULKAN_SDK}/bin)

if(SLANGC_EXECUTABLE)
# Ensure the output directory for compiled shaders exists
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/shaders)

# Compile Slang shaders using slangc
foreach(SHADER ${SLANG_SHADER_SOURCES})
get_filename_component(SHADER_NAME ${SHADER} NAME)
get_filename_component(SHADER_NAME_WE ${SHADER_NAME} NAME_WE)
string(REGEX REPLACE "\.slang$" "" OUTPUT_NAME ${SHADER_NAME})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/shaders/${OUTPUT_NAME}.spv
COMMAND ${SLANGC_EXECUTABLE} ${SHADER} -target spirv -profile spirv_1_4 -emit-spirv-directly -o ${CMAKE_CURRENT_BINARY_DIR}/shaders/${OUTPUT_NAME}.spv
DEPENDS ${SHADER}
COMMENT "Compiling Slang shader ${SHADER_NAME} with slangc"
)
list(APPEND SHADER_SPVS ${CMAKE_CURRENT_BINARY_DIR}/shaders/${OUTPUT_NAME}.spv)
endforeach()

add_custom_target(shaders DEPENDS ${SHADER_SPVS})
else()
message(STATUS "slangc not found. Skipping shader compilation step.")
add_custom_target(shaders)
endif()

# Source files
set(SOURCES
main.cpp
engine.cpp
scene_loading.cpp
platform.cpp
renderer_core.cpp
renderer_rendering.cpp
renderer_pipelines.cpp
renderer_compute.cpp
renderer_utils.cpp
renderer_resources.cpp
memory_pool.cpp
resource_manager.cpp
entity.cpp
component.cpp
transform_component.cpp
mesh_component.cpp
camera_component.cpp
model_loader.cpp
audio_system.cpp
physics_system.cpp
imgui_system.cpp
imgui/imgui.cpp
imgui/imgui_draw.cpp
vulkan_device.cpp
pipeline.cpp
descriptor_manager.cpp
renderdoc_debug_system.cpp
)

# Create executable
add_executable(SimpleEngine ${SOURCES})
add_dependencies(SimpleEngine shaders)
set_target_properties (SimpleEngine PROPERTIES CXX_STANDARD 20)

# Link libraries
target_link_libraries(SimpleEngine PRIVATE
Vulkan::cppm
glm::glm
tinygltf::tinygltf
KTX::ktx
OpenAL::OpenAL
)

if(NOT ANDROID)
target_link_libraries(SimpleEngine PRIVATE glfw)
endif()

# Copy model and texture files if they exist
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/models)
add_custom_command(TARGET SimpleEngine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/models ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/models
COMMENT "Copying models to output directory"
)
endif()

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/textures)
add_custom_command(TARGET SimpleEngine POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/textures ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/textures
COMMENT "Copying textures to output directory"
)
endif()

# Add packaging configuration
include(CPack)

# Set package properties
set(CPACK_PACKAGE_NAME "SimpleEngine")
set(CPACK_PACKAGE_VENDOR "SimpleEngine Team")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A simple game engine built with Vulkan")
set(CPACK_PACKAGE_VERSION "1.0.0")
set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "SimpleEngine")

# Set platform-specific package generators
if(WIN32)
set(CPACK_GENERATOR "ZIP;NSIS")
set(CPACK_NSIS_PACKAGE_NAME "SimpleEngine")
set(CPACK_NSIS_DISPLAY_NAME "SimpleEngine")
set(CPACK_NSIS_HELP_LINK "https://github.com/yourusername/SimpleEngine")
set(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/yourusername/SimpleEngine")
set(CPACK_NSIS_CONTACT "your.email@example.com")
set(CPACK_NSIS_MODIFY_PATH ON)
elseif(APPLE)
set(CPACK_GENERATOR "ZIP;DragNDrop")
set(CPACK_DMG_VOLUME_NAME "SimpleEngine")
set(CPACK_DMG_FORMAT "UDBZ")
else()
set(CPACK_GENERATOR "ZIP;DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Your Name <your.email@example.com>")
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libvulkan1, libglfw3, libglm-dev, libktx-dev")
endif()

# Include binary and resource directories in the package
install(TARGETS SimpleEngine DESTINATION bin)
if(SLANGC_EXECUTABLE)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/shaders DESTINATION share/SimpleEngine)
endif()

# Install models and textures if they exist
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/models)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/models DESTINATION share/SimpleEngine)
endif()

if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/textures)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/textures DESTINATION share/SimpleEngine)
endif()

# Install README if it exists
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.md DESTINATION share/SimpleEngine)
endif()
Loading
Loading