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

cubemap.frag 405B

123456789101112131415161718
  1. // Fragment shader for cube-texture reflection mapping
  2. // Brian Paul
  3. uniform samplerCube cubeTex;
  4. varying vec3 normal;
  5. uniform vec3 lightPos;
  6. void main()
  7. {
  8. // simple diffuse, specular lighting:
  9. vec3 lp = normalize(lightPos);
  10. float dp = dot(lp, normalize(normal));
  11. float spec = pow(dp, 5.0);
  12. // final color:
  13. gl_FragColor = dp * textureCube(cubeTex, gl_TexCoord[0].xyz, 0.0) + spec;
  14. }