Open acesolucoes opened 1 week ago
Thanks for reporting,
There seems to be a color space issue with the alpha channel specifically. Even worse, it's reproducible with the URP Unlit shader:
left to right:
But before shipping a fix I'd like to fully understand the root of the issue first.
It's also reproducible with Lit/Standard shaders and in Built-In render pipeline as well. The problem only exists in linear color space projects. When switching to gamma it's correct.
Describe the bug I am trying to view a GLTF model with textures whose PNG already has transparency. For me the rendering is a little weird for reason that I will explain:
These are the GLTF being rendered by GLTFast and by the Windows embedded 3d viewer![comparison](https://github.com/atteneder/glTFast/assets/2185490/f30f1360-2cb4-43bf-aea7-9d46cd6b7adb)
There is some noticable differences in parts where the image used by texture have a great deal of transparency:![comparison2](https://github.com/atteneder/glTFast/assets/2185490/c020bedb-c161-4c05-88ce-6e5e39eb05d8)
The transparency in this region is very high, and I was expecting to see a color more reddish instead of whitish/greyish due to the low amount of alpha (I highlighted in blue the region I had selected for displaying the color information including alpha):
I have verified this problem in Unity 2022.1.13f1 and Unity 2022.3.18f1 using URP in both and GLTfast 5.0 and GLTFast 6.6 and 6.7, so, it is not a new problem. In my understanding the rendering output by the viewers like the WIndows Embedded and others in web that I have tested are saner that which is presented by GLTFast. Simply put, I could achieve a similar look by GLTF pasting the image (with alpha taken away) on top of a red background that matches with the base color texture of my sample. So, my conclusion is that in these cases the transparency is being ignored.
Additionally in 6.6 I could confirm the same issue in the builtin pipeline and HDRP I couldn't check because it was plainly wrong (It was solved in https://github.com/atteneder/glTFast/issues/699 that I had opened).
All tests were made in Windows 11, both in Editor as in a build. It follows the test sample that I have used for my tests (using builtin pipeline).
Test GLTF.zip