【发布时间】:2013-11-13 23:49:58
【问题描述】:
我已经将 HSV2RGB 颜色函数从一个工作代码完全复制到了 shadertoy 网站上的另一个代码中,它说 -
no matching overloaded function found,
cannot convert from "constant mediump float" to "3 vector component of float"
这是拒绝工作的函数:
vec3 hsv2rgb(vec3 c)//<---crashes
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
这是一个带有错误的示例 glsl 沙箱,https://www.shadertoy.com/view/MsS3Rh 它位于第 24 到 33 行。
【问题讨论】: