摘要: In addition to basic if-then-else statements, it is possible to write for, while, and do-while loops. In OpenGL ES 2.0, very strict rules governed the usage of loops. Essentially, only loops that co... 阅读全文
posted @ 2017-09-26 15:58 今夜太冷 阅读(330) 评论(0) 推荐(0)
摘要: An example function definition is given here for a simple function that computes basic diffuse lighting: vec4 diffuse(vec3 normal, vec3 light, vec4 baseColor) { return baseColor * dot(normal, l... 阅读全文
posted @ 2017-09-26 15:37 今夜太冷 阅读(294) 评论(0) 推荐(0)
摘要: To query for the list of active uniforms in a program, you first call glGetProgramiv with the GL_ACTIVE_UNIFORMS parameter (as described in the previous section). This will tell you the number of acti... 阅读全文
posted @ 2017-09-26 10:46 今夜太冷 阅读(237) 评论(0) 推荐(0)
摘要: glValidateProgram应该只用于调试,用于release版本中会影响性能。以下是详细描述: Before doing so, however, we might want to check whether the program validates. That is, there are certain aspects of execution that a successful ... 阅读全文
posted @ 2017-09-26 10:36 今夜太冷 阅读(470) 评论(0) 推荐(0)