glTFast icon indicating copy to clipboard operation
glTFast copied to clipboard

Material Appearance Discrepancy between Windows and Android on glTFast

Open wangyanmeego opened this issue 1 year ago • 3 comments

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

  1. Import a glTF model using glTFast in a Unity project.
  2. Build and run the application on a Windows machine.
  3. Observe the material rendering, which appears correct.
  4. Build and run the same application on an Android device.
  5. Notice the difference in material appearance, resembling a foggy overlay on the object's surface.

the image on windows: gltfast-rendering-in-windows

the image on Android: gltfast-rendering-in-android

wangyanmeego avatar Feb 04 '24 07:02 wangyanmeego

Test on glTFast 5.0.0 and glTFast 6.0.1,Rendering Pipeline is URP 12.

wangyanmeego avatar Feb 04 '24 07:02 wangyanmeego

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. image

wangyanmeego avatar Feb 06 '24 01:02 wangyanmeego

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

atteneder avatar Jun 26 '24 22:06 atteneder