diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-14 14:57:41 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-14 14:57:41 +0300 |
commit | 8950aa26151338418fd1576f378042c924c649c1 (patch) | |
tree | e0523dac46fad2c6acdf0607edb66b8ad0a5c95c /source/blender/draw | |
parent | bf45a46f814092cf8b03909ad2d30f4a17b62f10 (diff) |
Fix T64574 : Weird shadow mesh glitches in viewport
This is not the most clean but this is what is needed to make
point_object_to_ndc equivalent to
point_object_to_world + point_world_to_ndc
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/modes/shaders/common_view_lib.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/modes/shaders/common_view_lib.glsl b/source/blender/draw/modes/shaders/common_view_lib.glsl index 99410b41ce6..ce48138a80d 100644 --- a/source/blender/draw/modes/shaders/common_view_lib.glsl +++ b/source/blender/draw/modes/shaders/common_view_lib.glsl @@ -39,8 +39,8 @@ uniform mat4 ModelMatrixInverse; #define normal_world_to_object(n) (transpose(mat3(ModelMatrix)) * n) #define normal_world_to_view(n) (mat3(ViewMatrix) * n) -#define point_object_to_ndc(p) (ViewProjectionMatrix * (ModelMatrix * vec4(p, 1.0))) -#define point_object_to_view(p) ((ViewMatrix * (ModelMatrix * vec4(p, 1.0))).xyz) +#define point_object_to_ndc(p) (ViewProjectionMatrix * vec4(ModelMatrix * vec4(p, 1.0)).xyz, 1.0)) +#define point_object_to_view(p) ((ViewMatrix * vec4(ModelMatrix * vec4(p, 1.0)).xyz, 1.0)).xyz) #define point_object_to_world(p) ((ModelMatrix * vec4(p, 1.0)).xyz) #define point_view_to_ndc(p) (ProjectionMatrix * vec4(p, 1.0)) #define point_view_to_object(p) ((ModelMatrixInverse * (ViewMatrixInverse * vec4(p, 1.0))).xyz) |