diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-11-26 17:32:42 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-11-26 17:55:28 +0300 |
commit | 630cb1bb1de1e67bef5ed2a202341b334188b62d (patch) | |
tree | ca0a90aa33830a2828b34c3934e5422135c8f84c /source/blender/editors/space_clip | |
parent | a01ba66cf6972f80f835eee4fcbdcba49e4d111e (diff) |
Clip Editor: Fix visualization of plane track image
Pair programming with Clement.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 80b58954c8f..63bf47412e8 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -1243,27 +1243,28 @@ static void draw_plane_marker_image(Scene *scene, GPU_matrix_mul(gl_matrix); GPUVertFormat *imm_format = immVertexFormat(); - uint pos = GPU_vertformat_attr_add(imm_format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); + uint pos = GPU_vertformat_attr_add(imm_format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); uint texCoord = GPU_vertformat_attr_add( imm_format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); - immUniformColor4f(1.0f, 1.0f, 1.0f, plane_track->image_opacity); + immBindBuiltinProgram(GPU_SHADER_3D_IMAGE_MODULATE_ALPHA); + + immUniform1f("alpha", plane_track->image_opacity); immUniform1i("image", 0); immBegin(GPU_PRIM_TRI_FAN, 4); immAttr2f(texCoord, 0.0f, 0.0f); - immVertex2f(pos, 0.0f, 0.0f); + immVertex3f(pos, 0.0f, 0.0f, 0.0f); immAttr2f(texCoord, 1.0f, 0.0f); - immVertex2f(pos, 1.0f, 0.0f); + immVertex3f(pos, 1.0f, 0.0f, 0.0f); immAttr2f(texCoord, 1.0f, 1.0f); - immVertex2f(pos, 1.0f, 1.0f); + immVertex3f(pos, 1.0f, 1.0f, 0.0f); immAttr2f(texCoord, 0.0f, 1.0f); - immVertex2f(pos, 0.0f, 1.0f); + immVertex3f(pos, 0.0f, 1.0f, 0.0f); immEnd(); |