phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

opacity not always working

Open sponce opened this issue 3 years ago • 7 comments

It looks like opacity is not working anymore for me when looking at the LHCb detector. It works for TrackML for example, so it has to be related to the geometry itself.

Could one of you confirm/infirm this behavior ? Just to the main site (http://phoenix-dev.surge.sh/#/lhcb) and try changing opacity on the Detector top level item.

sponce avatar Apr 22 '22 16:04 sponce

I think I partly get what you mean. I am giving it a try. Hopefully, it isn't that complex.

9inpachi avatar Apr 25 '22 18:04 9inpachi

So it's not about being unable to get the object. We have the object but the opacity isn't being applied to the material of objects. I am not sure why.

9inpachi avatar Apr 25 '22 19:04 9inpachi

Could it be related to some warnings that I get when exporting to gltf ?

GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.

The corresponding code is :

if ( material.isMeshStandardMaterial !== true && material.isMeshBasicMaterial !== true ) {
   console.warn( 'GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.' );
} // pbrMetallicRoughness.baseColorFactor

sponce avatar Apr 25 '22 19:04 sponce

It might be. But the thing is, we overwrite the materials on import and make it MeshPhongMaterial for all meshes.

The issue I see here is that the material.transparent = true we set at run time is not working for LHCbs geometries for some reason (works everywhere else). See packages/phoenix-event-display/src/managers/three-manager/scene-manager.ts:148.

If I set the transparent property to true at material creation time, it works just fine. See packages/phoenix-event-display/src/managers/three-manager/import-manager.ts:352. But the problem with this is that the Depth Test for Event Data (you can check it in Phoenix Menu) stops working.

I am working out a solution, it's a workaround.

9inpachi avatar Apr 25 '22 19:04 9inpachi

Thanks a lot ! Note that I realize we are discussing a different issue than the one of this issue here. This one concerns name clashes. Maybe we just change the title and put 2 in one

sponce avatar Apr 25 '22 19:04 sponce

Ah okay, I didn't realize that. :D

Yeah, feel free to change the title or create a new one. Fine by me either way.

9inpachi avatar Apr 25 '22 20:04 9inpachi

ok, I've updated this MR to dedicate it to the opacity issue and create #426 for the menu issues

sponce avatar Apr 29 '22 08:04 sponce

I believe this is fixed (reopen if not).

EdwardMoyse avatar Nov 08 '24 21:11 EdwardMoyse