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

Detect 3D does not affect embedded .glb textures, meaning they will not have mipmaps generated or VRAM compression used (regression in 4.0.alpha10) #62295

Closed
plafer opened this issue Jun 22, 2022 · 8 comments

Comments

@plafer
Copy link

plafer commented Jun 22, 2022


Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version

4.0.alpha-10

System information

Ubuntu 20.04, x64, Nvidia GeForce GTX 1050 Ti, driver version 470.129.06, Vulkan backend

Issue description

This PBR texture looks "grainy" when made in Blender, and exported to a .glb file. The same texture looks just fine when loaded directly on a mesh in Godot, or when imported from a Collada file.

In the attached video, the plane on the left is a .glb import, while the one on the left was loaded directly in Godot.

godot-grainy.mp4

Steps to reproduce

  1. Download this PBR texture
  2. In Blender 3.1.*, create a plane, and add the PBR material to the plane
  3. Export the scene to a .glb file (glTF 2.0 format)
  4. Import into Godot by drag and dropping into your res:// folder
  5. Add the imported scene to the World, and observe the grainyness.
  6. You can also create a new MeshInstance3D, add the material (albedo only is necessary), and observe the lack of grainyness.

Minimal reproduction project

Contains only the grainy texture, due to Github upload file size limits.

grainy.zip

@fire
Copy link
Member

fire commented Jun 22, 2022

The mipmaps are off so there's too much detail and causing a sharpness pattern.

@Calinou
Copy link
Member

Calinou commented Jun 22, 2022

The imported .glb's material has its sampling mode set correctly:

image

However, this does not suffice to have working mipmaps. The texture must have mipmaps enabled in its import options, and this isn't done automatically for embedded textures within a .glb file. I assume the whole Detect 3D process should be able to detect and reimport those textures, or even always import embedded textures from .glb as if they were used in 3D.

The texture is also not using VRAM compression, so it's clear that Detect 3D does not affect it:

image

@Calinou Calinou changed the title glTF 2.0 grainy PBR texture Detect 3D does not affect embedded .glb textures, meaning they will not have mipmaps generated or VRAM compression used Jun 22, 2022
@Calinou Calinou added this to the 4.0 milestone Jun 22, 2022
@Calinou Calinou moved this to To Assess in 4.x Priority Issues Jun 22, 2022
@plafer
Copy link
Author

plafer commented Jun 22, 2022

Not sure if that goes without saying, but I observe the same behavior with .gltf files (exporting as "glTF Embedded" in Blender).

@Calinou Calinou changed the title Detect 3D does not affect embedded .glb textures, meaning they will not have mipmaps generated or VRAM compression used Detect 3D does not affect embedded .glb textures, meaning they will not have mipmaps generated or VRAM compression used (regression in 4.0.alpha10) Jun 24, 2022
@Calinou
Copy link
Member

Calinou commented Jun 24, 2022

This was confirmed by @jcostello to be a regression in 4.0.alpha10. 4.0.alpha9 does not have this problem.

@WickedInsignia
Copy link

Just tested myself in 4.0 alpha 9: imported GLTF embedded textures still won't use mipmapping. On Windows 10 GTX1080.
Doesn't seem to be resolved in alpha 11.

@novemberist
Copy link

novemberist commented Feb 24, 2023

On a side note: Since there already is a separate option for handling embedded images from gltf-files in the Advanced Import Settings, should "Extract Materials" really embed the texture files inside the material resource again, when you have already selected "Extract Textures"? I think those settings should be synched in a way to avoid duplication and confusion.

edit: Nevermind, somebody already made a detailed proposal for this issue #75637

@lyuma
Copy link
Contributor

lyuma commented Apr 4, 2023

As of Godot 4.0, by default textures are extracted from .glb models using the project's default texture import settings. This should enable mipmaps as well as VRAM compression (via Detect 3D).

I would like to close this issue as solved. Does that make sense?

@novemberist The problem you hit is a separate bug, as you noted, so we can discuss it there.

@akien-mga
Copy link
Member

Closing based on the above comment.

@github-project-automation github-project-automation bot moved this from Todo to Done in 4.x Priority Issues Jun 22, 2023
@akien-mga akien-mga modified the milestones: 4.1, 4.0 Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

7 participants