ObjToSchematic/shaders/shaded_fragment.fs

16 lines
364 B
Forth
Raw Normal View History

2021-07-01 23:16:32 +08:00
precision mediump float;
2021-07-27 06:42:56 +08:00
uniform sampler2D u_texture;
varying float v_lighting;
2021-07-27 06:42:56 +08:00
varying vec2 v_texcoord;
2021-07-01 23:16:32 +08:00
void main() {
2021-07-27 06:42:56 +08:00
//gl_FragColor = v_colour;
//v_texcoord.x = 1.0 - v_texcoord.x;
vec2 tex = vec2(v_texcoord.x, 1.0 - v_texcoord.y);
vec3 diffuse = texture2D(u_texture, tex).rgb;
diffuse = diffuse * v_lighting;
gl_FragColor = vec4(diffuse, 1.0);
2021-07-01 23:16:32 +08:00
}