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

@@ -18,6 +18,8 @@ float4 shadeVideo(ShaderContext context)
float resolutionAspect = max(context.outputResolution.x, 1.0) / max(context.outputResolution.y, 1.0);
float width = saturate(overlayScale);
float height = width * resolutionAspect / targetAspect;
// Keep the scope in a 16:9 frame, then shrink it if the requested scale
// would push the overlay beyond the screen bounds.
float fitScale = min(1.0 / max(width, 0.001), 1.0 / max(height, 0.001));
width *= min(fitScale, 1.0);
height *= min(fitScale, 1.0);
@@ -36,6 +38,8 @@ float4 shadeVideo(ShaderContext context)
float3 bg = lerp(color.rgb, float3(0.0, 0.0, 0.0), saturate(backgroundOpacity));
float labelHeight = min(max(pad.x * 0.95, 0.048), 0.12);
// Label textures are authored in UV space, so compensate for the overlay
// and output aspect ratios to keep the glyphs from stretching.
float labelWidth = labelHeight * height * max(context.outputResolution.y, 1.0) / max(width * max(context.outputResolution.x, 1.0), 0.001);
float labelX = max(pad.x * 0.5, labelWidth * 0.55);
float y0 = pad.y;
@@ -63,6 +67,8 @@ float4 shadeVideo(ShaderContext context)
float requestedSamples = clamp(waveformSamples, 1.0, 96.0);
float density = 0.0;
// For each output pixel, march through source rows at the same X coordinate
// and accumulate hits where sampled luma lands near this pixel's Y level.
for (int sampleIndex = 0; sampleIndex < 96; sampleIndex++)
{
float samplePosition = float(sampleIndex);