#version 430

in vec3 varPosition;

out float noise;

void main(void) {
    // Base: Distance to a helix
    vec3 helix_pos = vec3(sin(varPosition.y * 5.0) * 0.2 + 0.5, varPosition.y, cos(varPosition.y * 5.0) * 0.2 + 0.5);
    float dist = distance(helix_pos, varPosition);
    
    noise = 0.6 - dist;

    // Create some blobby shapes on the helix
    float f1 = sin((varPosition.x + varPosition.z) * 7.0);
    float f2 = cos((varPosition.y + varPosition.x) * 3.0);
    float f3 = cos((varPosition.z + varPosition.y) * 8.0);

    noise += abs(f1 + f2 + f3) * 0.1;
}
