[chimerax-users] Flat transparency setting absent

David William Kastner kastner at mit.edu
Mon Sep 27 16:31:31 PDT 2021


Thanks Tom!
This works perfectly for my needs. The figure looks great! If you want to add this to the ticket, the only problem I notice is that the “flat” transparency will render out blank when I select a PNG with a transparent background, but it works as expected with a white background. Thanks again.

David

---
David Kastner
Ph.D. student | Bioengineering
MIT | Kulik Lab
kastner.io

From: Tom Goddard <goddard at sonic.net>
Date: Monday, September 27, 2021 at 5:12 PM
To: David William Kastner <kastner at mit.edu>
Cc: ChimeraX Users Help <chimerax-users at cgl.ucsf.edu>
Subject: Re: [chimerax-users] Flat transparency setting absent

Oops!  Actually the line needs to be preceded with // (two forward slashes) make it a comment not #.  So it should look like

//   a = (a >= 1 ? 1.0 : 1.0 - pow(max(1.0-a,0.0), 1.0/max(abs(dot(v1,N1)),0.01)));

   Tom



On Sep 27, 2021, at 1:48 PM, David William Kastner via ChimeraX-users <chimerax-users at cgl.ucsf.edu<mailto:chimerax-users at cgl.ucsf.edu>> wrote:

Tom,
Thank you for the fast reply! Disabling the angle dependent transparency is exactly what I was looking for; however, when I commented the specified line in fragmentShader.txt on my Mac install of ChimeraX1.2.5, it throws an OpenGL error. The error is long, but the first line is:

('Shader compile failure (0): b"ERROR: 0:355: \'\' : Invalid Directive: a\\n"', [b'#version 330 core\n#define USE_LIGHTING 1\n#define USE_LIGHTING_NORMALS 1\n#define USE_DEPTH_CUE 1\n#define USE_SHIFT_AND_SCALE 1\n#define USE_VERTEX_COLORS 1\n#define MAX_SHADOWS 1024\n\n/*\n *

---
David Kastner
Ph.D. student | Bioengineering
MIT | Kulik Lab
kastner.io<http://kastner.io/>

From: Tom Goddard <goddard at sonic.net<mailto:goddard at sonic.net>>
Date: Monday, September 27, 2021 at 4:30 PM
To: David William Kastner <kastner at mit.edu<mailto:kastner at mit.edu>>
Cc: ChimeraX Users Help <chimerax-users at cgl.ucsf.edu<mailto:chimerax-users at cgl.ucsf.edu>>
Subject: Re: [chimerax-users] Flat transparency setting absent

Hi David,
ChimeraX does not have the flat transparency option.  I have made a feature request for it

https://www.rbvi.ucsf.edu/trac/ChimeraX/ticket/5294

We plan to freeze the ChimeraX code in preparation for the ChimeraX 1.3 release this week, so I will not add this right now, but it should be pretty easy to add.
  I see you are trying to use transparency to achieve fading of the ribbon. So you don't want the angle dependent transparency where edge on transparent surfaces appear opaque, giving a more 3-dimensional appearance. You just want it all equally faded.
  If you want to edit your ChimeraX distribution you can make it use flat transparency. The file to edit is (on Mac)
ChimeraX-1.2.5.app/Contents/lib/python3.8/site-packages/chimerax/graphics/fragmentShader.txt
and you should add a "#" character in front of the following line using a text editor
a = (a >= 1 ? 1.0 : 1.0 - pow(max(1.0-a,0.0), 1.0/max(abs(dot(v1,N1)),0.01)));
so it becomes
# a = (a >= 1 ? 1.0 : 1.0 - pow(max(1.0-a,0.0), 1.0/max(abs(dot(v1,N1)),0.01)));
This is the line in the graphics shader program that applies the angle dependent transparency. With this change, all transparency will be flat.
Tom



On Sep 27, 2021, at 12:43 PM, David William Kastner via ChimeraX-users <chimerax-users at cgl.ucsf.edu<mailto:chimerax-users at cgl.ucsf.edu>> wrote:

ChimeraX community,
I noticed that in ChimeraX, the “flat” transparency option that was present in Chimera has been either moved or renamed in ChimeraX. This setting made it so the transparency setting wasn’t overwhelming/distracting when focusing on details. In Chimera, it is accessed with Tools > Viewing controls > Effects > transparency > flat. Does anyone know how to achieve this effect in ChimeraX? I find the default ChimeraX transparency option to be disorienting when visualizing details. Here is a rendering comparing the two rendering styles with and without “flat” option. I look forward to your thoughts!

https://www.dropbox.com/s/xrjyjnzegeeltap/transparency_comparison.png?dl=0

David

---
David Kastner
Ph.D. student | Bioengineering
MIT | Kulik Lab
kastner.io<http://kastner.io/>
_______________________________________________
ChimeraX-users mailing list
ChimeraX-users at cgl.ucsf.edu<mailto:ChimeraX-users at cgl.ucsf.edu>
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users



_______________________________________________
ChimeraX-users mailing list
ChimeraX-users at cgl.ucsf.edu<mailto:ChimeraX-users at cgl.ucsf.edu>
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimerax-users/attachments/20210927/d4038cf8/attachment-0001.html>


More information about the ChimeraX-users mailing list