#14933 closed enhancement (nonchimerax)

ChimeraX GLTF embedded in PowerPoint has bad lighting

Reported by: phil.cruz@… Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Input/Output Version:
Keywords: Cc: meghan.mccarthy@…, kristen.browne@…
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

From the March 28, 2024 NIAID ChimeraX meeting:

Phil: ChimeraX gltf outputs look washed out when embedded into Microsoft documents (Powerpoint and Word). Due to their oversaturated lighting model, which is unlikely to be addressed by Microsoft, so we have to try to work around it. I can generate ChimeraX gltf files that look better after embedding in such documents by using different settings in ChimeraX (I have my own preset for this, which uses "color modify" to lighten the colors) but that may require yet another set of output options. Kristen: I hacked Powerpoint to get around it but it's not trivial. See this in the forum for the Microsoft lighting: ​https://answers.microsoft.com/en-us/msoffice/forum/all/3d-model-lighting-inside-powerpoint/d0c0c316-8019-4c25-b0f6-86500e512f91 ... The suggested solution is what I've done in the past to fix the lighting.

Meghan posted another link in the chat ​https://answers.microsoft.com/en-us/msoffice/forum/all/powerpoint-uses-gltf-but-doesnt-support/002d1f4e-061d-4ab6-a692-ed217945724a

Meghan: are there ways to fix the gltf after it's output? Blender, but having to download Blender is another barrier. Kristen: maybe NIH3D could have a "optimize gltf for Microsoft documents" service that runs our own Blender. Phil, Darrell: it may be a useful utility. Darrell: does gltf outputs from ChimeraX include lights? Kristen: I just checked, and no, these gltf files do not include lights or camera.

Attachments (11)

chimerax_1a0m.png (95.2 KB ) - added by Tom Goddard 19 months ago.
ChimeraX showing 1a0m ribbons colored by chain.
powerpoint_1a0m_gltf.png (448.5 KB ) - added by Tom Goddard 19 months ago.
PowerPoint showing GLTF of 1a0m colored by chain export from ChimeraX. Looks pretty similar to appearance in ChimeraX.
1a0m.glb (452.0 KB ) - added by Tom Goddard 19 months ago.
1a0m GLTF file from ChimeraX used from the previous PowerPoint image.
ChimeraXglbPPTcomparison.png (617.4 KB ) - added by meghan.mccarthy@… 19 months ago.
Added by email2trac
1ubqChimeraXexport.glb (886.1 KB ) - added by meghan.mccarthy@… 19 months ago.
Added by email2trac
1ubq_0-ribbon-rainbow-vis_NIH3D.glb (815.9 KB ) - added by meghan.mccarthy@… 19 months ago.
Added by email2trac
ChimeraXglbPPTcomparison_lightsRemoved.png (64.1 KB ) - added by meghan.mccarthy@… 19 months ago.
Added by email2trac
powerpoint_1ubq_meghan.png (885.0 KB ) - added by Tom Goddard 19 months ago.
Appearance of 1ubqChimeraXexport.glb in Tom Goddard's PowerPoint version, colors are close to ChimeraX.
1ubq_rainbow.glb (886.1 KB ) - added by Tom Goddard 19 months ago.
1ubq rainbow made in ChimeraX daily build by Tom.
1ubq_rainbow.png (164.4 KB ) - added by Tom Goddard 19 months ago.
1ubq rainbow appearance in ChimeraX daily build made by Tom.
powerpoint_1ubq.png (798.7 KB ) - added by Tom Goddard 19 months ago.
1ubq rainbow GLTF made by Tom as it appears in PowerPoint, very similar to ChimeraX colors.

Change History (18)

comment:1 by Tom Goddard, 19 months ago

I tested a GLTF embedded in PowerPoint and it didn't look very different from appearance in ChimeraX with simple lighting. ChimeraX does not put any lighting information in GLTF files, so PowerPoint is using its own lighting which of course will look different from ChimeraX lighting.

