Flat transparency setting absent

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

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 <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@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 <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@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>

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 From: Tom Goddard <goddard@sonic.net> Date: Monday, September 27, 2021 at 4:30 PM To: David William Kastner <kastner@mit.edu> Cc: ChimeraX Users Help <chimerax-users@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@cgl.ucsf.edu<mailto:chimerax-users@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@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimerax-users

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@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@sonic.net> Date: Monday, September 27, 2021 at 4:30 PM To: David William Kastner <kastner@mit.edu> Cc: ChimeraX Users Help <chimerax-users@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 <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@cgl.ucsf.edu <mailto:chimerax-users@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 <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@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>

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@sonic.net> Date: Monday, September 27, 2021 at 5:12 PM To: David William Kastner <kastner@mit.edu> Cc: ChimeraX Users Help <chimerax-users@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@cgl.ucsf.edu<mailto:chimerax-users@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@sonic.net<mailto:goddard@sonic.net>> Date: Monday, September 27, 2021 at 4:30 PM To: David William Kastner <kastner@mit.edu<mailto:kastner@mit.edu>> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@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@cgl.ucsf.edu<mailto:chimerax-users@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@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimerax-users _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimerax-users

Hi David, It works for me when saving an image with a transparent background with white or black background with ChimeraX 1.2.5 or the daily build on macOS Big Sur. If it comes out blank for you with transparent background that sounds like a bug. Are you sure it is not just very faint? If it really is completely invisible you might want to use ChimeraX menu Help / Report a Bug... and attach an image without transparent background so I can replicate the problem. Tom
On Sep 27, 2021, at 4:31 PM, David William Kastner <kastner@mit.edu> wrote:
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 <http://kastner.io/>
From: Tom Goddard <goddard@sonic.net> Date: Monday, September 27, 2021 at 5:12 PM To: David William Kastner <kastner@mit.edu> Cc: ChimeraX Users Help <chimerax-users@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@cgl.ucsf.edu <mailto:chimerax-users@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@sonic.net <mailto:goddard@sonic.net>> Date: Monday, September 27, 2021 at 4:30 PM To: David William Kastner <kastner@mit.edu <mailto:kastner@mit.edu>> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@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 <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@cgl.ucsf.edu <mailto:chimerax-users@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 <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@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
participants (2)
-
David William Kastner
-
Tom Goddard