Opened 4 years ago

Last modified 4 years ago

#5294 assigned enhancement

Add flat transparency option

Reported by: kastner@… Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Graphics Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Begin forwarded message:

From: David William Kastner via ChimeraX-users <chimerax-users@…>
Subject: [chimerax-users] Flat transparency setting absent
Date: September 27, 2021 at 12:43:50 PM PDT
To: "chimerax-users@…" <chimerax-users@…>
Reply-To: David William Kastner

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

Attachments (1)

g4Wo9W9b.png (4.4 MB ) - added by Tom Goddard 4 years ago.

Change History (2)

by Tom Goddard, 4 years ago

Attachment: g4Wo9W9b.png added

comment:1 by Tom Goddard, 4 years ago

Basically 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.

Should not be too hard to add. But we are about to freeze for the ChimeraX 1.3 release so I will not add it right now.

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 that in the graphics shader program that applies the angle dependent transparency. With this change, all transparency will be flat.

Note: See TracTickets for help on using tickets.