I've attached images of ChimeraX (chimerax_1a0m.png) and PowerPoint for Mac (version 16.83 (24031120), Microsoft 365) with GLTF of the same scene (powerpoint_1a0m_gltf.png).

It is possible ChimeraX could put some lighting info into the GLTF that would improve the appearance in PowerPoint. But I would need an example GLTF file that shows the difference betweeen ChimeraX and PowerPoint appearance. If any of the NIAID folks want to provide such a file I can take a look.

by Tom Goddard, 19 months ago

Attachment: chimerax_1a0m.png added

ChimeraX showing 1a0m ribbons colored by chain.

by Tom Goddard, 19 months ago

Attachment: powerpoint_1a0m_gltf.png added

PowerPoint showing GLTF of 1a0m colored by chain export from ChimeraX. Looks pretty similar to appearance in ChimeraX.

by Tom Goddard, 19 months ago

Attachment: 1a0m.glb added

1a0m GLTF file from ChimeraX used from the previous PowerPoint image.

comment:2 by meghan.mccarthy@…, 19 months ago

Tom,

See the attached screenshot from two models side by side in PPT and you may be able to tell the changes in color a bit better. The original .glb files for each are attached as well.

If I can test anything, let me know. Thanks!

Meghan

ChimeraXglbPPTcomparison.png

1ubqChimeraXexport.glb

1ubq_0-ribbon-rainbow-vis_NIH3D.glb

Last edited 19 months ago by Tom Goddard (previous) (diff)

by meghan.mccarthy@…, 19 months ago

Added by email2trac

by meghan.mccarthy@…, 19 months ago

Attachment: 1ubqChimeraXexport.glb added

Added by email2trac

by meghan.mccarthy@…, 19 months ago

Added by email2trac

comment:3 by meghan.mccarthy@…, 19 months ago

I found this support article from Microsoft in 2019: https://answers.microsoft.com/en-us/msoffice/forum/all/3d-model-lighting-inside-powerpoint/d0c0c316-8019-4c25-b0f6-86500e512f91

I followed those instructions to edit the XML and removed all lights as instructed. The models are now entirely black, see the screenshot. I probably need to change the values in the elements rather than delete them altogether, so I'll mess around with this a bit more. It is annoying that the lights can't be manipulated from the UI. I didn't see what is different in the lighting settings between the two models inserted in the document.

ChimeraXglbPPTcomparison_lightsRemoved.png

Last edited 19 months ago by Tom Goddard (previous) (diff)

by meghan.mccarthy@…, 19 months ago

Added by email2trac

comment:4 by Tom Goddard, 19 months ago

Thanks for the example 1ubq rainbow Meghan. In my PowerPoint (Mac version 16.83 (24031120) part of Microsoft 365), the colors are close to ChimeraX colors for your GLB file. I took the 1ubqChimeraXexport.glb you attached and dropped it in my PowerPoint and the result is attached as powerpoint_1ubq_meghan.png. I also made my own GLTF in the ChimeraX daily build of 1ubq (1ubq_rainbow.glb) and its appearance in ChimeraX (1ubq_rainbow.png) is very similar as in PowerPoint (powerpoint_1ubq.png).

So possibly PowerPoint has fixed this problem and you just need a newer PowerPoint. What PowerPoint version are you using?

by Tom Goddard, 19 months ago

Attachment: powerpoint_1ubq_meghan.png added

Appearance of 1ubqChimeraXexport.glb in Tom Goddard's PowerPoint version, colors are close to ChimeraX.

by Tom Goddard, 19 months ago

Attachment: 1ubq_rainbow.glb added

1ubq rainbow made in ChimeraX daily build by Tom.

by Tom Goddard, 19 months ago

Attachment: 1ubq_rainbow.png added

1ubq rainbow appearance in ChimeraX daily build made by Tom.

by Tom Goddard, 19 months ago

