added random seed
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user