Bug #1626: Transparency not respected when highlighting

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Bug #1626: Transparency not respected when highlighting

Post by Kunda1 »

issue #1626
@wmayer wrote:
wmayer wrote:

Code: Select all

glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glColor4f(1.0f, 1.0f, 1.0f, 0.5f);

    renderShape(...);

    glDisable(GL_BLEND); 
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #1626: Transparency not respected when highlighting

Post by Kunda1 »

bump
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #1626: Transparency not respected when highlighting

Post by Kunda1 »

abdullah wrote:
Care to weigh in ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Bug #1626: Transparency not respected when highlighting

Post by abdullah »

Kunda1 wrote: Mon Feb 05, 2018 4:32 pm
abdullah wrote:
Care to weigh in ?
Maybe in some weeks... I am trying to design something with FreeCAD :)

I just saw the ticket. I understand the problem. I saw Werner's code. I did not understand it. I am not even sure if it shows the problem or if it is a solution. But it is clear to me he had a very specific idea around the ticket...
wmayer
Founder
Posts: 20113
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug #1626: Transparency not respected when highlighting

Post by wmayer »

The code snippet is just a reminder for myself what to test.
But fact is that OpenInventor works totally different in case transparency has been applied to a face set compared to normal rendering. Usually when no transparency is set it calls its GLRender method where it first checks with shouldGLRender if an update is required and if yes it does the actual rendering. However, if transparency is set it does all the rendering inside shouldGLRender and this returns with false so that GLRender actually does nothing.

So, the point is to grasp the rendering logic and implement it in our custom Inventor node classes.
Post Reply