bugGNU Octave - Bugs: bug #39535, FaceAlpha property not working for...


bug #39535: FaceAlpha property not working for OpenGL backend

Submitted by:  Rik <rik5>
Submitted on:  Fri 19 Jul 2013 11:01:35 PM UTC  
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: In ProgressAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Mon 16 Oct 2017 07:27:21 PM UTC, comment #9:

@Markus: sorry for the delay. I tested the patch and it works fine. The limitations are clearly documented and I could see no measurable impact on performance. Can you push this cset please?

I attached a patch that adds support for printing transparent patches to svg at least. The "pdflatext(standalone)" format also seams to support polygon transparency when rendered in Okular. Evince renders opaque surfaces and I did not test in acrobat.

I tested with this:

(file #42169)

Pantxo Diribarne <pantxo>
Project Member
Tue 10 Oct 2017 07:13:32 PM UTC, comment #8:

Attached is a patch that also adds the same basic support for facealpha to surface objects.

The following shows a circle that is covered by a semi-transparent peaks surface that partly clips through the circle:

Since there are no sorting primitives, the solid objects have to be drawn before the ones with transparency. You can see the limits when rotating the plot or by reversing the order in the above example.

(file #42116)

Markus Mützel <mmuetzel>
Project Member
Sun 08 Oct 2017 02:11:41 PM UTC, comment #7:

@Pantxo: Thank you for picking this up. The attached patch adds some documentation for the facealpha property of patch objects to the manual.

Scrolling through the code for draw_surface it looks like a similarly limited support for transparency should be possible for surface objects as well. I'll report back after trying.

(file #42089)

Markus Mützel <mmuetzel>
Project Member
Fri 06 Oct 2017 08:12:19 AM UTC, comment #6:

@Markus: this is much better than what we currently have so I'd like to push this patch (and another one I'll write to enable support for printing transparent patches in svg and pdflatex).
Could you document that "facealpha" works for double values.

Do you think the same kind of job can be done on surface objects?

Pantxo Diribarne <pantxo>
Project Member
Sun 12 Mar 2017 05:13:21 PM UTC, comment #5:

Attached is a patch that adds some very primitive support for alpha on faces of patch objects. It does not include any sorting primitives. However, it might give better results than the current implementation (which hides patches with alpha != 0) in very simple cases as the ones from bug #50520:

or bug #46538:

or the one in comment #0.

Since no sorting primitives are included, it fails with more complex layouts as in:

It also only adds support for double valued "FaceAlpha". "flat" or "interp" skip rendering the faces (like without the patch).

Even if this is by far no complete implementation of transparency, this very limited support might be helpful in some use cases.

(file #39977)

Markus Mützel <mmuetzel>
Project Member
Fri 18 Nov 2016 03:32:57 PM UTC, comment #4:

This bug is still present in the current dev 4.3.0 (39f39eb4e476).

Pantxo Diribarne <pantxo>
Project Member
Sat 12 Sep 2015 10:22:41 PM UTC, comment #3:

I am pinging this report as it is still valid.

facealpha < 1 doesn't render in opengl graphics toolkits (fltk, qt)

Juan Pablo Carbajal <juanpi>
Project Member
Fri 19 Jul 2013 11:58:32 PM UTC, comment #2:

Rats! I had thought it might be something simple like not passing a parameter over to OpenGL. I see that it is definitely non-trivial. I'll leave the bug report open as a placeholder.

Rik <rik5>
Project Administrator
Fri 19 Jul 2013 11:29:19 PM UTC, comment #1:

Support for transparency is globally not implemented yet in the OpenGL renderer. Although, transparency effects are possible in OpenGL, it's not trivial and requires sorting primitives from back to front [1]. I had some implementation in JHandles, but I never ported it to octave, IIRC I found is sub-optimal.

This was a suggestion for a GSoC project, but it wasn't picked up.

[1] http://www.opengl.org/archives/resources/faq/technical/transparency.htm

Michael Goffioul <goffioul>
Project Member
Fri 19 Jul 2013 11:01:35 PM UTC, original submission:

The FaceAlpha property determines the transparency of a face. The FLTK backend, however, interprets everything that is not 1 (opaque) as 0 (transparent). The property works with gnuplot.

Example code:

This seems like it should be possible since OpenGL can handle all kinds of strange colors/alpha blends.

Rik <rik5>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #42169:  printalpha2.patch added by pantxo (5KiB - text/x-patch)
file #42116:  bug39535_basic_facealpha.patch added by mmuetzel (9KiB - application/octet-stream)
file #42089:  bug39535_patch_facealpha_v2.patch added by mmuetzel (4KiB - application/octet-stream)
file #39977:  bug39535_patch_facealpha.patch added by mmuetzel (2KiB - application/octet-stream)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -unavailable- added by mmuetzel (Updated the item)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by juanpi (Posted a comment)
  • -unavailable- added by goffioul (Posted a comment)
  • -unavailable- added by rik5 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 16 Oct 2017 07:27:21 PM UTCpantxoAttached File-=>Added printalpha2.patch, #42169
    Tue 10 Oct 2017 07:13:32 PM UTCmmuetzelAttached File-=>Added bug39535_basic_facealpha.patch, #42116
      StatusPatch Reviewed=>In Progress
    Sun 08 Oct 2017 02:11:41 PM UTCmmuetzelAttached File-=>Added bug39535_patch_facealpha_v2.patch, #42089
    Fri 06 Oct 2017 08:12:19 AM UTCpantxoStatusPatch Submitted=>Patch Reviewed
    Sun 12 Mar 2017 05:13:21 PM UTCmmuetzelAttached File-=>Added bug39535_patch_facealpha.patch, #39977
      StatusConfirmed=>Patch Submitted
      Operating SystemGNU/Linux=>Any
    Sun 12 Mar 2017 02:47:25 PM UTCmmuetzelDependencies-=>bugs #50520 is dependent
    Thu 26 Nov 2015 04:02:04 PM UTCrik5Dependencies-=>bugs #46538 is dependent
    Sun 28 Dec 2014 03:47:31 PM UTCrik5StatusNone=>Confirmed

    Back to the top

    Powered by Savane 3.1-cleanup1