考虑以下GLSL函数:
float Pow3 (const in float f) {
return f * f * f;
}
float Pow4 (const in float f) {
return f * f * f * f;
}
float Pow5 (const in float f) {
return f * f * f * f * f;
}
......等等。 有没有一种方法可以#define一个GLSL宏,该宏可以在编译时生成n个f自乘的结果,而不使用内置的GLSL pow()函数呢?
pow()
函数? - dbr