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

Cannot import a Blender material with a Normal map and Alpha transparency at the same time while importing from gltf #97740

Open
aaroncdc opened this issue Oct 2, 2024 · 0 comments

Comments

@aaroncdc
Copy link

aaroncdc commented Oct 2, 2024

Tested versions

Tested in v4.3.stable.official [77dcf97]

System information

Godot v4.3.stable - Linux Mint 21.3 (Virginia) - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 580 Series (RADV POLARIS10) - AMD Ryzen 7 2700 Eight-Core Processor (16 Threads)

Issue description

When I try to import a model from Blender 4.2.2, using the gltf 2.0 format and the default export options, if any of the materials has a texture with an alpha channel and a normal map at the same time, the whole model appears yellow in color and has no alpha transparency. If I try to remove the normal map from the material, export it again and reimport it into Godot, the material is still yellow with no alpha transparency (it doesn't update).

In order to be able to fix the material, I need to remove the corresponding .import files generated when Godot imported the model.

Steps to reproduce

  1. Create a regular cube (or any mesh, it's just an example) in Blender 4.2.2 LTS
  2. Asign a material to it
  3. Add a texture to the material's base color that has an alpha channel (for instance, maple.png)
  4. In the Shading tab make sure that the Alpha channel of the texture is linked to the alpha property of the principled BSDF

image

  1. Select the cube and export is as gltf 2.0. Leave all options by default, but make sure to select 'Export only selected objects'. In my case I exported it as cube.glb.
  2. Import cube.glb in Godot. Double click in the imported model. Ensure that the model displays correctly.

image

  1. Now add a Normal Map node, link the texture color to it, and the output normal to the Normal property of the principled BSDF. Ensure that it still looks fine in Blender.

image

  1. Export the cube again as gltf2.0 overwriting the previous one
  2. Make sure the model is updated in Godot (you should see Godot reimporting it. If not, drag and drop the file into your project).
  3. Double click in the imported object. This time it appears yellow

image

  1. Go back to blender, delete the normal map node, and repeat the exporting process again.
  2. Update the model in Godot. The cube still appears yellow.
  3. Navigate to the folder where your glb model is and remove the .png.import file (in my case it's cube_mapple.png.import). Now go back to Godot. Godot should reimport the material.
  4. Double click in the model again. This time it should be rendering properly.

Minimal reproduction project (MRP)

github_bug_report_gltf_yellow.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants