#include "snowflake_vert.h" const char* shader_snowflake_vert = "// Instanced snowflake vertex shader \n" "attribute vec2 position; // Base quad vertex position \n" "attribute vec2 instancePos; // Per-instance: snowflake center position \n" "attribute float instanceRot; // Per-instance: rotation angle \n" "attribute float instanceScale; // Per-instance: size scale \n" "attribute float instanceSeed; // Per-instance: random seed for variation \n" " \n" "uniform mat4 projection; \n" "uniform mat4 model; \n" " \n" "varying lowp vec2 vUV; // UV coordinates for fragment shader \n" "varying lowp float vSeed; // Pass seed to fragment shader \n" "varying lowp float vScale; // Pass scale to fragment shader \n" " \n" "void main() { \n" " // Rotate and scale the base quad \n" " float c = cos(instanceRot); \n" " float s = sin(instanceRot); \n" " mat2 rotation = mat2(c, s, -s, c); \n" " \n" " vec2 rotatedPos = rotation * (position * instanceScale); \n" " vec2 worldPos = instancePos + rotatedPos; \n" " \n" " gl_Position = projection * model * vec4(worldPos, 0.0, 1.0); \n" " \n" " // Pass UV in range [-1, 1] for procedural generation \n" " vUV = position; \n" " vSeed = instanceSeed; \n" " vScale = instanceScale; \n" "} \n" " \n";