Opened 3 years ago

Closed 3 years ago

#8799 closed defect (fixed)

Tomogram black in LookSee unless scaled large

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

Description

Begin forwarded message:

From: "Schmid, Michael F."
Subject: starting views of maps
Date: April 5, 2023 at 5:39:28 PM PDT
To: Tom Goddard

Hi-
In displaying maps to start with, LookSee (and its predecessors) often opens the map in a greyed-out format. I have to scale the map up to get it to display in proper colors, and that scale is sometimes awkwardly big.
Mike

Change History (2)

comment:1 by Tom Goddard, 3 years ago

I tested your .glb files and saw the same problems you did. It appears that Unity can't scaling down the size of your scene by a factor of 30000 without messing up the colors. I am mystified why. Your BL_inf_Q7.glb has x extent about -30000 to 30000 (as reported by the ChimeraX command "info bounds"). But the VR wants it scaled down to meters in the room. So scaling down to say 2 meters requires scaling down by 30000.

While I'm not sure why that messes up the colors, the solution I tested is just to write the .glb file scaled down. The "save myfile.glb" command has a "size" option but it simply puts in the file that it should be scaled by a certain factor and that does not fix the problem. The xyz coordinates of the triangle vertices actually need to be scaled. Probably the easiest way to scale the vertex coordinates is to just change your map voxel size. For instance if it is 100 Angstroms, make it 0.01 Angstroms, the save the .glb. You probably have to do the coloring after you change the voxel size. The map voxel size can be changed with ChimeraX menu Tools / Volume Data / Map Coordinates / Voxel Size, or with command "volume voxelSize .01".

Now that I know that Unity or GLTFast has some trouble with large scale factors I'll see if I can improve the ChimeraX saving of .glb files so it can scale the actual coordinates of vertices instead of just inserting the scale factor into the file. Or maybe better, I will just change LookSee so it rescales the vertices so the colors work.

Thanks for pointing out the problem. I was not looking at tomograms so I didn't see the problem in my tests because none of my molecules and maps needed that much scaling to room meters.

comment:2 by Tom Goddard, 3 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

I changed the LookSee scaling code so that it scales the mesh vertex coordinates directly (and game object positions) instead of just setting the localScale on the top-level game object. My best guess is that the vertex color interpolation across the triangles fails with small scale factors (1.0/30000) due to limited numeric precision in the shader.

Note: See TracTickets for help on using tickets.