trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

PBRMaterial <-> SimpleMaterial conversion seems to be asymmetric

Open ankuPRK opened this issue 1 year ago • 1 comments

Hello,

I see the material conversion from SimpleMaterial to PBRMaterial here, where we convert glossiness into roughness: https://github.com/mikedh/trimesh/blob/634c608f129d15a307557800deaba954f8a30a3e/trimesh/visual/material.py#L198-L215

But the PBRMaterial to SimpleMaterial conversion here doesn't map roughness -> specular: https://github.com/mikedh/trimesh/blob/634c608f129d15a307557800deaba954f8a30a3e/trimesh/visual/material.py#L675-L686

The conversion formula seems to be reversible. Any insights about why we have this asymmetry would be great.

Thanks!

ankuPRK avatar Sep 09 '24 20:09 ankuPRK

Hey yeah agreed that seems like it would be pretty easy and would make sense to be bidirectional, it's just not implemented. PR's with a fix and test would be super welcome!!

mikedh avatar Sep 09 '24 23:09 mikedh