Transparency Issues in 3D View #43093

Closed
opened 2015-01-01 19:02:28 +01:00 by Cory Cohen · 18 comments

System Information
14.04.1 LTS, Trusty Tahr
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 5700 Series
OpenGL version string: 4.3.12798 Compatibility Profile Context 14.10.1006.1001

Blender Version
Broken: Blender 2.73 (sub 1) build commit date: 2014-12-31 23:50 c24b694
Possibly also Blender 2.72, but not Blender 2.69?

Short description of error

Tranparency rendering problems in the 3D viewport. I was running a custom built 2.72 from several weeks ago, and I was having trouble with transparency that wasn't a problem in the stock Ubuntu 2.69 package. When I saw that there was a recent commit related to this, I downloaded and built 2.73 to see if it fixed the issue. It did not.

I've attached a file which hopefully demonstrates the problem. It's simply a solid cube inside another cube, with the inner cube having an opaque materials and outer cube material set for alpha blend transparency (green glass). Sometimes it renders as expected, and sometimes it does not. The incorrect result is that the inner object does not show through the transparent glass outer object, even when the background does. If you remove one face of the outer cube, the effect is more obvious, with part of inner cube being rendered, and part of it not (as if the outer cube were opaque even though it isn't. The problem is intermittent, and too random for me to be able to recreate reliably, so interpret the remaining statements as impressions.

Things that I have observed causing problems (or sometimes fixing problems):

  Changing render engines.
  Changing shading modes in the 3D viewport.
  Selecting and deselecting objects in the outliner or 3D viewport.
  Switching from GLSL to multitexture and back.

Sometimes the problem persists in the Blender Render engine, when switching from the Blender Game engine, but it usually goes away (and stays away for a while).

My apologies if I'm doing something wrong. I'm still trying to learn how to use blender, and this is all very confusing to me. I've reported it as a bug because of it's randomness and the changes in behavior across multiple recent versions of blender.

bug.blend

**System Information** 14.04.1 LTS, Trusty Tahr OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: AMD Radeon HD 5700 Series OpenGL version string: 4.3.12798 Compatibility Profile Context 14.10.1006.1001 **Blender Version** Broken: Blender 2.73 (sub 1) build commit date: 2014-12-31 23:50 c24b694 Possibly also Blender 2.72, but not Blender 2.69? **Short description of error** Tranparency rendering problems in the 3D viewport. I was running a custom built 2.72 from several weeks ago, and I was having trouble with transparency that wasn't a problem in the stock Ubuntu 2.69 package. When I saw that there was a recent commit related to this, I downloaded and built 2.73 to see if it fixed the issue. It did not. I've attached a file which hopefully demonstrates the problem. It's simply a solid cube inside another cube, with the inner cube having an opaque materials and outer cube material set for alpha blend transparency (green glass). Sometimes it renders as expected, and sometimes it does not. The incorrect result is that the inner object does not show through the transparent glass outer object, even when the background does. If you remove one face of the outer cube, the effect is more obvious, with part of inner cube being rendered, and part of it not (as if the outer cube were opaque even though it isn't. The problem is intermittent, and too random for me to be able to recreate reliably, so interpret the remaining statements as impressions. Things that I have observed causing problems (or sometimes fixing problems): ``` Changing render engines. Changing shading modes in the 3D viewport. Selecting and deselecting objects in the outliner or 3D viewport. Switching from GLSL to multitexture and back. ``` Sometimes the problem persists in the Blender Render engine, when switching from the Blender Game engine, but it usually goes away (and stays away for a while). My apologies if I'm doing something wrong. I'm still trying to learn how to use blender, and this is all very confusing to me. I've reported it as a bug because of it's randomness and the changes in behavior across multiple recent versions of blender. [bug.blend](https://archive.blender.org/developer/F134587/bug.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @cfcohen

Added subscriber: @cfcohen

#55130 was marked as duplicate of this issue

#55130 was marked as duplicate of this issue

#51964 was marked as duplicate of this issue

#51964 was marked as duplicate of this issue

#48983 was marked as duplicate of this issue

#48983 was marked as duplicate of this issue

Added subscriber: @Moguri

Added subscriber: @Moguri

This sounds like bug with Blender's viewport and not the BGE.

This sounds like bug with Blender's viewport and not the BGE.
Member

Added subscriber: @MikeErwin

Added subscriber: @MikeErwin

Added subscriber: @NikoLeopold

Added subscriber: @NikoLeopold

Can confirm this on Ubuntu 14.04.1 LTS, Blender 2.73.5. this might be related to #42356?

missing transparency is evident in GLSL and Multitexture shading modes in the viewport (in final render Blender Internal and BGE works fine).
occurence depends on what objects are selected and the view direction (especially visible with two transparent objects overlayed). at times there seems to be a pattern, but it turned out to be just coincidence, its really quite random. very interesting!

Can confirm this on Ubuntu 14.04.1 LTS, Blender 2.73.5. this might be related to #42356? missing transparency is evident in GLSL and Multitexture shading modes in the viewport (in final render Blender Internal and BGE works fine). occurence depends on what objects are selected and the view direction (especially visible with two transparent objects overlayed). at times there seems to be a pattern, but it turned out to be just coincidence, its really quite random. very interesting!
NikoLeopold self-assigned this 2015-02-04 03:47:20 +01:00

seems to be equally broken for older versions, can confirm for 2.68 and 2.69 on Ubuntu 14.04.1. not sure however if maybe it is due to changes in some libraries?
also had a chance to try in 2.73 on Mac OS 10.10.2 and can confirm as well.

will try to investigate what the viewport issue might be.

seems to be equally broken for older versions, can confirm for 2.68 and 2.69 on Ubuntu 14.04.1. not sure however if maybe it is due to changes in some libraries? also had a chance to try in 2.73 on Mac OS 10.10.2 and can confirm as well. will try to investigate what the viewport issue might be.

Added subscribers: @Psy-Fi, @brecht

Added subscribers: @Psy-Fi, @brecht

looking through older reports, i found #31158, #22596, #39357, which indicate that the viewport doesnt support alpha sorting, due to OpenGL limitations (more info here: https://www.opengl.org/wiki/Transparency_Sorting)

In #31158#128338, @brecht wrote:
Basically drawing transparent surfaces is not natively support with OpenGL, and we don't do any advanced alpha sorting in the viewport like in game engines (where transparent surfaces are usually avoided). There are however two things that affect drawing order:

  • If Transparent is enabled in the Object properties Display panel, the object will be draw after others to ensure it draws on top.
  • If the Object is selected, it will be draw last, to ensure it is at least visible for editing even if it would be otherwise obscured incorrectly.

Before 2.61 having a GLSL material with alpha would automatically enabled "Transparent" on the object, however this was causing issues in some cases, now instead it needs to be set manually.

this seems to be a known limitation, thus it is not considered a bug.

In #39357#215986, @Sergey wrote:
This seems to be caused by the fact that blender does not sort objects by the depth value, which might lead to the wrong blending.

Probably could be solved, but for now considered a known limitation

afaik @Psy-Fi is currently onto a partial rework of the viewport (http://code.blender.org/index.php/2014/09/viewport-project-targets-current-state-of-the-code/), so maybe this will also be possible in the future. closing for now, since not considered a bug.

for now the workaround is to enable manually the options 'Transparency' or 'X-Ray' from the Object Panel in the Display section. Note that enabling both and having a transparent material leads to a drawing issue: #43585.

looking through older reports, i found #31158, #22596, #39357, which indicate that the viewport doesnt support alpha sorting, due to OpenGL limitations (more info here: https://www.opengl.org/wiki/Transparency_Sorting) > In #31158#128338, @brecht wrote: >Basically drawing transparent surfaces is not natively support with OpenGL, and we don't do any advanced alpha sorting in the viewport like in game engines (where transparent surfaces are usually avoided). There are however two things that affect drawing order: > >* If Transparent is enabled in the Object properties Display panel, the object will be draw after others to ensure it draws on top. >* If the Object is selected, it will be draw last, to ensure it is at least visible for editing even if it would be otherwise obscured incorrectly. > >Before 2.61 having a GLSL material with alpha would automatically enabled "Transparent" on the object, however this was causing issues in some cases, now instead it needs to be set manually. this seems to be a known limitation, thus it is not considered a bug. > In #39357#215986, @Sergey wrote: > This seems to be caused by the fact that blender does not sort objects by the depth value, which might lead to the wrong blending. > > Probably could be solved, but for now considered a known limitation afaik @Psy-Fi is currently onto a partial rework of the viewport (http://code.blender.org/index.php/2014/09/viewport-project-targets-current-state-of-the-code/), so maybe this will also be possible in the future. closing for now, since not considered a bug. for now the workaround is to enable manually the options 'Transparency' or 'X-Ray' from the Object Panel in the Display section. Note that enabling both and having a transparent material leads to a drawing issue: #43585.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

Just leaving a note that even though this bug report is closed, fixing the underlying issue IS a target for a future release.

Part of the larger viewport project is batch drawing by sorted material which allows us to draw opaque surfaces in any order but keep transparent parts for later. I've been looking at ways to draw translucent surfaces more consistently. Not aiming for perfection, but better than now.

Just leaving a note that even though this bug report is closed, fixing the underlying issue *IS* a target for a future release. Part of the larger viewport project is batch drawing by sorted material which allows us to draw opaque surfaces in any order but keep transparent parts for later. I've been looking at ways to draw translucent surfaces more consistently. Not aiming for perfection, but better than now.

Added subscriber: @PaoloAcampora

Added subscriber: @PaoloAcampora

Added subscribers: @CorradoPiscitelli, @mont29, @icappiello

Added subscribers: @CorradoPiscitelli, @mont29, @icappiello
Member

Added subscribers: @sok0, @lichtwerk

Added subscribers: @sok0, @lichtwerk
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
8 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#43093
No description provided.