[Bf-blender-cvs] [2acb5d1e389] blender2.8: Fix armature drawing ignoring object matrix
Campbell Barton
noreply at git.blender.org
Sat Apr 22 19:59:53 CEST 2017
Commit: 2acb5d1e389784403fec192787f31a35aac22a1b
Author: Campbell Barton
Date: Sun Apr 23 04:01:54 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB2acb5d1e389784403fec192787f31a35aac22a1b
Fix armature drawing ignoring object matrix
Looks like name-space collision.
===================================================================
M source/blender/draw/intern/draw_common.c
M source/blender/gpu/shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl
===================================================================
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c
index 7d4fbf9b7fd..58e6c6c68fb 100644
--- a/source/blender/draw/intern/draw_common.c
+++ b/source/blender/draw/intern/draw_common.c
@@ -180,7 +180,7 @@ DRWShadingGroup *shgroup_instance_objspace_solid(DRWPass *pass, struct Batch *ge
DRWShadingGroup *grp = DRW_shgroup_instance_create(sh, pass, geom);
DRW_shgroup_attrib_float(grp, "InstanceModelMatrix", 16);
DRW_shgroup_attrib_float(grp, "color", 4);
- DRW_shgroup_uniform_mat4(grp, "ModelMatrix", (float *)obmat);
+ DRW_shgroup_uniform_mat4(grp, "ObjectModelMatrix", (float *)obmat);
DRW_shgroup_uniform_vec3(grp, "light", light, 1);
return grp;
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl
index ce82dc6af2a..195d4849d99 100644
--- a/source/blender/gpu/shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_instance_objectspace_variying_color_vert.glsl
@@ -1,7 +1,7 @@
uniform mat4 ViewMatrix;
uniform mat4 ViewProjectionMatrix;
-uniform mat4 ModelMatrix;
+uniform mat4 ObjectModelMatrix;
/* ---- Instanciated Attribs ---- */
in vec3 pos;
@@ -16,7 +16,7 @@ flat out vec4 finalColor;
void main()
{
- mat4 FinalModelMatrix = ModelMatrix * InstanceModelMatrix;
+ mat4 FinalModelMatrix = ObjectModelMatrix * InstanceModelMatrix;
mat4 ModelViewProjectionMatrix = ViewProjectionMatrix * FinalModelMatrix;
/* This is slow and run per vertex, but it's still faster than
* doing it per instance on CPU and sending it on via instance attrib */
More information about the Bf-blender-cvs
mailing list