All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.phraseValueNoise21_shader.kt Maven / Gradle / Ivy

The newest version!
package org.openrndr.shaderphrases.phrases
const val phraseValueNoise21 = """#pragma import phraseHash21

float valueNoise21(vec2 x) {
    vec2 i = floor(x);
    vec2 f = fract(x);

    float a = hash21(i);
    float b = hash21(i + vec2(1.0, 0.0));
    float c = hash21(i + vec2(0.0, 1.0));
    float d = hash21(i + vec2(1.0, 1.0));

    vec2 u = f * f * (3.0 - 2.0 * f);
    return mix(a, b, u.x) + (c - a) * u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
}"""




© 2015 - 2025 Weber Informatics LLC | Privacy Policy