Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha cutoff materials are alpha blending? #757

Open
Cameron-Micka opened this issue Feb 25, 2025 · 0 comments
Open

Alpha cutoff materials are alpha blending? #757

Cameron-Micka opened this issue Feb 25, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Cameron-Micka
Copy link

Cameron-Micka commented Feb 25, 2025

Describe the bug
I have a file named WinterCabin.glb that renders like this in Unity:
Image

And like this in other glTF viewers:
Image

I took a stab at debugging the issue and it looks like the two materials within WinterCabin.glb are marked as "alphaMode":"MASK" (which is kind of silly since I don't really need to be). Anyway, when I import the file with glTFast the two material's "Surface Types" are "Transparent" (rather than "Opaque") which is enabling alpha blending and the sorting artifacts you see in the first image.

Files
WinterCabin.zip

To Reproduce
Steps to reproduce the behavior:

  1. Import WinterCabin.glb into your Unity project*
  2. Drag and drop the imported model into a Unity scene
  3. See artifacts

* Note the project this was tested in is using Unity 2022.3, URP, and glTFast 6.10.1.

Expected behavior
The WinterCabin.glb renders without sorting artifacts.

I think the issue in this case is the GetSpecularShaderFeatures method enables alpha blending if the mode is anything but opaque. Maybe the check in that method should be if (gltfMaterial.GetAlphaMode() == AlphaMode.Blend) so that AlphaMode.Mask materials can also be opaque?

Desktop (please complete the following information):

  • glTFast version 6.10.1
  • Unity Editor version 2022.3.34f1
  • Render Pipeline and version Universal Render Pipeline 14.0.11 (Forward rendering)
  • Platform: Editor (Windows)
@Cameron-Micka Cameron-Micka added the bug Something isn't working label Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant