implement lighmap shading
This commit is contained in:
parent
cf0239c76e
commit
64396b28b9
6 changed files with 20 additions and 10 deletions
|
@ -76,7 +76,7 @@ void main() {
|
|||
vec3 norm = normalize(normal);
|
||||
vec3 dir = normalize(cam_pos - vertex);
|
||||
vec4 texel = texture(tex, tex_coord) * brightness;
|
||||
vec3 light_v = texture(lightmap, vec2(0.03125 + lm_coord.x * 256, 0.03125 + lm_coord.y * 256)).rgb;
|
||||
texel *= texture(lightmap, 0.03125 + lm_coord * 256.0);
|
||||
vec3 rgb = texel.rgb;
|
||||
vec3 result = calc_dir_light(norm, dir, rgb);
|
||||
// int l = 0;
|
||||
|
@ -87,5 +87,5 @@ void main() {
|
|||
// l++;
|
||||
// }
|
||||
}
|
||||
FragColor = texel * vec4(light_v, 1.0); // vec4(result, texel.a);
|
||||
FragColor = texel; // vec4(result, texel.a);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue