mirror of
https://github.com/LucasDower/ObjToSchematic.git
synced 2024-12-15 02:59:55 +08:00
28 lines
615 B
GLSL
28 lines
615 B
GLSL
precision mediump float;
|
|
|
|
uniform mat4 u_worldViewProjection;
|
|
uniform float u_voxelSize;
|
|
uniform vec3 u_gridOffset;
|
|
|
|
attribute vec3 position;
|
|
attribute vec3 normal;
|
|
attribute vec4 colour;
|
|
attribute vec4 occlusion;
|
|
attribute vec2 texcoord;
|
|
|
|
varying float v_lighting;
|
|
varying vec4 v_occlusion;
|
|
varying vec2 v_texcoord;
|
|
varying vec4 v_colour;
|
|
|
|
vec3 light = vec3(0.78, 0.98, 0.59);
|
|
|
|
void main() {
|
|
v_lighting = dot(light, abs(normal));
|
|
v_occlusion = occlusion;
|
|
v_texcoord = texcoord;
|
|
v_colour = colour;
|
|
|
|
gl_Position = u_worldViewProjection * vec4((position.xyz + u_gridOffset) * u_voxelSize, 1.0);
|
|
}
|