Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2020-11-24 15:18:57 +0300
committerJeroen Bakker <jeroen@blender.org>2020-11-24 15:22:17 +0300
commit278011e44d433dc202b2ab8e7907e323fb23c82d (patch)
tree3e4a33ca5cbc30c032f367eff5176014fd1c42e0 /source/blender/draw/engines/overlay/overlay_grid.c
parent82cc21d5e4b62aa191726c4d9d89d5f53a2197f7 (diff)
Fix T80748: Render Emissive Colors in Compositor Backdrop
This change will use the image engine to draw the backdrop of the compositor. With this patch the alpha blending will be done in Linear Scene Reference space and shows pure emissive colors. See differential for an example image. **Technical changes** As only the backdrop drawing is done using the draw manager there are some technical changes. 1. The overlay buffer is partly drawn outside the draw manager. When drawing the backdrop image the overlay buffer needs to be masked to simulate premultiplied alpha under. 2. The backdrop of the node editor is done in region pixel space. A `DRWView` is constructed with this space. 3. UDIM textures uses world position to generate the UV coordinates. This has been implemented more strict by the `IMAGE_DRAW_FLAG_USE_WORLD_POS`. When the flag isn't used the local coordinates are used to generate the UV coordinates what is image space. 4. The draw manager now checks the actual `eSpaceType` of the space data to use different code paths. In the future the movie clip editor will be added. NOTE: The preview images in nodes are drawn in display space and cannot show pure emissive colors. As preview images are used on more locations it is best to fix this in a separate patch. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D9451
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_grid.c')
-rw-r--r--source/blender/draw/engines/overlay/overlay_grid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_grid.c b/source/blender/draw/engines/overlay/overlay_grid.c
index 5c87b68515c..988c35e387a 100644
--- a/source/blender/draw/engines/overlay/overlay_grid.c
+++ b/source/blender/draw/engines/overlay/overlay_grid.c
@@ -59,7 +59,7 @@ void OVERLAY_grid_init(OVERLAY_Data *vedata)
shd->zpos_flag = 0;
shd->grid_line_size = max_ff(0.0f, U.pixelsize - 1.0f) * 0.5f;
- if (pd->is_image_editor) {
+ if (pd->space_type == SPACE_IMAGE) {
SpaceImage *sima = (SpaceImage *)draw_ctx->space_data;
shd->grid_flag = ED_space_image_has_buffer(sima) ? 0 : PLANE_IMAGE | SHOW_GRID;
shd->grid_distance = 1.0f;
@@ -205,7 +205,7 @@ void OVERLAY_grid_cache_init(OVERLAY_Data *vedata)
GPUShader *sh;
struct GPUBatch *geom = DRW_cache_grid_get();
- if (pd->is_image_editor) {
+ if (pd->space_type == SPACE_IMAGE) {
float mat[4][4];
/* add quad background */
@@ -255,7 +255,7 @@ void OVERLAY_grid_cache_init(OVERLAY_Data *vedata)
DRW_shgroup_call(grp, geom, NULL);
}
- if (pd->is_image_editor) {
+ if (pd->space_type == SPACE_IMAGE) {
float theme_color[4];
UI_GetThemeColorShade4fv(TH_BACK, 60, theme_color);
srgb_to_linearrgb_v4(theme_color, theme_color);