Fundamentals 17 min read

How Noise Powers Real‑Time Short‑Video Effects: Algorithms, Samples & GPU RNG Comparison

This article explains how various noise algorithms—value, gradient, simplex, cellular, and FBM—are applied to short‑video visual effects, showcases shader implementations and image examples, and compares GPU random‑number generators to help developers choose the right balance of performance and visual quality.

Kuaishou Large Model
Kuaishou Large Model
Kuaishou Large Model
How Noise Powers Real‑Time Short‑Video Effects: Algorithms, Samples & GPU RNG Comparison

Background

Noise is widely used in short‑video effects to introduce irregularity and randomness, which saves artistic resources and enriches visual variety.

Noise Effect Demonstrations

Examples include flash points on surfaces, distortion via noise‑based texture sampling, and caustics simulated with tiled noise textures. The following images illustrate each effect.

How Noise Is Generated

The article describes several procedural noise techniques:

Value Noise – uses integer‑grid random values interpolated with smoothstep.

Gradient Noise (Perlin) – interpolates random gradient vectors at grid points.

Simplex Noise – a more efficient variant of Perlin using simplex cells.

Cellular (Worley) Noise – based on distance to randomly placed feature points.

FBM (Fractal Brownian Motion) – combines multiple octaves of a base noise.

GLSL code snippets for each method are provided:

<code><span>float noise (in vec2 st) {</span>
<span>    vec2 i = floor(st);</span>
<span>    vec2 f = fract(st);</span>
<span>    // sample four corners</span>
<span>    float a = random(i);</span>
<span>    float b = random(i + vec2(1.0, 0.0));</span>
<span>    float c = random(i + vec2(0.0, 1.0));</span>
<span>    float d = random(i + vec2(1.0, 1.0));</span>
<span>    vec2 u = smoothstep(0.,1.,f);</span>
<span>    return mix(a, b, u.x) + (c - a)*u.y*(1.0 - u.x) + (d - b)*u.x*u.y;</span>
<span>}</span></code>
<code><span>float noise(vec2 st) {</span>
<span>    const float K1 = 0.366025404;</span>
<span>    const float K2 = 0.211324865;</span>
<span>    vec2 i = floor(st + (st.x+st.y)*K1);</span>
<span>    vec2 a = st - i + (i.x+i.y)*K2;</span>
<span>    // ... simplex calculation ...</span>
<span>    return dot(h, vec3(70.0));</span>
<span>}</span></code>

Random Number Algorithms Comparison

The article compares several GPU PRNGs—LCG, trig, PCG, and others—evaluating both statistical quality and computational cost. Charts show that PCG offers high quality with moderate cost, while LCG is fastest but exhibits noticeable periodicity.

<code><span>// linear congruential generator</span>
<span>uint lcg(uint p) { return p * 1664525u + 1013904223u; }</span>
<span>return uvec3(lcg(lcg(u.x) + u.y));</span></code>
<code><span>// PCG</span>
<span>uint pcg(uint v) {</span>
<span>    uint state = v * 747796405u + 2891336453u;</span>
<span>    uint word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;</span>
<span>    return (word >> 22u) ^ word;</span>
<span>}</span></code>

Conclusion

Incorporating noise nodes into editors allows designers to create diverse, realistic effects efficiently; upcoming short‑video platforms will provide adjustable noise modules to further streamline the workflow.

GPUreal-time renderingShadernoiseRandom Number Generationprocedural texture
Kuaishou Large Model
Written by

Kuaishou Large Model

Official Kuaishou Account

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.