1/*
2    rs_matrix4x4 model;
3    rs_matrix4x4 viewProj;
4*/
5
6varying vec3 varWorldPos;
7varying vec3 varWorldNormal;
8varying vec2 varTex0;
9
10// This is where actual shader code begins
11void main() {
12   vec4 objPos = ATTRIB_position;
13   vec4 worldPos = UNI_model * objPos;
14   gl_Position = UNI_viewProj * worldPos;
15
16   mat3 model3 = mat3(UNI_model[0].xyz, UNI_model[1].xyz, UNI_model[2].xyz);
17   vec3 worldNorm = model3 * ATTRIB_normal;
18
19   varWorldPos = worldPos.xyz;
20   varWorldNormal = worldNorm;
21   varTex0 = ATTRIB_texture0;
22}
23