mirror of
https://github.com/LucasDower/ObjToSchematic.git
synced 2024-12-21 03:09:14 +08:00
20 lines
425 B
Forth
20 lines
425 B
Forth
|
precision mediump float;
|
||
|
|
||
|
varying float v_lighting;
|
||
|
varying vec4 v_occlusion;
|
||
|
varying vec2 v_texcoord;
|
||
|
varying vec3 v_colour;
|
||
|
|
||
|
void main() {
|
||
|
float u = v_texcoord.x;
|
||
|
float v = v_texcoord.y;
|
||
|
|
||
|
float a = v_occlusion.x;
|
||
|
float b = v_occlusion.y;
|
||
|
float c = v_occlusion.z;
|
||
|
float d = v_occlusion.w;
|
||
|
float g = v*(u*b + (1.0-u)*d) + (1.0-v)*(u*a + (1.0-u)*c);
|
||
|
|
||
|
gl_FragColor = vec4(v_colour * (v_lighting * g), 1.0);
|
||
|
}
|