diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-01-27 18:28:55 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-01-29 17:07:45 +0300 |
commit | 18c88eac171a814f94142d442494ea6f5eeeab02 (patch) | |
tree | 9a5fbc81db038a3d322b818e520d93c520e7da1e /source/blender/draw/engines/gpencil | |
parent | b683fcb62876f345a49bf66c94781a6fa789b946 (diff) |
Fix T73188: RenderResult as Camera BG Image
In blender 2.79 you could use a render result as a camera background
image. This is useful during layout/compositing. During Blender 2.80
development there were 2 issues introduced that removed this feature.
* to receive a render result the image required a lock. This lock wasn't passed and therefore no image was read from the result. Generating an GPUTexture from an Blender image also didn't do the locking.
* the iuser->scene field wasn't set what is required for render results.
This change adds an optional `ibuf` parameter to `GPU_texture_from_blender` that can be passed when available.
Reviewed By: fclem, brecht
Differential Revision: https://developer.blender.org/D6684
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 4c6ce896ebc..2c6b1315ad4 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -522,7 +522,7 @@ static DRWShadingGroup *gpencil_shgroup_fill_create(GPENCIL_e_data *e_data, BKE_image_release_ibuf(image, ibuf, NULL); } else { - GPUTexture *texture = GPU_texture_from_blender(gp_style->ima, &iuser, GL_TEXTURE_2D); + GPUTexture *texture = GPU_texture_from_blender(gp_style->ima, &iuser, ibuf, GL_TEXTURE_2D); DRW_shgroup_uniform_texture(grp, "myTexture", texture); DRW_shgroup_uniform_bool_copy( grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); @@ -705,7 +705,7 @@ DRWShadingGroup *gpencil_shgroup_stroke_create(GPENCIL_e_data *e_data, BKE_image_release_ibuf(image, ibuf, NULL); } else { - GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, GL_TEXTURE_2D); + GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, ibuf, GL_TEXTURE_2D); DRW_shgroup_uniform_texture(grp, "myTexture", texture); DRW_shgroup_uniform_bool_copy( grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); @@ -878,7 +878,7 @@ static DRWShadingGroup *gpencil_shgroup_point_create(GPENCIL_e_data *e_data, BKE_image_release_ibuf(image, ibuf, NULL); } else { - GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, GL_TEXTURE_2D); + GPUTexture *texture = GPU_texture_from_blender(gp_style->sima, &iuser, ibuf, GL_TEXTURE_2D); DRW_shgroup_uniform_texture(grp, "myTexture", texture); DRW_shgroup_uniform_bool_copy( grp, "myTexturePremultiplied", (image->alpha_mode == IMA_ALPHA_PREMUL)); |