diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-02-01 12:49:28 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-02-01 12:49:28 +0300 |
commit | 396413dedf079478418771da159bb2c97bb0e4e9 (patch) | |
tree | 1aea7990a446f62c3ed07d32bb9fb31c474989a2 /source/blender/draw/engines/image/shaders | |
parent | 146618fb221ebe1f008a0dd1ed05a0fc5ba935da (diff) |
Partial Fix: Showing Compositor Backdrop in node editor.
Since splitting the depth and the color shader in the image engine the
backdrop wasn't visible anymore. The reson is that the min max uv
coordinates were never working for the node editor backdrop that uses
its own coordinate space.
This partial fix will ignore the depth test when drawing the color part
of the backdrop. This will still have artifacts that are visible when
showing other options as RGBA.
Proper fix would be to calculate the the uv vbo in uv space and not in
image space.
Diffstat (limited to 'source/blender/draw/engines/image/shaders')
-rw-r--r-- | source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl b/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl index 0edc18836f0..65fd4833b23 100644 --- a/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl +++ b/source/blender/draw/engines/image/shaders/image_engine_color_frag.glsl @@ -5,6 +5,7 @@ #define IMAGE_DRAW_FLAG_APPLY_ALPHA (1 << 1) #define IMAGE_DRAW_FLAG_SHUFFLING (1 << 2) #define IMAGE_DRAW_FLAG_DEPTH (1 << 3) +#define IMAGE_DRAW_FLAG_DEPTH_ALWAYS (1 << 4) #define FAR_DISTANCE farNearDistances.x #define NEAR_DISTANCE farNearDistances.y @@ -12,9 +13,11 @@ void main() { ivec2 uvs_clamped = ivec2(uv_screen); - float depth = texelFetch(depth_texture, uvs_clamped, 0).r; - if (depth == 1.0) { - discard; + if ((drawFlags & IMAGE_DRAW_FLAG_DEPTH_ALWAYS) == 0) { + float depth = texelFetch(depth_texture, uvs_clamped, 0).r; + if (depth == 1.0) { + discard; + } } vec4 tex_color = texelFetch(imageTexture, uvs_clamped, 0); |