diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-18 12:41:59 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-18 13:13:19 +0300 |
commit | 23f256b24bed34bb25d1d66ec9ba0726f7a71659 (patch) | |
tree | 7dfb39a8a493ff015ac0dae82e07cb6c9795d08f /source/blender/draw/intern/draw_common.c | |
parent | 5919919955f6ec40f881705e587355d0334c00ea (diff) |
DwM: Armature: add solid envelope bone drawing.
Envelope bones are now pretty much identical to old drawing code.
Note that currently new DwM drawing code does not seem to care about
wire/solid drawing modes at all, guess this is still TODO... For now we
hence just get both wire and solid for envelope bones, this can be
refined later.
Diffstat (limited to 'source/blender/draw/intern/draw_common.c')
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index a9b5190a523..d99b20d5ff3 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -308,6 +308,22 @@ DRWShadingGroup *shgroup_instance_bone_envelope(DRWPass *pass, struct Batch *geo return grp; } +DRWShadingGroup *shgroup_instance_bone_envelope_solid(DRWPass *pass, struct Batch *geom, float (*obmat)[4]) +{ + static float light[3] = {0.0f, 0.0f, 1.0f}; + GPUShader *sh = GPU_shader_get_builtin_shader(GPU_SHADER_3D_INSTANCE_BONE_ENVELOPE_SOLID); + + 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_attrib_float(grp, "radius_head", 1); + DRW_shgroup_attrib_float(grp, "radius_tail", 1); + DRW_shgroup_uniform_mat4(grp, "ObjectModelMatrix", (float *)obmat); + DRW_shgroup_uniform_vec3(grp, "light", light, 1); + + return grp; +} + /* ******************************************** COLOR UTILS *********************************************** */ |