19 lines
421 B
Plaintext
19 lines
421 B
Plaintext
|
#ifdef LIGHTMAP_BAKING
|
||
|
void main() {
|
||
|
vec3 n = normalize(v_normal_ws);
|
||
|
vec4 diffuse;
|
||
|
|
||
|
if(u_textured) {
|
||
|
diffuse = texture(u_texture2d, v_texcoord);
|
||
|
} else {
|
||
|
diffuse = u_diffuse; // * v_color;
|
||
|
}
|
||
|
|
||
|
if (u_texlit) {
|
||
|
vec4 litsample = texture(u_lightmap, v_texcoord);
|
||
|
diffuse *= litsample;
|
||
|
}
|
||
|
|
||
|
fragcolor = vec4(diffuse.rgb*u_litboost, 1.0);
|
||
|
}
|
||
|
#endif
|