Annotations
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m22s
CI / Windows Release Package (push) Successful in 2m28s

This commit is contained in:
2026-05-08 20:01:22 +10:00
parent 8afef5065a
commit 163d70e9bd
11 changed files with 85 additions and 0 deletions

View File

@@ -36,6 +36,8 @@ float4 shadeVideo(ShaderContext context)
float4 accumulated = float4(0.0, 0.0, 0.0, 0.0);
float clampedSteps = clamp(raySteps, 1.0, 77.0);
// Ray-march a folded procedural field. distanceToSurface advances the ray,
// while inverse-distance accumulation creates the glowing filaments.
for (int i = 0; i < 77; ++i)
{
if (float(i) >= clampedSteps)
@@ -49,11 +51,14 @@ float4 shadeVideo(ShaderContext context)
position.xy = mul(rotateAroundZ(2.0 + originalPosition.z), position.xy);
position.xy = mul(happyAccidentMatrix(originalPosition, timeCos), position.xy);
// Color comes from pre-fold space so the palette varies smoothly even as
// the geometry folds into repeated cells.
float colorSeed = 0.5 * originalPosition.z + length(position - originalPosition);
float4 palette = 1.0 + sin(colorSeed + float4(0.0, 4.0, 3.0, 6.0));
palette /= 0.55 + 1.55 * dot(originalPosition.xy, originalPosition.xy);
position = abs(frac(position) - 0.5);
// Distance to a tiny box/cross primitive inside each repeated cell.
distanceToSurface = abs(min(length(position.xy) - 0.125, min(position.x, position.y) + 0.001)) + 0.001;
accumulated += palette.w * palette / distanceToSurface;
}