Transparency Issues in 3D View #43093

Closed
opened 8 years ago by cfcohen · 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)
Poster

Changed status to: 'Open'

Changed status to: 'Open'
Poster

Added subscriber: @cfcohen

Added subscriber: @cfcohen
Collaborator

#55130 was marked as duplicate of this issue

#55130 was marked as duplicate of this issue
Collaborator

#51964 was marked as duplicate of this issue

#51964 was marked as duplicate of this issue
Collaborator

#48983 was marked as duplicate of this issue

#48983 was marked as duplicate of this issue
Moguri commented 8 years ago
Collaborator

Added subscriber: @Moguri

Added subscriber: @Moguri
Moguri commented 8 years ago
Collaborator

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

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

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 8 years ago

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'
NikoLeopold closed this issue 8 years ago
Collaborator

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.
Owner

Added subscriber: @PaoloAcampora

Added subscriber: @PaoloAcampora
mont29 commented 6 years ago
Owner

Added subscribers: @CorradoPiscitelli, @mont29, @icappiello

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

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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#43093
Loading…
There is no content yet.