Example shaders
Some checks failed
CI / Native Windows Build And Tests (push) Failing after 7s
CI / React UI Build (push) Has been cancelled
CI / Windows Release Package (push) Has been cancelled

This commit is contained in:
2026-05-03 15:44:22 +10:00
parent ee6dbf7510
commit 52bf8c90ea
12 changed files with 447 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
float4 shadeVideo(ShaderContext context)
{
float4 color = context.sourceColor;
float height = saturate(overlayHeight);
float overlayStart = 1.0 - height;
if (context.uv.y < overlayStart)
return color;
float2 scopeUv = float2(context.uv.x, (context.uv.y - overlayStart) / max(height, 0.001));
float luma = dot(sampleVideo(float2(context.uv.x, 0.5)).rgb, float3(0.2126, 0.7152, 0.0722));
float targetY = 1.0 - saturate(luma);
float pixelThickness = max(lineThickness, 0.5) / max(context.outputResolution.y * height, 1.0);
float wave = 1.0 - smoothstep(pixelThickness, pixelThickness * 2.5, abs(scopeUv.y - targetY));
float grid = 0.0;
grid = max(grid, 1.0 - smoothstep(0.002, 0.006, abs(scopeUv.y - 0.25)));
grid = max(grid, 1.0 - smoothstep(0.002, 0.006, abs(scopeUv.y - 0.50)));
grid = max(grid, 1.0 - smoothstep(0.002, 0.006, abs(scopeUv.y - 0.75)));
float3 bg = lerp(color.rgb, float3(0.0, 0.0, 0.0), saturate(backgroundOpacity));
float3 withGrid = lerp(bg, float3(0.16, 0.22, 0.28), grid * 0.5);
float3 scoped = lerp(withGrid, waveformColor.rgb, wave * saturate(waveformOpacity) * waveformColor.a);
return float4(scoped, color.a);
}