[Bf-blender-cvs] [21102395472] master: Fix T87150: bad points appearance in orthographic view

Philipp Oeser noreply at git.blender.org
Fri Apr 9 09:18:12 CEST 2021


Commit: 21102395472ddb77572944cff337f6deb68fcc7e
Author: Philipp Oeser
Date:   Thu Apr 8 17:19:45 2021 +0200
Branches: master
https://developer.blender.org/rB21102395472ddb77572944cff337f6deb68fcc7e

Fix T87150: bad points appearance in orthographic view

Points are drawn as half octahedron (aligned to the camera).
Getting the appropriate matrix for facing the camera would fail in in
orthographic view, points were not facing the camera (revealing their
missing other half octahedron)

Maniphest Tasks: T87150

Differential Revision: https://developer.blender.org/D10923

===================================================================

M	source/blender/draw/intern/shaders/common_pointcloud_lib.glsl

===================================================================

diff --git a/source/blender/draw/intern/shaders/common_pointcloud_lib.glsl b/source/blender/draw/intern/shaders/common_pointcloud_lib.glsl
index f007a8c2322..74b989441a2 100644
--- a/source/blender/draw/intern/shaders/common_pointcloud_lib.glsl
+++ b/source/blender/draw/intern/shaders/common_pointcloud_lib.glsl
@@ -12,7 +12,7 @@ in vec3 nor;
 mat3 pointcloud_get_facing_matrix(vec3 p)
 {
   mat3 facing_mat;
-  facing_mat[2] = normalize(ViewMatrixInverse[3].xyz - p);
+  facing_mat[2] = cameraVec(p);
   facing_mat[1] = normalize(cross(ViewMatrixInverse[0].xyz, facing_mat[2]));
   facing_mat[0] = cross(facing_mat[1], facing_mat[2]);
   return facing_mat;



More information about the Bf-blender-cvs mailing list