Keep reservoir tube samples compact
This commit is contained in:
parent
8db331c0f7
commit
0b76a49213
3 changed files with 14 additions and 7 deletions
|
|
@ -120,6 +120,12 @@ uint VisibleSplatIndex(uint instanceId)
|
|||
return min((instanceId * splatCount) / visibleCount, splatCount - 1u);
|
||||
}
|
||||
|
||||
bool IsTransparentField(float encoding)
|
||||
{
|
||||
return abs(encoding - FIELD_ENCODING_DENSITY) < 0.5 ||
|
||||
abs(encoding - FIELD_ENCODING_EXTINCTION) < 0.5;
|
||||
}
|
||||
|
||||
FractalSplatVertexOut D3D12FractalSplatVS(uint vertexId : SV_VertexID, uint instanceId : SV_InstanceID)
|
||||
{
|
||||
float2 corners[6] =
|
||||
|
|
@ -137,6 +143,7 @@ FractalSplatVertexOut D3D12FractalSplatVS(uint vertexId : SV_VertexID, uint inst
|
|||
SdfEnvelopeReservoir sdf = sdfEnvelopeReservoirs[splatIndex];
|
||||
bool sdfResident = sdf.weightTargetCount.z > 0.5;
|
||||
float4 centerRadius = sdfResident ? sdf.centerRadius : splat.centerRadius;
|
||||
bool transparentField = IsTransparentField(splat.materialConfidence.z);
|
||||
float3 forward;
|
||||
float3 right;
|
||||
float3 up;
|
||||
|
|
@ -148,7 +155,8 @@ FractalSplatVertexOut D3D12FractalSplatVS(uint vertexId : SV_VertexID, uint inst
|
|||
float3 referenceUp = abs(surfaceNormal.z) < 0.92 ? float3(0.0, 0.0, 1.0) : float3(0.0, 1.0, 0.0);
|
||||
float3 tangentRight = normalize(cross(referenceUp, surfaceNormal));
|
||||
float3 tangentUp = normalize(cross(surfaceNormal, tangentRight));
|
||||
float boundRadius = max(centerRadius.w * fieldRadius * 1.25, 0.035 * fieldRadius);
|
||||
float minimumSampleRadius = transparentField ? 0.0015 * fieldRadius : 0.035 * fieldRadius;
|
||||
float boundRadius = max(centerRadius.w * fieldRadius * 1.25, minimumSampleRadius);
|
||||
float3 cornerWorld = center + ((tangentRight * corners[vertexId].x) + (tangentUp * corners[vertexId].y)) * boundRadius;
|
||||
float z;
|
||||
float4 projectedCorner = projectWorld(cornerWorld, cameraPosition, forward, right, up, z);
|
||||
|
|
@ -166,12 +174,6 @@ FractalSplatVertexOut D3D12FractalSplatVS(uint vertexId : SV_VertexID, uint inst
|
|||
return output;
|
||||
}
|
||||
|
||||
bool IsTransparentField(float encoding)
|
||||
{
|
||||
return abs(encoding - FIELD_ENCODING_DENSITY) < 0.5 ||
|
||||
abs(encoding - FIELD_ENCODING_EXTINCTION) < 0.5;
|
||||
}
|
||||
|
||||
SceneOut ResolveFractalSplat(FractalSplatVertexOut input, bool renderTransparent)
|
||||
{
|
||||
float r2 = dot(input.quad, input.quad);
|
||||
|
|
|
|||
|
|
@ -223,3 +223,4 @@
|
|||
{"timestamp":"2026-05-25T21:43:00+01:00","topic":"spline-tube-renderer-authority","lesson":"Direct spline lines must follow the XRLineRenderer ownership model: CPU geometry emits conservative segment envelopes with endpoint/neighbor/shape/radius data, while the shader owns visible coverage by evaluating a capsule/tube SDF with fwidth anti-aliasing. Quad-local strip UV distance is a forbidden visual authority for spline tubes.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","src/Aquarium.Engine.Contracts/GraphicsSettings.cs","src/Aquarium.Engine/AquariumHost.cs"],"source":"user renderer rebuild request"}
|
||||
{"lesson":"Fensalir restored Aquarium/Aetheria blue-noise jitter as a renderer-owned D3D12 R8 threshold tile bound to scene shaders, so stochastic spline tube SDF sampling uses a real blue-noise texture with frame offsets instead of hash-noise impostors. Spline tube emission and alpha now derive from pow(saturate(-dot(ray, normal)), exponent) with a camera-facing tube normal model.","timestamp":"2026-05-25T22:00:15+01:00","files":["src/Aquarium.Engine/Render/D3D12BlueNoiseTexture.cs","src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs","docs/stochastic-transparent-surface-pipeline.md"],"source":"user corrected blue noise ownership and spline tube normal shading","topic":"renderer-native-blue-noise"}
|
||||
{"status":"ok","timestamp":"2026-05-25T22:16:17.0210257Z","note":"Spline renderer ownership moved to shader-evaluated capsule/tube SDF over XRLineRenderer-style segment packets; CPU spline geometry now emits conservative envelope vertices with previous/current/next context and radius/material data, not visual strip authority.","type":"decision"}
|
||||
{"status":"ok","timestamp":"2026-05-26T09:29:35.4764774Z","note":"Transparent reservoir field samples no longer use the opaque fractal minimum billboard radius. Density/tube samples now keep a tiny minimum envelope so client-authored radii and reservoir budgets control visual footprint instead of inflating sparse probes into giant discs.","type":"correction"}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ invariants:
|
|||
- Spline/tube visibility is owned by shader SDF evaluation. CPU geometry may
|
||||
place conservative sampling envelopes and endpoint/neighbor packets, but
|
||||
quad-local strip UVs must not decide visible line coverage.
|
||||
- Reservoir splat rendering must not impose large minimum billboard radii on
|
||||
transparent buffer-field/tube samples. Sample envelopes should stay tied to
|
||||
authored field radius so clients can reduce reservoir sample count without
|
||||
turning sparse probes into visible plates.
|
||||
|
||||
next_actions:
|
||||
- Keep origin pointed at https://github.com/GameCult/Fensalir.git.
|
||||
|
|
|
|||
Loading…
Reference in a new issue