Files
Aiden 52bf8c90ea
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
Example shaders
2026-05-03 15:44:22 +10:00

21 lines
594 B
Plaintext

float4 shadeVideo(ShaderContext context)
{
int stride = int(clamp(frameStride, 1.0, 6.0) + 0.5);
float3 echo = float3(0.0, 0.0, 0.0);
float total = 0.0;
float weight = 1.0;
for (int i = 1; i <= 6; ++i)
{
int frame = i * stride;
float3 sampleColor = sampleTemporalHistory(frame, context.uv).rgb * echoTint.rgb;
echo += sampleColor * weight;
total += weight;
weight *= saturate(decay);
}
float3 echoColor = echo / max(total, 0.0001);
float amount = saturate(echoAmount) * echoTint.a;
return float4(lerp(context.sourceColor.rgb, echoColor, amount), context.sourceColor.a);
}