Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

varfor4f.glsl 330B

12345678910111213141516171819
  1. const int KernelSize = 4;
  2. uniform vec4 KernelValue4f[KernelSize];
  3. void main(void)
  4. {
  5. int i;
  6. vec4 sum = vec4(0.0);
  7. vec4 tmp = gl_Color;
  8. gl_Position = gl_Vertex;
  9. for (i = 0; i < KernelSize; ++i) {
  10. vec4 rgba;
  11. rgba = KernelValue4f[i];
  12. sum += tmp * rgba;
  13. }
  14. gl_FrontColor = sum;
  15. }