Page MenuHome

Transparency Issues in 3D View
Closed, InvalidPublic

Description

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.

Event Timeline

Cory Cohen (cfcohen) raised the priority of this task from to 90.
Cory Cohen (cfcohen) updated the task description. (Show Details)
Cory Cohen (cfcohen) edited a custom field.

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

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

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!

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.

Niko Leopold (mangostaniko) lowered the priority of this task from 90 to Normal.Feb 4 2015, 3:53 AM

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

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.

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 @Antonis Ryakiotakis (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: T43585.

Niko Leopold (mangostaniko) changed the task status from Unknown Status to Invalid.Feb 8 2015, 12:22 AM

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.