Home | History | Annotate | Download | only in raw
      1 varying vec3 varWorldPos;
      2 varying vec3 varWorldNormal;
      3 varying vec2 varTex0;
      4 
      5 // This is where actual shader code begins
      6 void main() {
      7    vec4 objPos = ATTRIB_position;
      8    vec4 worldPos = UNI_model * objPos;
      9    gl_Position = UNI_proj * worldPos;
     10 
     11    mat3 model3 = mat3(UNI_model[0].xyz, UNI_model[1].xyz, UNI_model[2].xyz);
     12    vec3 worldNorm = model3 * ATTRIB_normal;
     13 
     14    varWorldPos = worldPos.xyz;
     15    varWorldNormal = worldNorm;
     16    varTex0 = ATTRIB_texture0;
     17 }
     18