Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- precision mediump float;
- attribute vec3 position;
- attribute vec3 normal;
- attribute vec2 tex_coord;
- // Perspective * View * Model
- uniform mat4 scene_mat;
- uniform mat4 model_mat;
- // transpose(inverse(Model))
- uniform mat4 normal_mat;
- uniform int has_diffuse;
- // Interpolated vertex properties
- varying vec3 var_position; // world-space position
- varying vec3 var_normal;
- varying vec2 var_tex_coord;
- void main() {
- gl_Position = scene_mat * vec4(position, 1.0);
- var_position = (model_mat * vec4(position, 1.0)).xyz;
- var_normal = (normal_mat * vec4(normal, 1.0)).xyz;
- if (has_diffuse != 0)
- var_tex_coord = tex_coord;
- else
- var_tex_coord = vec2(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment