Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 150 core
- in vec3 vs_in_pos;
- in vec3 vs_in_normal;
- uniform mat4 tmat;
- uniform mat4 rmat;
- uniform mat4 scale;
- uniform vec3 inverseLightDir = vec3(0.0f,1.0f,0.0f);
- out float brightness;
- void main(void) {
- gl_Position = scale*tmat*rmat*vec4(vs_in_pos, 1);
- vec3 normalWC = mat3(rmat*scale)*vs_in_normal;
- vec3 normalWCn = normalize(normalWC);
- brightness = max(dot(normalWCn,inverseLightDir),0);
- }
Add Comment
Please, Sign In to add comment