diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-15 21:10:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-15 21:10:45 +0300 |
commit | 058514aa0abfbbeb87a89d863a2cdc85b5bdb5c4 (patch) | |
tree | 5eeb9adf61396e50046f53f10a77d1fbb4a397e5 /source/blender/draw/intern/shaders/common_view_lib.glsl | |
parent | d4d810f817afc61618bec6f3b0a0ade5d0111d3c (diff) |
PointCloud: Initial rendering support for Workbench
Also includes outline overlays. Removes the temp overlay drawing
We make the geometry follow camera like billboards this uses less
geometry. Currently we use half octahedron for now. Goal would be
to use icospheres.
This patch also optimize the case when pointcloud has uniform radius.
However we should premultiply the radius prop by the default radius
beforehand to avoid a multiplication on CPU.
Using geometry instead of pseudo raytraced spheres is more scalable as
we can render as low as 1 or 2 triangle to a full half sphere and can
integrate easily in the render pipeline using a low amount of code.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8301
Diffstat (limited to 'source/blender/draw/intern/shaders/common_view_lib.glsl')
-rw-r--r-- | source/blender/draw/intern/shaders/common_view_lib.glsl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/draw/intern/shaders/common_view_lib.glsl b/source/blender/draw/intern/shaders/common_view_lib.glsl index 2188c38ee63..095bc64a19e 100644 --- a/source/blender/draw/intern/shaders/common_view_lib.glsl +++ b/source/blender/draw/intern/shaders/common_view_lib.glsl @@ -175,6 +175,7 @@ uniform mat4 ModelMatrixInverse; #define normal_object_to_world(n) (transpose(mat3(ModelMatrixInverse)) * n) #define normal_world_to_object(n) (transpose(mat3(ModelMatrix)) * n) #define normal_world_to_view(n) (mat3(ViewMatrix) * n) +#define normal_view_to_world(n) (mat3(ViewMatrixInverse) * n) #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) |