1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
matabstrix/examples/demo/data/shaders/normal.vert

14 lines
306 B
GLSL

attribute vec4 position;
attribute vec3 normal;
varying float light_weight;
uniform mat4 mvp;
uniform mat3 local_modelview;
void main(void) {
gl_Position = mvp * position;
vec3 transformed_normal = local_modelview * normal;
light_weight = max(dot(transformed_normal, vec3(0.0, 1.0, 0.0)), 0.0);
}