float getWorley2D(in vec2 coord, in float size, in vec2 offset) {
    coord      /= 512;
    coord      *= size;
    coord      += offset;
    
    return texture(noisetex, coord).b;
}
float getWorley2D(in vec3 coord, in float size, in vec3 offset) {
    return getWorley2D(coord.xz, size, offset.xz);
}
float getiWorley2D(in vec2 coord) {
    coord      /= 512;
    return 1.0-texture(noisetex, coord).b;
}
float getWorley2D(in vec2 coord) {
    coord      /= 512;
    return texture(noisetex, coord).b;
}


float getNoise2D(in vec2 pos, in float size, in vec2 offset) {
    pos /= 512;
    pos *= size;
    pos += offset;

    return texture(noisetex, pos.xy).x*2.0-1.0;
}
float getNoise2D(in vec2 pos) {
    pos /= 512;

    return texture(noisetex, pos.xy).x*2.0-1.0;
}