Skip to content

Commit

Permalink
General enhancements (#59)
Browse files Browse the repository at this point in the history
* Improved shadow performance

* Many effects can now work at full resolution

* Fix and improve a bunch of things

* Better upsampling of reflections and SSGI

* Fixed some more issues

* More fixes

* More fixes

* Fixed async ray tracing update issues

* Fixed broken matrix decomposition for negative scales

* Fixed upsampling issue + made hot shader reload asynchronous

* Fixed volumetric cloud flickering

* Added reactive mask generation

* Fix for wind map issue

* Extended visualization options and bug fixes

* Try cascaded DDGI

* Works now + discrete steps

* Many adjustments to cascaded GI

* Fixed most of the remaining cascaded DDGI issues

* Smaller adjustments

* Better wind

* Small improvements

* Added scene statistics panel

* Improved CPU performance

* Many more fixes + UI improvements

* Scripting adjustments

* Small changes to save half resolution to JSON

* More CPU perf improvements with multithreading

* Make better use of bindless resources and reduce CPU bindings

* Improved GPU ray tracing performance and stability

* Some fixes/improvements for MacOS

* Some more fixes to get the headless mode to work again

* More fixes

* Fix bunch of code style issues

* More code style fixes

* Try something else

* More tries

* Check some more failure cases

* Better ocean

* More fixes

* Updated JoltPhysics and added lua bindings for physics

* More scripting improvements

* Reordered lua bindings for faster compile times

* Try to improve compilation times

* Script properties can now be set properly

* Fixed the build issues

* Fixed many more issues

* Fixed a few more DDGI issues

* Permanent playing option for audio components

* Fixed a vertex buffer binding issue

* Fixed multi-config CMake generator issue + improved MacOS CPU rendering performance

* Upgraded several dependencies

* More package changes

* Build pipeline changes

* Fixed the Windows compilation issue

* Try again

* try again

* Trying out RTGI

* Important fixes to RTGI

* Instance masking for raytracing and upscaling improvements

* Fixed some editor issues

* Improved cloud temporal accumulation

* Added async content discovery

* Preparations for greater rework

* Working on model importer improvements

* Initial working version with new mesh import/loading/saving

* More changes

* Some fixes

* Pipeline configs moved to mesh data + more stuff

* More adjustments

* Bit of an incomplete texture and material selection

* Fixed some UI issues

* Should fix build issues

* Added a proper job system

* Fixed compilation issue

* More job system fixes

* More fixes

* More improvements

* Fix current build issues

* More fixes

* Environment maps can now be used + bug fixes

* Possible delete of resource in editor

* Fixed a number of things

* Fixed even more issues

* More stuff

* Atmosphere shader changes

* Performance improvements

* Even more improvements

* Fixed a few more things

* Fixed more bugs
  • Loading branch information
tippesi authored Aug 18, 2024
1 parent 6820993 commit ebab3c3
Show file tree
Hide file tree
Showing 480 changed files with 10,530 additions and 3,956 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ name: Build pipeline

on:
workflow_dispatch:
inputs:
build_type_release:
description: 'Release CMake build type'
required: true
default: 'Release'
build_type_debug:
description: 'Debug CMake build type'
required: true
default: 'Debug'
build_use_cache:
description: 'Whether to use the vcpkg cache or not'
type: boolean
required: false
default: true

push:
branches:
- '*'
Expand All @@ -10,9 +25,9 @@ on:

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE_DEBUG: Debug
BUILD_TYPE_RELEASE: Release
USE_CACHE: true
BUILD_TYPE_DEBUG: ${{ github.event.inputs.build_type_debug }}
BUILD_TYPE_RELEASE: ${{ github.event.inputs.build_type_release }}
USE_CACHE: ${{ github.event.inputs.build_use_cache == true || github.event.inputs.build_use_cache == null }}
RUN_TESTS: true

jobs:
Expand Down Expand Up @@ -47,7 +62,7 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 5786fcb0cb5eb08d1931a230dad9701e7a6c37f0
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
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 @@ -190,7 +205,7 @@ jobs:
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 5786fcb0cb5eb08d1931a230dad9701e7a6c37f0
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
cache: ${{ env.USE_CACHE }}

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

- name: Setup Ninja
Expand Down
77 changes: 73 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
release_version:
description: 'Release version'
required: true
default: '0.1.0'
default: '0.2.0'

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand All @@ -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: 5786fcb0cb5eb08d1931a230dad9701e7a6c37f0
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18

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

- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
Expand Down Expand Up @@ -159,11 +159,80 @@ jobs:
${{ github.workspace }}/bin/**/*.so*
!**/CMakeFiles
macos-build:
runs-on: macos-13
name: Build on MacOS
# Run both builds in parallel and don't cancel if one fails
strategy:
matrix:
build-type: [Release]
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Vcpkg
uses: friendlyanon/setup-vcpkg@v1
# Committish: The commit sha of the vcpkg repo, same as in vcpkg.json
with:
committish: 821100d967e1737d96414a308e3f7cbe0d1abf18
cache: ${{ env.USE_CACHE }}

- name: Setup Ninja
uses: ashutoshvarma/setup-ninja@master
with:
# ninja version to download. Default: 1.10.0
version: 1.10.0

- name: Install Vulkan SDK
uses: humbletim/[email protected]
with:
version: 1.3.261.1
cache: true

- name: Run scripts
shell: bash
# Add additional scripting steps here
run: |
cd ${{ github.workspace }}
brew install pkg-config
${{ github.workspace }}/vcpkg/vcpkg install --clean-after-build --triplet=x64-osx
rm -r vcpkg_installed
# https://github.com/marketplace/actions/setup-ninja
- name: Build ${{ matrix.build-type }} configuration with CMake
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build/${{ matrix.build-type }}
source-dir: ${{ github.workspace }}
cc: "clang"
cxx: "clang++"
configure-options: -DCMAKE_TOOLCHAIN_FILE='${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake'
-DATLAS_DEMO=ON -DATLAS_TESTS=OFF -DATLAS_EDITOR=ON -G Ninja
parallel: 16
build-type: ${{ matrix.build-type }}

- name: Upload artifact
if: ${{ matrix.build-type == 'Release' }}
uses: actions/upload-artifact@v2
with:
name: Atlas Engine MacOS ${{ matrix.build-type }}
path: |
data
README.md
LICENSE.md
THIRDPARTY.md
${{ github.workspace }}/bin/**/AtlasEngineDemo
${{ github.workspace }}/bin/**/AtlasEngineEditor
${{ github.workspace }}/bin/**/*.dylib*
!**/CMakeFiles
release:
runs-on: ubuntu-latest
name: Create a new release
environment: release
needs: [windows-build, linux-build]
needs: [windows-build, linux-build, macos-build]

steps:
- name: Download artifacts
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ data/mis
data/ancient
data/farm
data/town
data/tropical
data/scifiy city
data/pirates
data/meadow
.vscode
data/elven
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ if (ATLAS_DEMO)
endif()

if (ATLAS_EDITOR)
find_package(imguizmo CONFIG REQUIRED)
find_package(unofficial-imguizmo CONFIG REQUIRED)
add_subdirectory(${EDITOR_LOCATION})
endif()

Expand Down
Binary file added data/editor/icons/delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/delete_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/environment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/environment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/environment_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/eye.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/eye_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/material.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/material.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/material_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/meshSource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/meshSource.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/meshSource_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/moreHoriz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/moreHoriz.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/moreHoriz_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/moreVert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/moreVert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/moreVert_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/move.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/move.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/move_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/editor/icons/rotate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/editor/icons/rotate.svg
Binary file added data/editor/icons/rotate_light.png
Binary file added data/editor/icons/scale.png
1 change: 1 addition & 0 deletions data/editor/icons/scale.svg
Binary file added data/editor/icons/scale_light.png
1 change: 1 addition & 0 deletions data/materials/CapsuleMaterial.aematerial
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ao":1.0,"baseColor":{"x":1.0,"y":1.0,"z":1.0},"displacementScale":0.009999999776482582,"emissiveColor":{"x":0.0,"y":0.0,"z":0.0},"emissiveIntensity":1.0,"metalness":0.0,"name":"CapsuleMaterial","normalScale":0.5,"opacity":1.0,"reflectance":0.5,"roughness":0.20175451040267944,"tiling":1.0,"transmissiveColor":{"x":0.0,"y":0.0,"z":0.0},"twoSided":true,"uvChannel":0,"vertexColors":false}
1 change: 1 addition & 0 deletions data/materials/Chrome.aematerial
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ao":1.0,"baseColor":{"x":0.800000011920929,"y":0.800000011920929,"z":0.800000011920929},"displacementScale":0.009999999776482582,"emissiveColor":{"x":0.007193333003669977,"y":0.007193333003669977,"z":0.007193333003669977},"emissiveIntensity":1.0,"metalness":1.0,"name":"Chrome","normalScale":0.5,"opacity":1.0,"reflectance":0.5,"roughness":0.0,"tiling":1.0,"transmissiveColor":{"x":0.0,"y":0.0,"z":0.0},"twoSided":true,"uvChannel":0,"vertexColors":false}
1 change: 1 addition & 0 deletions data/materials/Material.001.aematerial
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ao":1.0,"baseColor":{"x":0.800000011920929,"y":0.800000011920929,"z":0.800000011920929},"displacementScale":0.009999999776482582,"emissiveColor":{"x":0.0,"y":0.0,"z":0.0},"emissiveIntensity":1.0,"metalness":1.0,"name":"Material.001","normalScale":0.5,"opacity":1.0,"reflectance":0.5,"roughness":0.5,"tiling":1.0,"transmissiveColor":{"x":0.0,"y":0.0,"z":0.0},"twoSided":true,"uvChannel":0,"vertexColors":false}
Binary file added data/meshes/capsule.aemesh
Binary file not shown.
Binary file added data/meshes/chromesphere.aemesh
Binary file not shown.
Binary file added data/meshes/metallicwall.aemesh
Binary file not shown.
1 change: 1 addition & 0 deletions data/prefabs/FirstPersonCameraPlayer.aeprefab
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"camera":{"aspectRatio":2.0,"exposure":1.0,"farPlane":400.0,"fieldOfView":45.0,"isMain":true,"location":{"x":0.0,"y":1.7000000476837158,"z":0.0},"nearPlane":1.0,"rotation":{"x":0.0,"y":0.0},"thirdPerson":false,"thirdPersonDistance":15.0,"useEntityRotation":false,"useEntityTranslation":true},"id":7720,"name":{"name":"FirstPersonCameraPlayer"},"player":{"allowInput":true,"creationSettings":{"shape":{"capsuleShapeSettings":{"density":1.0,"height":1.2000000476837158,"radius":0.30000001192092896,"scale":{"x":1.0,"y":1.0,"z":1.0}}}},"fastVelocity":4.0,"jumpVelocity":4.0,"slowVelocity":1.600000023841858},"script":{"permanentExecution":false,"resourcePath":"scripts/firstPersonCamera.lua"},"transform":{"isStatic":false,"matrix":{"j0":{"w":0.0,"x":1.0,"y":0.0,"z":0.0},"j1":{"w":0.0,"x":0.0,"y":1.0,"z":0.0},"j2":{"w":0.0,"x":0.0,"y":0.0,"z":1.0},"j3":{"w":1.0,"x":0.0,"y":0.0,"z":0.0}}}}
2 changes: 1 addition & 1 deletion data/scenes/sponza.aescene

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions data/scripts/firstPersonCamera.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- This is a comment

