Issue in viewport/shading mode with Color Type Random and Object #83179

Closed
opened 2020-11-29 12:10:18 +01:00 by Maurizio Pelizzari · 6 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.14736 Core Profile Context 20.9.1 27.20.12029.1000
CPU AMD Ryzen 3700X

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862
Worked: (newest version of Blender that worked as expected)

Short description of error
In the viewport/shading, in the color tab, when I switch from Material to Object or to Random, all the viewport and the model start to glitch, until I switch back to the Material.
And the same awful glitch starts to appear when I toggle on the x-ray mode (alt+z).

Exact steps for others to reproduce the error
1 - Open the file and go in the upper right part of the screen in the shading menu
2 - Switch from Material visualization mode to the Object or Random, and then the glitch starts to appear all over the screen, and all over the model. (See the Screenshot Attached)
3 - Switch again to the Material visualization mode and the glitch disappears.
4 - Toggle on the x-ray mode (alt+z), and the glitch starts to appear. (See the screenshot attached).
5 - Press again Alt+z to turn off the x-ray and the glitch disappear.

I tested on the previous version of Blender, the 2.9 and it works fine. I have the Graphics Driver of my GPU updated.__bug.zip

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: Radeon (TM) RX 480 Graphics ATI Technologies Inc. 4.5.14736 Core Profile Context 20.9.1 27.20.12029.1000 CPU AMD Ryzen 3700X **Blender Version** Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862` Worked: (newest version of Blender that worked as expected) **Short description of error** In the viewport/shading, in the color tab, when I switch from Material to Object or to Random, all the viewport and the model start to glitch, until I switch back to the Material. And the same awful glitch starts to appear when I toggle on the x-ray mode (alt+z). **Exact steps for others to reproduce the error** 1 - Open the file and go in the upper right part of the screen in the shading menu 2 - Switch from Material visualization mode to the Object or Random, and then the glitch starts to appear all over the screen, and all over the model. (See the Screenshot Attached) 3 - Switch again to the Material visualization mode and the glitch disappears. 4 - Toggle on the x-ray mode (alt+z), and the glitch starts to appear. (See the screenshot attached). 5 - Press again Alt+z to turn off the x-ray and the glitch disappear. I tested on the previous version of Blender, the 2.9 and it works fine. I have the Graphics Driver of my GPU updated.[__bug.zip](https://archive.blender.org/developer/F9406811/__bug.zip)

Added subscriber: @indian_buffalo

Added subscriber: @indian_buffalo

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can confirm the problem in the attached file.
This reminds me of the bug described in #82240 (Issues with the viewport when activating the option "Display in front".).

The problem seems more common in version 2.91.0 but I was able to replicate it in 2.92 as well (however in this version the problem disappeared after a while).

I can confirm the problem in the attached file. This reminds me of the bug described in #82240 (Issues with the viewport when activating the option "Display in front".). The problem seems more common in version 2.91.0 but I was able to replicate it in 2.92 as well (however in this version the problem disappeared after a while).

This may already be known by the #eevee_viewport team, but I decided to take a look at the code to see what's going on.
Apparently, the GPU_framebuffer_clear_color(fbl->transp_accum_fb, clear_col_with_alpha); is not clearing the alpha channel of one of the attachments.
Maybe this is a bug in the driver caused by the fact that the attached textures have different formats (R16G16B16A16_FLOAT and R16G16_FLOAT).
Or maybe there is something in the state that is limiting this.

I got around the problem by cleaning the textures directly. But this can be bad for performance and it doesn't seem to be the ideal solution:

diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c
index 92ce5dddbc6..fa8011f11ab 100644
--- a/source/blender/draw/engines/workbench/workbench_engine.c
+++ b/source/blender/draw/engines/workbench/workbench_engine.c
@@ -542,7 +542,9 @@ void workbench_draw_sample(void *ved)
     if (xray_is_visible) {
       if (do_transparent_pass) {
         GPU_framebuffer_bind(fbl->transp_accum_fb);
-        GPU_framebuffer_clear_color(fbl->transp_accum_fb, clear_col_with_alpha);
+        GPU_texture_clear(wpd->accum_buffer_tx, GPU_DATA_FLOAT, clear_col_with_alpha);
+        GPU_texture_clear(wpd->reveal_buffer_tx, GPU_DATA_FLOAT, clear_col_with_alpha);
+        // GPU_framebuffer_clear_color(fbl->transp_accum_fb, clear_col_with_alpha);
 
         DRW_draw_pass(psl->transp_accum_ps);
 

It is quite possible that the problem is the AMD driver and will be fixed in future versions.

This may already be known by the #eevee_viewport team, but I decided to take a look at the code to see what's going on. Apparently, the `GPU_framebuffer_clear_color(fbl->transp_accum_fb, clear_col_with_alpha);` is not clearing the alpha channel of one of the attachments. Maybe this is a bug in the driver caused by the fact that the attached textures have different formats (`R16G16B16A16_FLOAT` and `R16G16_FLOAT`). Or maybe there is something in the state that is limiting this. I got around the problem by cleaning the textures directly. But this can be bad for performance and it doesn't seem to be the ideal solution: ``` diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c index 92ce5dddbc6..fa8011f11ab 100644 --- a/source/blender/draw/engines/workbench/workbench_engine.c +++ b/source/blender/draw/engines/workbench/workbench_engine.c @@ -542,7 +542,9 @@ void workbench_draw_sample(void *ved) if (xray_is_visible) { if (do_transparent_pass) { GPU_framebuffer_bind(fbl->transp_accum_fb); - GPU_framebuffer_clear_color(fbl->transp_accum_fb, clear_col_with_alpha); + GPU_texture_clear(wpd->accum_buffer_tx, GPU_DATA_FLOAT, clear_col_with_alpha); + GPU_texture_clear(wpd->reveal_buffer_tx, GPU_DATA_FLOAT, clear_col_with_alpha); + // GPU_framebuffer_clear_color(fbl->transp_accum_fb, clear_col_with_alpha); DRW_draw_pass(psl->transp_accum_ps); ``` It is quite possible that the problem is the AMD driver and will be fixed in future versions.

Closed as duplicate of #83022

Closed as duplicate of #83022
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#83179
No description provided.