BuildingVertShader.vsh 441 B

123456789101112131415161718
  1. attribute highp vec3 inVertex;
  2. attribute highp vec3 inNormal;
  3. attribute mediump vec2 inTexCoord;
  4. uniform highp mat4 ModelViewProjMatrix;
  5. uniform highp vec3 LightDirection;
  6. varying highp float vDiffuse;
  7. varying mediump vec2 vTexCoord;
  8. void main()
  9. {
  10. vDiffuse = 0.2 + max(dot(inNormal, LightDirection), 0.0) * 0.8;
  11. vTexCoord = inTexCoord;
  12. gl_Position = ModelViewProjMatrix * vec4(inVertex, 1.0);
  13. }