Ensure light is normalised
This commit is contained in:
parent
be7b577a0e
commit
6239be219a
@ -179,7 +179,10 @@ internal M4x4f get_projection_matrix(ProjectionType projection_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal f32 get_intensity(const V3f *normal) {
|
internal f32 get_intensity(const V3f *normal) {
|
||||||
f32 intensity = dot_v3((*normal), g_light_dir);
|
V3f light = g_light_dir;
|
||||||
|
normalise_v3(light);
|
||||||
|
|
||||||
|
f32 intensity = dot_v3((*normal), light);
|
||||||
if (intensity < 0.0f) {
|
if (intensity < 0.0f) {
|
||||||
intensity = 0.001f;
|
intensity = 0.001f;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user