2021-07-23 00:52:31 +08:00
|
|
|
uniform mat4 u_worldViewProjection;
|
2021-07-23 23:24:09 +08:00
|
|
|
uniform sampler2D u_texture;
|
2021-07-23 00:52:31 +08:00
|
|
|
|
|
|
|
attribute vec4 position;
|
|
|
|
attribute vec3 normal;
|
|
|
|
attribute vec4 occlusion;
|
|
|
|
attribute vec2 texcoord;
|
|
|
|
|
2021-07-23 23:24:09 +08:00
|
|
|
varying float v_lighting;
|
2021-07-23 00:52:31 +08:00
|
|
|
varying vec4 v_occlusion;
|
|
|
|
varying vec2 v_texcoord;
|
|
|
|
|
|
|
|
vec3 light = vec3(0.78, 0.98, 0.59);
|
|
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
v_texcoord = texcoord;
|
|
|
|
v_occlusion = occlusion;
|
|
|
|
//float lighting = dot(light, abs(normal)) * (1.0 - occlusion * 0.2);
|
|
|
|
//float lighting = 0.2 * occlusion;
|
|
|
|
//v_colour = vec4(abs(normal), 1.0);
|
2021-07-23 23:24:09 +08:00
|
|
|
v_lighting = dot(light, abs(normal));
|
2021-07-23 00:52:31 +08:00
|
|
|
gl_Position = u_worldViewProjection * vec4(position.xyz, 1.0);
|
|
|
|
}
|