Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General enhancements #59

Merged
merged 89 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
76435f4
Improved shadow performance
tippesi Mar 29, 2024
0f41197
Many effects can now work at full resolution
tippesi Apr 27, 2024
657880a
Fix and improve a bunch of things
tippesi Apr 29, 2024
17db453
Better upsampling of reflections and SSGI
tippesi May 2, 2024
b8f0e20
Fixed some more issues
tippesi May 3, 2024
0f482ec
More fixes
tippesi May 4, 2024
752b210
More fixes
tippesi May 11, 2024
a4201b2
Fixed async ray tracing update issues
tippesi May 13, 2024
e1f8996
Fixed broken matrix decomposition for negative scales
tippesi May 16, 2024
60bba43
Fixed upsampling issue + made hot shader reload asynchronous
tippesi May 17, 2024
ad99652
Fixed volumetric cloud flickering
tippesi May 18, 2024
963a3a2
Added reactive mask generation
tippesi May 18, 2024
de41db2
Fix for wind map issue
tippesi May 20, 2024
413f8ac
Extended visualization options and bug fixes
tippesi May 22, 2024
a7dac17
Try cascaded DDGI
tippesi May 24, 2024
9cc8198
Works now + discrete steps
tippesi May 24, 2024
c452628
Many adjustments to cascaded GI
tippesi May 25, 2024
60b1284
Fixed most of the remaining cascaded DDGI issues
tippesi May 26, 2024
55c5071
Smaller adjustments
tippesi May 28, 2024
39fe47b
Better wind
tippesi May 29, 2024
8bd3b5c
Small improvements
tippesi May 30, 2024
a6e3cc1
Added scene statistics panel
tippesi May 30, 2024
4508150
Improved CPU performance
tippesi May 30, 2024
044043d
Many more fixes + UI improvements
tippesi May 31, 2024
67e3fff
Scripting adjustments
tippesi May 31, 2024
4c37cd2
Small changes to save half resolution to JSON
tippesi Jun 1, 2024
5ff7c1e
More CPU perf improvements with multithreading
tippesi Jun 2, 2024
c849f08
Make better use of bindless resources and reduce CPU bindings
tippesi Jun 2, 2024
fb52e7e
Improved GPU ray tracing performance and stability
tippesi Jun 8, 2024
cec2ab7
Some fixes/improvements for MacOS
tippesi Jun 8, 2024
3a71b8c
Some more fixes to get the headless mode to work again
tippesi Jun 9, 2024
9cb10f6
More fixes
tippesi Jun 9, 2024
08ef08d
Fix bunch of code style issues
tippesi Jun 9, 2024
153a275
More code style fixes
tippesi Jun 10, 2024
fd78374
Try something else
tippesi Jun 10, 2024
0953dea
More tries
tippesi Jun 10, 2024
c304fe6
Check some more failure cases
tippesi Jun 13, 2024
e86c73c
Better ocean
tippesi Jun 16, 2024
699f3cf
More fixes
tippesi Jun 20, 2024
a25b039
Updated JoltPhysics and added lua bindings for physics
tippesi Jun 22, 2024
35b3f79
More scripting improvements
tippesi Jun 26, 2024
bc2c7bd
Reordered lua bindings for faster compile times
tippesi Jun 27, 2024
c0d1c5d
Try to improve compilation times
tippesi Jun 27, 2024
f29aa51
Script properties can now be set properly
tippesi Jul 1, 2024
339e358
Fixed the build issues
tippesi Jul 2, 2024
00d6337
Fixed many more issues
tippesi Jul 6, 2024
1344db6
Fixed a few more DDGI issues
tippesi Jul 6, 2024
8fabdfd
Permanent playing option for audio components
tippesi Jul 7, 2024
9fb4378
Fixed a vertex buffer binding issue
tippesi Jul 10, 2024
1587138
Fixed multi-config CMake generator issue + improved MacOS CPU renderi…
tippesi Jul 20, 2024
fb9b134
Upgraded several dependencies
tippesi Jul 20, 2024
26b342e
More package changes
tippesi Jul 20, 2024
9f6d837
Build pipeline changes
tippesi Jul 20, 2024
2da6f3e
Fixed the Windows compilation issue
tippesi Jul 20, 2024
9c33192
Try again
tippesi Jul 20, 2024
87e6ccc
try again
tippesi Jul 20, 2024
8ed0b68
Trying out RTGI
tippesi Jul 28, 2024
42805fe
Important fixes to RTGI
tippesi Jul 29, 2024
a660bd0
Instance masking for raytracing and upscaling improvements
tippesi Jul 31, 2024
0667ba1
Fixed some editor issues
tippesi Aug 2, 2024
40d6f73
Improved cloud temporal accumulation
tippesi Aug 3, 2024
4d51deb
Added async content discovery
tippesi Aug 4, 2024
cb5acd1
Preparations for greater rework
tippesi Aug 6, 2024
b23cebc
Working on model importer improvements
tippesi Aug 6, 2024
e800b5b
Initial working version with new mesh import/loading/saving
tippesi Aug 7, 2024
acaee99
More changes
tippesi Aug 8, 2024
b5fd828
Some fixes
tippesi Aug 9, 2024
41d6093
Pipeline configs moved to mesh data + more stuff
tippesi Aug 10, 2024
35d62d1
More adjustments
tippesi Aug 10, 2024
40d1847
Bit of an incomplete texture and material selection
tippesi Aug 10, 2024
7fd2e80
Fixed some UI issues
tippesi Aug 11, 2024
731e152
Should fix build issues
tippesi Aug 12, 2024
bf71b4c
Added a proper job system
tippesi Aug 13, 2024
f54eeb8
Fixed compilation issue
tippesi Aug 13, 2024
0f7893c
More job system fixes
tippesi Aug 13, 2024
1f6d5ec
More fixes
tippesi Aug 13, 2024
3b75371
More improvements
tippesi Aug 14, 2024
f1f087b
Fix current build issues
tippesi Aug 14, 2024
a2e2c6c
More fixes
tippesi Aug 15, 2024
6e1d29c
Environment maps can now be used + bug fixes
tippesi Aug 15, 2024
97a9202
Possible delete of resource in editor
tippesi Aug 15, 2024
80cb4d2
Fixed a number of things
tippesi Aug 16, 2024
4db611a
Fixed even more issues
tippesi Aug 16, 2024
1b7bea8
More stuff
tippesi Aug 16, 2024
fc5c379
Atmosphere shader changes
tippesi Aug 16, 2024
dfea134
Performance improvements
tippesi Aug 17, 2024
05a2a74
Even more improvements
tippesi Aug 17, 2024
dd735bb
Fixed a few more things
tippesi Aug 17, 2024
5188ca8
Fixed more bugs
tippesi Aug 18, 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
  •  
  •  
  •  
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/install-vulkan-sdk@v1.1.1
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
Loading