Attachment: powerpoint_1ubq.png added

1ubq rainbow GLTF made by Tom as it appears in PowerPoint, very similar to ChimeraX colors.

comment:5 by Tom Goddard, 19 months ago

Meghan and Kristen sent some explanations of GLTF color problems by email:

From: "McCarthy, Meghan (NIH/NIAID) [C]"
Date: April 9, 2024 at 7:58:49 AM PDT

Hi Tom,

Taking this off the full chain for the moment so I can clarify the issue of ones looking washed out are those that come from our pipelines, based on what I shared in my initial comparison where the one saved directly out of ChimeraX had more saturated colors than the same one downloaded from NIH 3D.

@Browne, Kristen (NIH/NIAID) [C] and @Cruz, Phil (NIH/NIAID) [C], the washing out happens to models those that don't come from ChimeraX, so this isn't a ChimeraX issue. However, since an export from ChimeraX is ok, perhaps you can compare the two. There are additional lights of some sort already baked in to the NIH 3D workflows model that make it appear washed out when lighting is added in PPT.

Meghan McCarthy, Ph.D.

From: "Browne, Kristen (NIH/NIAID) [C]"
Date: April 9, 2024 at 8:15:13 AM PDT

Washed out colors is a known issue with GLBs from the older version of ChimeraX that is in the NIH 3D workflows. Tom fixed this in the newer ChimeraX, but in the workflows, the binary isn’t being updated until we do the full workflow updates and re-runs or there will be inconsistencies in the outputs from before and after the updates. There are many ChimeraX changes that are bundled into the workflow reruns so the decision was to wait until everything was ready.

I’ve only tried PPT with non-chimerax models, and they did look washed out. ChimeraX models I’ve only heard about through Phil so he may have more information as to which version of ChimeraX he was using to output the models etc.

K

From: "Browne, Kristen (NIH/NIAID) [C]"
Date: April 9, 2024 at 8:23:03 AM PDT

I went back to the chat where we discussed this before, and the command Phil was using in ChimeraX to change the lighting was color modify #1 lightness 10. When he looked into this, it wasn’t a command relating to lights, he was changing the colors which makes sense as to why this changes the outputs from ChimeraX. This conversation was way back in August 2023.

It was soon after this that Tom made the fixes to ChimeraX to correct the colors to GLB files. I don’t know if the whole Microsoft product/GLB compatibility was re-evaluated after this. The lighting is definitely bad, but if using the newer ChimeraX, it shouldn’t be AS bad.

Hopefully that refreshes everyone on the conversions we had way back when about this.

K

comment:6 by Tom Goddard, 19 months ago

The NIH 3D pipeline needs to be updated to use ChimeraX 1.7 or newer so that it uses the GLTF files written by ChimeraX with linear colorspace.

I missed that Meghan was comparing GLTF colors in PowerPoint for GLTF exported from ChimeraX versus NIH 3D GLTF (https://3d.nih.gov/entries/3DPX-000133). Now I understand the color problem a little better.

The NIH 3D GLTF 1ubq ribbon (https://3d.nih.gov/entries/3DPX-000133) that I just downloaded says it was from "UCSF ChimeraX 1.6.dev202301280224". I glean this just opening the GLTF in a text editor, the ChimeraX version is in the first 100 or so characters. So the NIH 3D GLTF comes from January 2023 ChimeraX. In October 2023 I fixed ChimeraX GLTF output to use linear colorspace as required by the GLTF specification. Previous ChimeraX wrote out gamma-space colors into GLTF which make the colors look quite different. So this is a key problem. Unless the NIH 3D pipeline is run on ChimeraX 1.7 or newer it isn't going to produce GLTF colors that look like ChimeraX colors.

Last edited 19 months ago by Tom Goddard (previous) (diff)

comment:7 by Tom Goddard, 19 months ago

Resolution: nonchimerax
Status: assignedclosed
Note: See TracTickets for help on using tickets.