added random seed
This commit is contained in:
@@ -29,7 +29,8 @@ float4 shadeVideo(ShaderContext context)
|
||||
float2 velocityPx = float2(
|
||||
max(20.0, bounceSpeed * minDimension * 1.00),
|
||||
max(24.0, bounceSpeed * minDimension * 0.77));
|
||||
float2 motionPx = context.time * velocityPx;
|
||||
float seed = context.startupRandom;
|
||||
float2 motionPx = (float2(context.time, context.time) + float2(seed * 32.7, seed * 40.3)) * velocityPx;
|
||||
float2 centerPx = minCenterPx + float2(
|
||||
pingPong(motionPx.x, travelPx.x),
|
||||
pingPong(motionPx.y, travelPx.y));
|
||||
@@ -38,7 +39,7 @@ float4 shadeVideo(ShaderContext context)
|
||||
int yHits = int(floor(motionPx.y / max(travelPx.y, 1.0)));
|
||||
int totalHits = max(0, xHits + yHits);
|
||||
|
||||
float hue = frac(0.09 + float(totalHits) * 0.173);
|
||||
float hue = frac(0.09 + seed * 0.71 + float(totalHits) * 0.173);
|
||||
float3 badgeColor = hsvToRgb(float3(hue, 0.86, 1.0));
|
||||
float3 glowColor = hsvToRgb(float3(frac(hue + 0.06), 0.72, 1.0));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user