added random seed
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 1m33s
CI / Windows Release Package (push) Successful in 2m11s

This commit is contained in:
2026-05-08 13:38:27 +10:00
parent 5eff189bbf
commit 7035cde8c8
10 changed files with 35 additions and 29 deletions

View File

@@ -7,12 +7,14 @@ float4 shadeVideo(ShaderContext context)
{
float2 blocks = max(blockCount, float2(1.0, 1.0));
float2 blockId = floor(context.uv * blocks);
float n = hash21(blockId + floor(context.time * 8.0));
float seed = context.startupRandom * 4096.0;
float frameSeed = floor(context.time * 8.0);
float n = hash21(blockId + float2(frameSeed + seed, frameSeed + seed * 0.17));
float historyFrame = floor(lerp(1.0, 7.0, n));
float rowNoise = hash21(float2(floor(context.uv.y * blocks.y), floor(context.time * 5.0)));
float rowNoise = hash21(float2(floor(context.uv.y * blocks.y) + seed * 0.37, floor(context.time * 5.0) + seed * 0.13));
float tear = (rowNoise * 2.0 - 1.0) * tearAmount * amount * 0.08;
float2 offset = float2(tear, (hash21(blockId + 19.0) * 2.0 - 1.0) * amount * 0.025);
float2 offset = float2(tear, (hash21(blockId + float2(19.0 + seed, 19.0 + seed * 0.31)) * 2.0 - 1.0) * amount * 0.025);
float2 moshedUv = clamp(context.uv + offset, 0.0, 1.0);
float4 previous = sampleTemporalHistory(int(historyFrame), moshedUv);