Cut 8: Forward+ Vulkan cutover, atmospheric scattering sky, volumetric fog, SSR, 4-split shadows, & linear HDR

This commit is contained in:
Meta Vens 2026-12-05 17:34:33 +01:00
commit 35626ccd02
21 changed files with 1232 additions and 227 deletions

View file

@ -3,11 +3,12 @@ using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Godot;
using RustToDust.Core;
namespace RustToDust.Client.Tests;
/// <summary>
/// Live OpenGL 3.3 (gl_compatibility) visual verification probe for:
/// Live Forward+ (Vulkan) visual verification probe for:
/// - Baked COLOR_0 vertex weathering (AO, edge curvature, per-island hash, rest height)
/// - Brokkr 6-layer MechPaint spatial shader (mech_paint.gdshader) + INSTANCE_CUSTOM scorch/heat
/// - 4x4 POM MultiMesh decal atlas + decal_pom.gdshader in 1 draw call
@ -207,7 +208,7 @@ public partial class VisualProbe : Node3D
cam.GlobalPosition = new Vector3(2.8f, 4.3f, 13.4f);
cam.LookAt(new Vector3(0.0f, 4.4f, 0.2f), Vector3.Up);
// Wait several rendered frames so OpenGL 3.3 compiles all shaders and finishes drawing
// Wait several rendered frames so Vulkan Forward+ compiles all shaders and finishes drawing
for (int f = 0; f < 6; f++)
{
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
@ -249,43 +250,11 @@ public partial class VisualProbe : Node3D
private void SetupEnvironment()
{
var sun = new DirectionalLight3D
{
Name = "DesertSun",
LightColor = new Color(1.0f, 0.93f, 0.82f),
LightEnergy = 1.85f,
ShadowEnabled = true,
DirectionalShadowMode = DirectionalLight3D.ShadowMode.Parallel2Splits,
RotationDegrees = new Vector3(-38f, 36f, 0f)
};
AddChild(sun);
// Cool oblique fill light so POM recesses & metal rims catch clear specular highlights
var fill = new DirectionalLight3D
{
Name = "SkyFill",
LightColor = new Color(0.68f, 0.80f, 0.98f),
LightEnergy = 0.55f,
ShadowEnabled = false,
RotationDegrees = new Vector3(-25f, -125f, 0f)
};
AddChild(fill);
var skyMat = new ProceduralSkyMaterial
{
SkyTopColor = new Color(0.24f, 0.34f, 0.44f),
SkyHorizonColor = new Color(0.76f, 0.56f, 0.37f),
GroundBottomColor = new Color(0.28f, 0.20f, 0.14f),
GroundHorizonColor = new Color(0.68f, 0.48f, 0.32f)
};
var env = new Godot.Environment
{
BackgroundMode = Godot.Environment.BGMode.Sky,
Sky = new Sky { SkyMaterial = skyMat },
AmbientLightSource = Godot.Environment.AmbientSource.Sky,
AmbientLightEnergy = 0.65f
};
AddChild(new WorldEnvironment { Name = "WorldEnv", Environment = env });
GetViewport().UseTaa = true;
var atmosphere = new AtmosphereSystem { Name = "AtmosphereSystem" };
AddChild(atmosphere);
atmosphere.ApplyMap(ArenaMapKind.Desert);
atmosphere.Sun.RotationDegrees = new Vector3(-38f, 36f, 0f);
}
private void VerifyBakedVertexColors(string name, ArrayMesh mesh)