{ output : "vec2", input : { scale : [ "vec2", [ 1, 1 ], "scale" ], } } // Hard-coded while in development vec3 position = fragPositionOc; // Convert to spherical coordinates. Note in this definition // theta runs along the z axis and phi is in the xy plane. float r = length(position); float phi = atan(position.y, position.x); float theta = acos(position.z / r); // Normalize to [0-1) range vec2 uv = vec2(1.0, 1.0); uv.x = (phi + PI) / (2.0 * PI); uv.y = theta / PI; return scale * uv;