glTFast
glTFast copied to clipboard
Material Appearance Discrepancy between Windows and Android on glTFast
Description
There is a noticeable difference in the appearance of materials when viewing them on Windows versus Android platforms using glTFast. On Windows, the materials appear correctly. However, on Android, it looks like there's a layer of fog over the object's surface, which is not intended and differs from the expected rendering.
Steps to Reproduce
- Import a glTF model using glTFast in a Unity project.
- Build and run the application on a Windows machine.
- Observe the material rendering, which appears correct.
- Build and run the same application on an Android device.
- Notice the difference in material appearance, resembling a foggy overlay on the object's surface.
the image on windows:
the image on Android:
Test on glTFast 5.0.0 and glTFast 6.0.1,Rendering Pipeline is URP 12.
Finally, I found the cause of the problem and tried methods to solve it. It was caused by normal map sampling, we were using the SampleTexture2D node to sample the normal map texture, which was not a problem in Windows, but would cause errors when switching to the Android platform, this should be a bug of Unity. I tried to change the node for sampling the normal map texture from SampleTexture2D to NormalFromTexture, and the result was that there was no problem.
Hi,
Is it possible that you've been using DXTnm normal map encoding on Android? That would certainly explain the problem, as glTF normal maps are always XYZ.
See #553