Blur flat Grid reflections
This commit is contained in:
parent
babae9165b
commit
52c9ae76a6
3 changed files with 10 additions and 3 deletions
|
|
@ -47,6 +47,9 @@ static const float GRID_HEIGHT_TEXEL_COUNT = 128.0;
|
|||
static const int BODY_LIGHT_COUNT = 8;
|
||||
static const float STUDIO_PMREM_MAX_LOD = 8.0;
|
||||
static const float STUDIO_PMREM_SPECULAR_INTENSITY = 0.34;
|
||||
static const float GRID_FLAT_REFLECTION_MAX_LOD = 5.2;
|
||||
static const float GRID_FLAT_SLOPE_START = 0.018;
|
||||
static const float GRID_FLAT_SLOPE_END = 0.16;
|
||||
|
||||
struct VertexOut
|
||||
{
|
||||
|
|
@ -436,9 +439,12 @@ float3 studioPmremDirection(float3 worldDirection)
|
|||
|
||||
float3 gridMirrorRadiance(float3 p, float3 direction, out float3 normal)
|
||||
{
|
||||
normal = terrainNormal(p);
|
||||
float2 gradient = terrainGradient(p.xy);
|
||||
normal = normalize(float3(-gradient.x, -gradient.y, 1.0));
|
||||
float3 reflectionDirection = reflect(direction, normal);
|
||||
return studioPmremTexture.SampleLevel(gridSampler, studioPmremDirection(reflectionDirection), 0.0).rgb;
|
||||
float flatness = 1.0 - smoothstep(GRID_FLAT_SLOPE_START, GRID_FLAT_SLOPE_END, length(gradient));
|
||||
float lod = flatness * GRID_FLAT_REFLECTION_MAX_LOD;
|
||||
return studioPmremTexture.SampleLevel(gridSampler, studioPmremDirection(reflectionDirection), lod).rgb;
|
||||
}
|
||||
|
||||
RayMarchResult traverseRay(float2 uv, float2 screenUv, float3 origin, float3 direction)
|
||||
|
|
|
|||
|
|
@ -10,3 +10,4 @@
|
|||
{"timestamp":"2026-05-11T06:50:00+01:00","topic":"pmrem-world-basis","lesson":"Aquarium world space is Z-up while the baked Studio3 PMREM cubemap is sampled as Y-up. Every PMREM lookup must convert world directions with (x, z, y) before TextureCube sampling, or the HDRI appears sideways.","files":["src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","state/memory.json"]}
|
||||
{"timestamp":"2026-05-11T07:00:00+01:00","topic":"studio2-pmrem-probe","lesson":"Active reflection probe switched to Studio2 from E:\\Projects\\Aetheria-Economy\\Assets\\Textures\\studio2.hdr. The renderer loads Assets/Textures/studio2_pmrem.dds through the existing D3D12 TextureCube PMREM path, and the unused Studio3 DDS was cut from live assets.","files":["src/Aquarium.Engine/Assets/Textures/studio2_pmrem.dds","src/Aquarium.Engine/Assets/Textures/studio3_pmrem.dds","src/Aquarium.Engine/Render/D3D12Renderer.cs","state/map.yaml","state/memory.json"],"source":"E:\\Projects\\Aetheria-Economy\\Assets\\Textures\\studio2.hdr"}
|
||||
{"timestamp":"2026-05-11T07:14:00+01:00","topic":"grid-brush-cpu-mirror","lesson":"Self's Grid gravity bowl now uses a 17-world-unit radius and an Aetheria-style radial cosine wave. The brush equation is mirrored across D3D12Grid, CPU body-light placement, D3D12Scene body centers, and D3D12Post temporal reprojection; body centers sit at Grid height plus 2x radius.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Grid.hlsl","src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","state/map.yaml","state/memory.json"],"source":"E:\\Projects\\Aetheria-Economy\\Assets\\Shaders\\Brushes\\RadialWaveBrush.shader"}
|
||||
{"timestamp":"2026-05-11T07:22:00+01:00","topic":"grid-flatness-roughness","lesson":"Grid reflection roughness is now slope-driven: flat regions sample higher Studio2 PMREM mips to avoid an over-literal HDRI mirror, while sloped or waved regions sharpen toward mip 0.","files":["src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","state/memory.json"]}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
],
|
||||
"rendering": [
|
||||
"Grid height is defined by the shared brush equation in CPU placement, D3D12Grid, D3D12Scene, and temporal reprojection. Self uses a 17-world-unit gravity bowl plus an Aetheria-style radial cosine wave; body centers sit at Grid height plus 2x body radius.",
|
||||
"The Grid is direct-traced as a terminating mirror surface over the scalar height field. It writes the primary surface packet with FIELD_ID_GRID, terrain normal, full coverage, and Studio2 PMREM mip 0 reflection.",
|
||||
"The Grid is direct-traced as a terminating reflective surface over the scalar height field. It writes the primary surface packet with FIELD_ID_GRID, terrain normal, full coverage, and Studio2 PMREM reflection; flat regions sample rougher PMREM mips while sloped/waved regions sharpen toward mip 0.",
|
||||
"Mouse/cursor-owned SDF bodies need object-motion reprojection. Carry current and previous cursor world anchors through frame constants and reproject cursor hits from current center to previous center.",
|
||||
"The cursor locator uses the MathWorld teardrop curve profile with m=6, revolved around vertical: x=cos(t), y=sin(t)*sin^m(t/2), radius `sqrt(1 - x^2) * ((1 - x) / 2)^3`. Ripples belong in the SDF radius function. Material is brass GGX metal with brass-tinted F0, no diffuse metal term, non-emissive, and no ambient floor.",
|
||||
"Heavy/specialized SDF evaluators should not live inside generic packed-id helpers when those helpers are called repeatedly; avoid shader compiler path cloning.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue