Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
85c1a8d
Working on point lights
tippesi Aug 18, 2024
804eb36
Some more changes, needs visual debugging
tippesi Aug 18, 2024
f14eb6a
More changes
tippesi Aug 18, 2024
7f92f7d
Point lights are now working properly
tippesi Aug 19, 2024
f41a3f6
Upgrade Jolt + other things
tippesi Aug 20, 2024
fe3aded
Merge branch 'feature/point-lights' of https://github.com/tippesi/Atl…
tippesi Aug 20, 2024
c19db11
Fix build pipelines
tippesi Aug 20, 2024
569d1e7
Some quality of life improvements
tippesi Aug 22, 2024
d38fed7
Restructuring scene rendering data
tippesi Aug 25, 2024
9c8c6ee
Fixed a few things + started working on bloom
tippesi Aug 27, 2024
046af84
Bloom
tippesi Aug 28, 2024
daf0d6a
Fixed some smaller issues
tippesi Aug 28, 2024
7992cca
Fixed a few more issues
tippesi Aug 28, 2024
2ff44bd
Downgrade jolt due to material issue
tippesi Aug 30, 2024
18fa989
Reverted some bloom changes
tippesi Aug 31, 2024
9312eb4
Merge branch 'feature/point-lights' of https://github.com/tippesi/Atl…
tippesi Aug 31, 2024
303d580
A number of improvements
tippesi Sep 1, 2024
22d48e8
Merge branch 'feature/point-lights' of https://github.com/tippesi/Atl…
tippesi Sep 1, 2024
e934c58
Ouput stacktrace on validation error
tippesi Sep 3, 2024
0922510
Fix some of the build issues
tippesi Sep 3, 2024
8eee3bd
Fixed more issues
tippesi Sep 4, 2024
f5ee730
Update build.yml
tippesi Sep 5, 2024
91e7f94
Fix MacOS build issue
tippesi Sep 7, 2024
a99d857
Trying to fix it finally
tippesi Sep 7, 2024
6a88224
Try to fix Linux build
tippesi Sep 7, 2024
7064aef
Still trying to fix Linux build issue
tippesi Sep 7, 2024
df29112
More
tippesi Sep 7, 2024
ac7d5cb
Try even more
tippesi Sep 7, 2024
233b4b0
More tests
tippesi Sep 7, 2024
f2c0502
Remove upgrade
tippesi Sep 7, 2024
6409b76
Try some more
tippesi Sep 7, 2024
56332e3
Again
tippesi Sep 7, 2024
2e01bc0
Try with newer Jolt version
tippesi Sep 7, 2024
0c21cc2
Turn validation layers off
tippesi Sep 7, 2024
6a4bb70
Path tracing uses normal render target now + bloom and point light fixes
tippesi Sep 10, 2024
efee683
Merge remote-tracking branch 'origin/master' into feature/point-lights
tippesi Sep 10, 2024
28b1863
Implemented spot lights
tippesi Sep 11, 2024
2f5ff4d
Emissive texture support
tippesi Sep 12, 2024
b14e287
Fixed threading issues
tippesi Sep 12, 2024
f1c43d1
Up to 4096 lights in the frustum can now be visible
tippesi Sep 12, 2024
eb12dc0
Improved UI + UI performance
tippesi Sep 13, 2024
94b7cd7
Fixed a shader bug
tippesi Sep 13, 2024
7363785
A lot of editor UI changes
tippesi Sep 14, 2024
7fbe618
Some fixes for the previous changes
tippesi Sep 14, 2024
6f1a377
Small fixes
tippesi Sep 15, 2024
d4e9dcb
Fix more issues
tippesi Sep 15, 2024
8c5269b
Try to fix remaining issues
tippesi Sep 15, 2024
d9f64d9
Update DescriptorSetLayout.cpp
tippesi Sep 16, 2024
c9d2a28
Initial light culling code
tippesi Sep 17, 2024
1ebe50f
Merge branch 'feature/point-lights' of https://github.com/tippesi/Atl…
tippesi Sep 17, 2024
f24b046
Bunch of fixes and improvements
tippesi Sep 20, 2024
39f6eb2
Fixed some shaders
tippesi Sep 20, 2024
058c12f
Working on some improvements
tippesi Sep 20, 2024
62b471d
Made some adjustments
tippesi Sep 21, 2024
05dd18d
Fixed issues
tippesi Sep 25, 2024
02c3cba
New volumetric lighting + fixes + improvements
tippesi Oct 4, 2024
eec229b
Fixes + reduce memory allocations
tippesi Oct 5, 2024
0bdc241
Some adjustments
tippesi Oct 15, 2024
17d418b
Improved tests
tippesi Oct 16, 2024
2d67be5
SSR support
tippesi Oct 17, 2024
2276a8c
Fixed a few things
tippesi Oct 20, 2024
ae495dc
Some important fixes
tippesi Oct 24, 2024
ba953d3
Working on more general BLASes (e.g. terrain)
tippesi Oct 26, 2024
5aafefd
More chaanges
tippesi Oct 26, 2024
33760ea
More changes
tippesi Oct 26, 2024
7641cc7
Fixed software raytracing issues
tippesi Oct 26, 2024
8e9a4fc
Improvements and fixes
tippesi Oct 27, 2024
33011c2
Added different SSGI option
tippesi Oct 29, 2024
6e97b51
Some more improvements
tippesi Nov 1, 2024
a61a1bc
Performance improvements and fixes
tippesi Nov 2, 2024
b23a32f
Fixed shader issues
tippesi Nov 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
committish: a993be073c6baea8674117f3eaed6e2d2486aaae
cache: ${{ env.USE_CACHE }}