function Update(delta)

-- Only update the player rotation if there is input
local playerInput = (Atlas.KeyboardMap.IsKeyPressed(Atlas.Keycode.KeyW, true) or
Atlas.KeyboardMap.IsKeyPressed(Atlas.Keycode.KeyA, true) or
Atlas.KeyboardMap.IsKeyPressed(Atlas.Keycode.KeyS, true) or
Atlas.KeyboardMap.IsKeyPressed(Atlas.Keycode.KeyD, true))

if playerInput ~= true then
return
end

local entity = GetThisEntity()
local scene = GetThisScene()

local camera = entity:GetCameraComponent()
local transform = entity:GetTransformComponent()
local player = entity:GetPlayerComponent()

local rotationMatrix = Glm.Rotate(Glm.Mat4(1.0), camera.rotation.x, Glm.Vec3(0.0, 1.0, 0.0))
local recomposed = Atlas.MatrixDecomposition(rotationMatrix)

player:SetRotation(Glm.Quat(recomposed.rotation))

end
42 changes: 42 additions & 0 deletions data/scripts/rotateEntity.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
-- This is a comment

ScriptProperties = {
rotationAxis = { type = "integer", value = 0 },
rotationSpeed = { type = "double", value = 1.0 }
}

totalRotation = 0.0

