Fix: don't access 4th element of float3

The issue here is that `float3` implicitely casts to `float *`
which is then passed into the `float4` constructor.
This commit is contained in:
Jacques Lucke
2023-03-31 11:40:10 +02:00
parent ca0ec55d59
commit 324ba509b5

View File

@@ -352,7 +352,7 @@ void ShadowPass::init(const SceneState &scene_state, SceneResources &resources)
float4x4 view_matrix;
DRW_view_viewmat_get(nullptr, view_matrix.ptr(), false);
resources.world_buf.shadow_direction_vs = float4(
math::transform_direction(view_matrix, direction_ws));
math::transform_direction(view_matrix, direction_ws), 0.0f);
/* Clamp to avoid overshadowing and shading errors. */
float focus = clamp_f(scene.display.shadow_focus, 0.0001f, 0.99999f);