# This doesn't work when the Visual Studio C++ CLI was set up first (maybe needs a setup with 2019 version)
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
compression-level: 9

linux-build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
name: Build on Linux
# Run both builds in parallel and don't cancel if one fails
strategy:
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
committish: a993be073c6baea8674117f3eaed6e2d2486aaae
cache: ${{ env.USE_CACHE }}

- name: Setup Ninja
Expand All @@ -225,8 +225,10 @@ jobs:
shell: bash
# Add additional scripting steps here
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev
sudo apt update
sudo apt install libgl1-mesa-dev autoconf automake libtool pkg-config libltdl-dev g++-14 gcc-14 -y
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 14
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14
cd ${{ github.workspace }}
${{ github.workspace }}/vcpkg/vcpkg install --clean-after-build --triplet=x64-linux
rm -r vcpkg_installed
Expand Down Expand Up @@ -337,7 +339,7 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
committish: a993be073c6baea8674117f3eaed6e2d2486aaae
cache: ${{ env.USE_CACHE }}

- name: Setup Ninja
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
committish: a993be073c6baea8674117f3eaed6e2d2486aaae

- name: Delete MSVC tool version
shell: pwsh
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
committish: a993be073c6baea8674117f3eaed6e2d2486aaae

- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
Expand Down Expand Up @@ -178,7 +178,8 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
committish: a993be073c6baea8674117f3eaed6e2d2486aaae
cache: ${{ env.USE_CACHE }}

- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ data/pirates
data/meadow
.vscode
data/elven
data/dungeon
data/namaqualand
data/quarry
data/hiddenalley
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0074 NEW)
cmake_policy(SET CMP0011 NEW)
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0141 NEW)
endif(COMMAND cmake_policy)

cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.25)

project(AtlasEngine VERSION 0.2.0)
project(AtlasEngine VERSION 0.2.1)

# Only 64 bit is supported
###################################################################
Expand All @@ -31,13 +32,19 @@ option(ATLAS_ASSIMP "Activate Assimp integration" ON)
option(ATLAS_HEADLESS "Activate support for running the engine in headless mode" OFF)
option(ATLAS_BINDLESS "Activate support for running the engine with bindless resources turned on" ON)
option(ATLAS_BUNDLE "Allows the applications to be bundled and installed on MacOS" OFF)
option(ATLAS_MSVC_HOT_RELOAD "Configures all targets to be hot-reloadable" OFF)

if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
option(ATLAS_TESTS "Activate support for running the engine with bindless resources turned on" ON)
else()
option(ATLAS_TESTS "Activate support for running the engine with bindless resources turned on" OFF)
endif()

# Hot reloading in Windows, enabled for all targets
if ((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND ATLAS_MSVC_HOT_RELOAD)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /INCREMENTAL:YES" )
endif()

if (ATLAS_DEMO)
set (ATLAS_IMGUI ON)
Expand All @@ -49,13 +56,13 @@ if (ATLAS_EDITOR)
set (ATLAS_IMGUI ON)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

if (CYGWIN OR MINGW)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -O3 -std=gnu++20" )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -O3 -std=gnu++23" )
endif()

if (ANDROID)
Expand Down Expand Up @@ -91,7 +98,7 @@ find_package(VulkanMemoryAllocator CONFIG REQUIRED)
find_package(glslang CONFIG REQUIRED)
find_package(SPIRV-Tools-opt CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(unofficial-joltphysics CONFIG REQUIRED)
find_package(Jolt CONFIG REQUIRED)
find_package(Lua REQUIRED)
find_package(sol2 CONFIG REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This is a cross platform toy engine developed in my spare time that is available
>The current version (0.2.0) contains many API changes and is still an active WIP
## Requirements
- Vulkan SDK
- C++20 compatible compiler
- C++23 compatible compiler
- CMake
- Vcpkg
## Set up
Expand Down
2 changes: 1 addition & 1 deletion data/scenes/sponza.aescene

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions data/shader/bloom

This file was deleted.

16 changes: 0 additions & 16 deletions data/shader/bloom.fsh

This file was deleted.

10 changes: 0 additions & 10 deletions data/shader/bloom.vsh

This file was deleted.

Empty file added data/shader/bloom/bloom.hsh
Empty file.
112 changes: 112 additions & 0 deletions data/shader/bloom/bloomDownsample.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
layout (local_size_x = 16, local_size_y = 16) in;

#include <../common/utility.hsh>
#include <../common/types.hsh>
#include <../common/flatten.hsh>

layout (set = 3, binding = 0, rgba16f) writeonly uniform image2D textureOut;
layout (set = 3, binding = 1) uniform sampler2D textureIn;

layout(push_constant) uniform constants {
int mipLevel;
float threshold;
} pushConstants;

const uint supportSize = 2;
const uint sharedDataSize = (2u * gl_WorkGroupSize.x + 2u * supportSize) * (2u * gl_WorkGroupSize.y + 2u * supportSize);
const ivec2 unflattenedSharedDataSize = 2 * ivec2(gl_WorkGroupSize) + 2 * int(supportSize);

shared vec3 sharedMemory[sharedDataSize];

const ivec2 pixelOffsets[4] = ivec2[4](
ivec2(0, 0),
ivec2(1, 0),
ivec2(0, 1),
ivec2(1, 1)
);

AeF16 Luma(AeF16x3 color) {

const AeF16x3 luma = AeF16x3(0.299, 0.587, 0.114);
return dot(color, luma);

}

AeF16x3 Prefilter(AeF16x3 color) {

AeF16 brightness = Luma(color);
AeF16 contribution = max(AeF16(0.0), brightness - AeF16(pushConstants.threshold));
contribution /= max(brightness, AeF16(0.001));
return color * contribution;

}


AeF16x3 Sample(vec2 texCoord) {

if (pushConstants.mipLevel == 0) {
return Prefilter(AeF16x3(textureLod(textureIn, texCoord, float(pushConstants.mipLevel)).rgb));
}
else {
return AeF16x3(textureLod(textureIn, texCoord, float(pushConstants.mipLevel)).rgb);
}

}

void main() {

ivec2 size = imageSize(textureOut);
ivec2 coord = ivec2(gl_GlobalInvocationID);

if (coord.x < size.x && coord.y < size.y) {

// Lower mip tex coord
vec2 texCoord = (coord + 0.5) / size;
// Upper mip texel size
vec2 texelSize = 1.0 / vec2(textureSize(textureIn, pushConstants.mipLevel));

// We always sample at pixel border, not centers
AeF16x3 outer00 = Sample(texCoord + vec2(-2.0 * texelSize.x, -2.0 * texelSize.y));
AeF16x3 outer10 = Sample(texCoord + vec2(0.0, -2.0 * texelSize.y));
AeF16x3 outer20 = Sample(texCoord + vec2(2.0 * texelSize.x, -2.0 * texelSize.y));

AeF16x3 outer01 = Sample(texCoord + vec2(-2.0 * texelSize.x, 0.0));
AeF16x3 outer11 = Sample(texCoord + vec2(0.0, 0.0));
AeF16x3 outer21 = Sample(texCoord + vec2(2.0 * texelSize.x, 0.0));

AeF16x3 outer02 = Sample(texCoord + vec2(-2.0 * texelSize.x, 2.0 * texelSize.y));
AeF16x3 outer12 = Sample(texCoord + vec2(0.0, 2.0 * texelSize.y));
AeF16x3 outer22 = Sample(texCoord + vec2(2.0 * texelSize.x, 2.0 * texelSize.y));

AeF16x3 inner00 = Sample(texCoord + vec2(-texelSize.x, -texelSize.y));
AeF16x3 inner10 = Sample(texCoord + vec2(texelSize.x, -texelSize.y));
AeF16x3 inner01 = Sample(texCoord + vec2(-texelSize.x, texelSize.y));
AeF16x3 inner11 = Sample(texCoord + vec2(texelSize.x, texelSize.y));

AeF16x3 outerGroup0 = AeF16(0.125 * 0.25) * (outer00 + outer10 + outer01 + outer11);
AeF16x3 outerGroup1 = AeF16(0.125 * 0.25) * (outer10 + outer20 + outer11 + outer21);
AeF16x3 outerGroup2 = AeF16(0.125 * 0.25) * (outer01 + outer11 + outer02 + outer12);
AeF16x3 outerGroup3 = AeF16(0.125 * 0.25) * (outer11 + outer21 + outer12 + outer22);
AeF16x3 innerGroup = AeF16(0.5 * 0.25) * (inner00 + inner10 + inner01 + inner11);

if (pushConstants.mipLevel == 0) {
AeF16 outerGroup0Weight = (AeF16(1.0) / (AeF16(1.0) + Luma(outerGroup0)));
AeF16 outerGroup1Weight = (AeF16(1.0) / (AeF16(1.0) + Luma(outerGroup1)));
AeF16 outerGroup2Weight = (AeF16(1.0) / (AeF16(1.0) + Luma(outerGroup2)));
AeF16 outerGroup3Weight = (AeF16(1.0) / (AeF16(1.0) + Luma(outerGroup3)));
AeF16 innerGroupWeight = (AeF16(1.0) / (AeF16(1.0) + Luma(innerGroup)));

outerGroup0 *= outerGroup0Weight;
outerGroup1 *= outerGroup1Weight;
outerGroup2 *= outerGroup2Weight;
outerGroup3 *= outerGroup3Weight;
innerGroup *= innerGroupWeight;
}

vec3 filtered = outerGroup0 + outerGroup1 + outerGroup2 + outerGroup3 + innerGroup;

imageStore(textureOut, coord, vec4(filtered, 1.0));

}

}
64 changes: 64 additions & 0 deletions data/shader/bloom/bloomUpsample.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#include <../common/types.hsh>

layout (local_size_x = 8, local_size_y = 8) in;

layout (set = 3, binding = 0, rgba16f) writeonly uniform image2D textureOut;
layout (set = 3, binding = 1) uniform sampler2D textureIn;

layout(push_constant) uniform constants {
int additive;
int mipLevel;
float filterSize;
} pushConstants;

AeF16x3 Sample(vec2 texCoord) {

return AeF16x3(textureLod(textureIn, texCoord, float(pushConstants.mipLevel)).rgb);

}

void main() {

ivec2 size = imageSize(textureOut);
ivec2 coord = ivec2(gl_GlobalInvocationID);

if (coord.x < size.x &&
coord.y < size.y) {

// Lower mip tex coord
vec2 texCoord = (coord + 0.5) / size;
// Upper mip texel size
vec2 texelSize = 1.0 / textureSize(textureIn, pushConstants.mipLevel);
vec2 filterSize = vec2(pushConstants.filterSize);
texelSize = max(filterSize, filterSize);

// We always sample at pixel border, not centers
AeF16x3 filter00 = Sample(texCoord + vec2(-texelSize.x, -texelSize.y));
AeF16x3 filter10 = Sample(texCoord + vec2(0.0, -texelSize.y));
AeF16x3 filter20 = Sample(texCoord + vec2(texelSize.x, -texelSize.y));

AeF16x3 filter01 = Sample(texCoord + vec2(-texelSize.x, 0.0));
AeF16x3 filter11 = Sample(texCoord + vec2(0.0, 0.0));
AeF16x3 filter21 = Sample(texCoord + vec2(texelSize.x, 0.0));

AeF16x3 filter02 = Sample(texCoord + vec2(-texelSize.x, texelSize.y));
AeF16x3 filter12 = Sample(texCoord + vec2(0.0, texelSize.y));
AeF16x3 filter22 = Sample(texCoord + vec2(texelSize.x, texelSize.y));

AeF16x3 filtered = AeF16x3(0.0);

filtered += AeF16(4.0) * filter11;
filtered += AeF16(2.0) * (filter10 + filter01 + filter21 + filter12);
filtered += AeF16(1.0) * (filter00 + filter20 + filter02 + filter22);
filtered /= AeF16(16.0);

if (pushConstants.additive > 0) {
imageStore(textureOut, coord, vec4(filtered + filter11, 1.0));
}
else {
imageStore(textureOut, coord, vec4(filtered, 1.0));
}

}

}
4 changes: 2 additions & 2 deletions data/shader/clouds/clouds.hsh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <../common/utility.hsh>
#include <../structures>
#include <../structures.hsh>

layout(set = 3, binding = 1) uniform sampler2D depthTexture;
layout(set = 3, binding = 2) uniform sampler3D shapeTexture;
layout(set = 3, binding = 3) uniform sampler3D detailTexture;
layout(set = 3, binding = 4) uniform sampler2D coverageTexture;

layout(set = 1, binding = 10) uniform samplerCube diffuseProbe;
layout(set = 1, binding = 12) uniform samplerCube diffuseProbe;

layout(std140, set = 3, binding = 5) uniform CloudUniformBuffer {
Light light;
Expand Down
2 changes: 1 addition & 1 deletion data/shader/clouds/integrate.csh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <../globals.hsh>
#include <../structures>
#include <../structures.hsh>
#include <../common/stencil.hsh>
#include <../common/convert.hsh>
#include <../common/utility.hsh>
Expand Down
Loading