function Update(delta)

local entity = GetThisEntity()
local scene = GetThisScene()

transform = entity:GetTransformComponent()

if transform == nil then
return
end

local decomp = transform:Decompose()

local offset = Atlas.Clock.GetDelta() * ScriptProperties.rotationSpeed.value
totalRotation = totalRotation + offset

local rotationVec = Glm.Vec3(0.0)
if ScriptProperties.rotationAxis.value == 0 then
rotationVec.x = 1.0
end
if ScriptProperties.rotationAxis.value == 1 then
rotationVec.y = 1.0
end
if ScriptProperties.rotationAxis.value == 2 then
rotationVec.z = 1.0
end

local updateMatrix = Glm.Rotate(transform.matrix, offset, rotationVec)

local matrix = decomp:Compose()
transform:Set(updateMatrix)

end
4 changes: 2 additions & 2 deletions data/shader/ao/rtao.csh
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ void main() {
ray.hitDistance = 0.0;

#ifdef OPACITY_CHECK
float hit = 1.0 - HitAnyTransparency(ray, 0.0, uniforms.radius);
float hit = 1.0 - HitAnyTransparency(ray, INSTANCE_MASK_ALL, 0.0, uniforms.radius);
ao += hit;
#else
bool hit = HitAny(ray, 0.0, uniforms.radius);
bool hit = HitAny(ray, INSTANCE_MASK_ALL, 0.0, uniforms.radius);
ao += hit ? 1.0 : 0.0;
#endif

Expand Down
14 changes: 10 additions & 4 deletions data/shader/ao/temporal.csh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ layout(set = 3, binding = 10) uniform sampler2D historyDepthTexture;
layout(set = 3, binding = 11) uniform sampler2D historyNormalTexture;
layout(set = 3, binding = 12) uniform usampler2D historyMaterialIdxTexture;

layout(push_constant) uniform constants {
int resetHistory;
} pushConstants;

vec2 invResolution = 1.0 / vec2(imageSize(resolveImage));
vec2 resolution = vec2(imageSize(resolveImage));

Expand Down Expand Up @@ -172,6 +176,7 @@ bool SampleHistory(ivec2 pixel, vec2 historyPixel, out float history, out float
float depth = texelFetch(depthTexture, pixel, 0).r;

float linearDepth = ConvertDepthToViewSpaceDepth(depth);
float depthPhi = 16.0 / abs(linearDepth);

// Calculate confidence over 2x2 bilinear neighborhood
// Note that 3x3 neighborhoud could help on edges
Expand All @@ -182,11 +187,11 @@ bool SampleHistory(ivec2 pixel, vec2 historyPixel, out float history, out float
offsetPixel = clamp(offsetPixel, ivec2(0), ivec2(resolution) - ivec2(1));

vec3 historyNormal = DecodeNormal(texelFetch(historyNormalTexture, offsetPixel, 0).rg);
confidence *= pow(abs(dot(historyNormal, normal)), 2.0);
confidence *= pow(dot(historyNormal, normal), 16.0);

float historyDepth = texelFetch(historyDepthTexture, offsetPixel, 0).r;
float historyLinearDepth = ConvertDepthToViewSpaceDepth(historyDepth);
confidence *= min(1.0 , exp(-abs(linearDepth - historyLinearDepth)));
confidence *= min(1.0 , exp(-abs(linearDepth - historyLinearDepth) * depthPhi));

if (confidence > 0.2) {
totalWeight += weights[i];
Expand Down Expand Up @@ -251,13 +256,14 @@ void main() {
factor = (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0
|| uv.y > 1.0) ? 0.0 : factor;

factor = pushConstants.resetHistory > 0 ? 0.0 : factor;

if (factor == 0.0 || !valid) {
historyLength = 0.0;
}

factor = min(factor, historyLength / (historyLength + 1.0));

float resolve = mix(currentValue, historyValue, factor);
float resolve = factor <= 0.0 ? currentValue : mix(currentValue, historyValue, factor);

imageStore(historyLengthImage, pixel, vec4(historyLength + 1.0, 0.0, 0.0, 0.0));
imageStore(resolveImage, pixel, vec4(resolve, 0.0, 0.0, 0.0));
Expand Down
Loading

0 comments on commit ebab3c3

Please sign in to comment.