Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added editor/Resources/splash_images/TUST0.jpg
Comment thread
ynks marked this conversation as resolved.
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 editor/Resources/splash_images/TUST1.jpg
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 editor/Resources/splash_images/TUST10.jpg
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 editor/Resources/splash_images/TUST11.jpg
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 editor/Resources/splash_images/TUST12.jpg
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 editor/Resources/splash_images/TUST13.jpg
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 editor/Resources/splash_images/TUST14.jpg
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 editor/Resources/splash_images/TUST15.jpg
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 editor/Resources/splash_images/TUST16.jpg
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 editor/Resources/splash_images/TUST17.jpg
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 editor/Resources/splash_images/TUST18.jpg
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 editor/Resources/splash_images/TUST19.jpg
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 editor/Resources/splash_images/TUST2.jpg
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 editor/Resources/splash_images/TUST3.jpg
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 editor/Resources/splash_images/TUST4.jpg
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 editor/Resources/splash_images/TUST5.jpg
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 editor/Resources/splash_images/TUST6.jpg
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 editor/Resources/splash_images/TUST7.jpg
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 editor/Resources/splash_images/TUST8.jpg
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 editor/Resources/splash_images/TUST9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions editor/Workspace/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,6 @@ private async Task ReloadGame() {
tasks.Add(LoaderTask.Run(
"cmake build",
"cmake",
// the game shares std types with the engine so both must use the same CRT
// RelWithDebInfo keeps game PDB and ttracy
#if DEBUG
"--build .toast/cmake_cache --config Debug --parallel"
Expand Down Expand Up @@ -1064,8 +1063,6 @@ private async Task ReloadGame() {
await new SimpleLoaderWindow(vm).ShowDialog(owner);
}

// The release build packs the files on disk, so unsaved edits (e.g. init_scene in the project settings) would silently be
// left out of player.exe; returns false when the user cancels
private async Task<bool> SaveBeforeBuild(Avalonia.Controls.Window owner) {
var dirtyWorkspaces = m_workspaces.Values.Where(ws => ws.IsModified).ToList();
if (dirtyWorkspaces.Count == 0 && CollectDirtyTools().Count == 0) return true;
Expand Down Expand Up @@ -1245,13 +1242,25 @@ await Task.Run(() => {
LoaderTask.Run(
"cmake configure (Release)",
"cmake",
$"lib/ -B .toast/cmake_release_cache {cmakeGenerator} -DTOAST_PATH={toastPath} -DCMAKE_BUILD_TYPE=Release"
#if DEBUG
$"lib/ -B .toast/cmake_release_cache {cmakeGenerator} -DTOAST_PATH={toastPath} -DCMAKE_BUILD_TYPE=Debug"
#elif RELWITHDEBINFO
$"lib/ -B .toast/cmake_release_cache {cmakeGenerator} -DTOAST_PATH={toastPath} -DCMAKE_BUILD_TYPE=RelWithDebInfo"
#else
$"lib/ -B .toast/cmake_release_cache {cmakeGenerator} -DTOAST_PATH={toastPath} -DCMAKE_BUILD_TYPE=Release"
#endif
),
// Build Game DLL on Release
LoaderTask.Run(
"cmake build (Release)",
"cmake",
"--build .toast/cmake_release_cache --config Release --parallel"
#if DEBUG
"--build .toast/cmake_release_cache --config Debug --parallel"
#elif RELWITHDEBINFO
"--build .toast/cmake_release_cache --config RelWithDebInfo --parallel"
#else
"--build .toast/cmake_release_cache --config Release --parallel"
#endif
),
// Copy Engine libs
LoaderTask.Do("copy libraries", CopyDlls),
Expand Down
41 changes: 21 additions & 20 deletions engine/assets/shaders/bloom.slang
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,28 @@ float4 fragmentDownsample(VSOutput input, uniform bool applyKaris) : SV_Target0
float2 texel = gParams.inverseSourceSize;
float2 uv = input.uv;

float3 a = gSource.Sample(uv + float2(-2.0, 2.0) * texel).rgb;
float3 b = gSource.Sample(uv + float2( 0.0, 2.0) * texel).rgb;
float3 c = gSource.Sample(uv + float2( 2.0, 2.0) * texel).rgb;
float3 d = gSource.Sample(uv + float2(-2.0, 0.0) * texel).rgb;
float3 e = gSource.Sample(uv).rgb;
float3 f = gSource.Sample(uv + float2( 2.0, 0.0) * texel).rgb;
float3 g = gSource.Sample(uv + float2(-2.0,-2.0) * texel).rgb;
float3 h = gSource.Sample(uv + float2( 0.0,-2.0) * texel).rgb;
float3 i = gSource.Sample(uv + float2( 2.0,-2.0) * texel).rgb;

// Interleaved so the texture queue never throttles and live registers stay low
float3 j = gSource.Sample(uv + float2(-1.0, 1.0) * texel).rgb;
float3 k = gSource.Sample(uv + float2( 1.0, 1.0) * texel).rgb;
float3 l = gSource.Sample(uv + float2(-1.0,-1.0) * texel).rgb;
float3 m = gSource.Sample(uv + float2( 1.0,-1.0) * texel).rgb;

float3 group0 = (j + k + l + m) * 0.25;

float3 e = gSource.Sample(uv).rgb;
float3 b = gSource.Sample(uv + float2( 0.0, 2.0) * texel).rgb;
float3 d = gSource.Sample(uv + float2(-2.0, 0.0) * texel).rgb;
float3 a = gSource.Sample(uv + float2(-2.0, 2.0) * texel).rgb;
float3 group1 = (a + b + d + e) * 0.25;

float3 c = gSource.Sample(uv + float2( 2.0, 2.0) * texel).rgb;
float3 f = gSource.Sample(uv + float2( 2.0, 0.0) * texel).rgb;
float3 group2 = (b + c + e + f) * 0.25;

float3 g = gSource.Sample(uv + float2(-2.0,-2.0) * texel).rgb;
float3 h = gSource.Sample(uv + float2( 0.0,-2.0) * texel).rgb;
float3 group3 = (d + e + g + h) * 0.25;

float3 i = gSource.Sample(uv + float2( 2.0,-2.0) * texel).rgb;
float3 group4 = (e + f + h + i) * 0.25;

float3 result;
Expand Down Expand Up @@ -113,20 +116,18 @@ float4 fragmentUpsample(VSOutput input) : SV_Target0
float2 offset = gParams.inverseSourceSize * gParams.filterRadius;
float2 uv = input.uv;

float3 a = gSource.Sample(uv + float2(-1.0, 1.0) * offset).rgb;
float3 e = gSource.Sample(uv).rgb;
float3 b = gSource.Sample(uv + float2( 0.0, 1.0) * offset).rgb;
float3 c = gSource.Sample(uv + float2( 1.0, 1.0) * offset).rgb;
float3 d = gSource.Sample(uv + float2(-1.0, 0.0) * offset).rgb;
float3 e = gSource.Sample(uv).rgb;
float3 f = gSource.Sample(uv + float2( 1.0, 0.0) * offset).rgb;
float3 g = gSource.Sample(uv + float2(-1.0, -1.0) * offset).rgb;
float3 h = gSource.Sample(uv + float2( 0.0, -1.0) * offset).rgb;
float3 i = gSource.Sample(uv + float2( 1.0, -1.0) * offset).rgb;
float3 result = e * 4.0 + (b + d + f + h) * 2.0;

float3 result = e * 4.0;
result += (b + d + f + h) * 2.0;
result += (a + c + g + i);
result *= 1.0 / 16.0;
float3 a = gSource.Sample(uv + float2(-1.0, 1.0) * offset).rgb;
float3 c = gSource.Sample(uv + float2( 1.0, 1.0) * offset).rgb;
float3 g = gSource.Sample(uv + float2(-1.0, -1.0) * offset).rgb;
float3 i = gSource.Sample(uv + float2( 1.0, -1.0) * offset).rgb;
result = (result + a + c + g + i) * 0.0625;

return float4(result, 1.0);
}
Expand Down
71 changes: 71 additions & 0 deletions engine/assets/shaders/fog_media.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Fog media shared by the volumetrics pass and GI rays
import lighting;

// Mirrors VulkanRenderer::FogVolumeGpu
struct FogVolume
{
float4x4 worldToLocal;
/// xyz half extents w edge fade in meters
float4 extentsFade;
/// rgb albedo a extinction per meter
float4 albedoDensity;
/// rgb radiance per meter at density 1 a noise strength
float4 emissionNoise;
/// xyz wind in meters per second w noise scale in meters
float4 windScale;
/// x anisotropy y ambient scale
float4 phase;
/// xyz box centre in world space
float4 centre;
};

[[vk::binding(22, 0)]]
StructuredBuffer<FogVolume> gFogVolumes;

uint fogVolumeCount()
{
return uint(gCamera.fogMedium.w);
}

/// Height fog extinction along origin + direction * t integrated over [near, far]
float heightFogDepth(float3 origin, float3 direction, float near, float far)
{
const float density = gCamera.fogMedium.x;
if (density <= 0.0 || far <= near)
{
return 0.0;
}
const float falloff = gCamera.fogMedium.z;
const float startHeight = origin.y + direction.y * near - gCamera.fogMedium.y;
const float atStart = density * exp(-clamp(falloff * startHeight, -20.0, 20.0));
const float slope = falloff * direction.y;
const float span = far - near;
return abs(slope) < 1e-4 ? atStart * span : atStart * (1.0 - exp(-clamp(slope * span, -20.0, 20.0))) / slope;
}

/// Volumes count as uniform boxes since noise averages out and the edge fade is thin
float fogOpticalDepth(float3 origin, float3 direction, float near, float far)
{
float depth = heightFogDepth(origin, direction, near, far);
const uint count = fogVolumeCount();
for (uint v = 0u; v < count; ++v)
{
const FogVolume volume = gFogVolumes[v];
const float3 localOrigin = mul(volume.worldToLocal, float4(origin, 1.0)).xyz;
const float3 localDirection = mul(volume.worldToLocal, float4(direction, 0.0)).xyz;
const float3 inverse = 1.0 / select(abs(localDirection) > 1e-8, localDirection, float3(1e-8, 1e-8, 1e-8));
const float3 t0 = (-volume.extentsFade.xyz - localOrigin) * inverse;
const float3 t1 = (volume.extentsFade.xyz - localOrigin) * inverse;
const float3 low = min(t0, t1);
const float3 high = max(t0, t1);
const float enter = max(max(low.x, low.y), max(low.z, near));
const float exit = min(min(high.x, high.y), min(high.z, far));
depth += max(exit - enter, 0.0) * volume.albedoDensity.a;
}
return depth;
}

float fogTransmittance(float3 origin, float3 direction, float near, float far)
{
return exp(-fogOpticalDepth(origin, direction, near, far));
}
4 changes: 4 additions & 0 deletions engine/assets/shaders/fog_media.slang.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
uid = "F0gM3d1aSh4"
type = "shader"
created_at = "2026-10-26T00:00:00.0000000Z"
modified_at = "2026-10-26T00:00:00.0000000Z"
38 changes: 38 additions & 0 deletions engine/assets/shaders/ggx_sampling.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// GGX visible normal sampling shared by SSR and traced specular

static const float kGgxPi = 3.14159265;

float ggxD(float NdotH, float alpha)
{
const float a2 = alpha * alpha;
const float d = NdotH * NdotH * (a2 - 1.0) + 1.0;
return a2 / max(kGgxPi * d * d, 1e-8);
}

float smithG1(float NdotX, float alpha)
{
const float a2 = alpha * alpha;
return 2.0 * NdotX / max(NdotX + sqrt(a2 + (1.0 - a2) * NdotX * NdotX), 1e-8);
}

/// Heitz 2018 visible normal sampling in a frame with z up
float3 sampleVisibleNormal(float3 view, float alpha, float2 u)
{
const float3 stretched = normalize(float3(alpha * view.x, alpha * view.y, view.z));
const float lengthSquared = stretched.x * stretched.x + stretched.y * stretched.y;
const float3 t1 = lengthSquared > 0.0 ? float3(-stretched.y, stretched.x, 0.0) * rsqrt(lengthSquared) : float3(1.0, 0.0, 0.0);
const float3 t2 = cross(stretched, t1);
const float r = sqrt(u.x);
const float phi = 2.0 * kGgxPi * u.y;
const float p1 = r * cos(phi);
const float s = 0.5 * (1.0 + stretched.z);
const float p2 = (1.0 - s) * sqrt(max(1.0 - p1 * p1, 0.0)) + s * r * sin(phi);
const float3 h = p1 * t1 + p2 * t2 + sqrt(max(1.0 - p1 * p1 - p2 * p2, 0.0)) * stretched;
return normalize(float3(alpha * h.x, alpha * h.y, max(h.z, 0.0)));
}

/// Of a direction sampled through sampleVisibleNormal
float visibleNormalPdf(float NdotV, float NdotH, float alpha)
{
return smithG1(NdotV, alpha) * ggxD(NdotH, alpha) / max(4.0 * NdotV, 1e-8);
}
4 changes: 4 additions & 0 deletions engine/assets/shaders/ggx_sampling.slang.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
uid = "G9xSampl1ng"
type = "shader"
created_at = "2026-10-25T00:00:00.0000000Z"
modified_at = "2026-10-25T00:00:00.0000000Z"
Loading
Loading