wedge_parameter

根据 wedge_indexwedge_index_count 全局变量的值,对输入数据进行线性插值。

全局变量输入

wedge_index

此节点获取的楔形索引。

wedge_index_count

此节点获取的楔形索引数。

输入

start

插值输出 value 的起点。

end

插值输出 value 的终点。

clamp

用于将 value 限制在 startend 之间的特性。

输出

value

插值。wedge_indexwedge_index_count 全局变量在线性插值中的使用如下所示:

// Let wedge_index be the index of the wedge.
// Let wedge_index_count be the index count of the wedge.
// For wedge_index_count less than or equal to 0, then the returned value is `start`.
// If wedge_index_count is equal to 1, then `t` is wedge_index / 1.

if (wedge_index_count <= 0) {
    value = start
}
else {
    float t = wedge_index / max(1, wedge_index_count-1)
    value = start + t * (end-start)
}