获取一致变量在着色器程序中的位置序号,通过该序号可以设置一致变量的值,如果没有该变量则返回-1
GLint glGetUniformLocation( GLuint program,
const GLchar *name);
program
Specifies the program object to be queried.
指定着色器程序的标识符
name
Points to a null terminated string containing the name of the uniform variable whose location is to be queried.
指定着色程序中一致变量名字符串

本文介绍如何使用OpenGL函数glGetUniformLocation获取着色器程序中一致变量的位置序号,以便于在运行时动态设置其值。如果指定的一致变量不存在于着色器程序中,该函数将返回-1。
356

被折叠的 条评论
为什么被折叠?



