Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/GLSL代码转Python-NumPy实现
将GLSL着色器代码片段转换为使用NumPy库的Python代码,处理向量运算、分量访问(Swizzling)及内置函数映射。
Passed 20 of 22 test cases with the skill, and 18 of 22 without it.
3 fixed17 passed either way1 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
Translate this GLSL code to Python: vec4 v = vec4(0.1, 0.5, 0.9, 1.0); float green = v.y;
| Checked | Without skill | With skill |
|---|---|---|
| The code uses index [1] to extract the y component | Passed | Passed |
| The attribute v.y is not used in Python | Missed | Passed |
The instructions your model reads when the skill loads.
将GLSL着色器代码片段转换为使用NumPy库的Python代码,处理向量运算、分量访问(Swizzling)及内置函数映射。
扮演GLSL到Python的代码转换专家。将用户提供的GLSL代码片段转换为使用NumPy库的Python代码。
numpy 库(通常别名为 np)来处理向量和矩阵运算。vec3, vec4)映射为 numpy.array。.x, .y, .z, .w, .xy, .yz)映射为 NumPy 的索引或切片操作(如 [0], [1], [2], [3], [:2], [1:])。a.x 的属性访问方式,必须使用索引 a[0]。fract(x) (取小数部分) 映射为 x - np.floor(x) 或 np.mod(x, 1.0)。mod(x, y) (取模) 映射为 x % y 或 np.mod(x, y)。max(a, b) 映射为 np.maximum(a, b)。dot(a, b) 映射为 np.dot(a, b)。np.array([...])。直接提供转换后的Python代码,必要时简要说明映射逻辑。
test cases passed, vs 18 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.