-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Importing GLTF files with correct shading #41514
Comments
Godot has no way to import Blender shaders (our PBR differs from Blender's PBR enough that 1:1 translation isn't possible). Also Godot uses a different channel for normal maps than Blender. |
so godot doesn't follow the gltf standard? because in another gltf applications it works just fine. |
There is no such thing as GLTF standard when it comes to shaders. Every engine (Unity/UE4/Godot/Blender) has its own shaders with their own quirks (e.g. how strong clearcoat is or what it means to have roughness 1). The things that are standard are the meshes and the textures, everything else depends on the engine. |
See #40753. |
Notice that the sky color is making the result very different. Edited. I think the normal map is incorrect.
https://docs.godotengine.org/en/stable/tutorials/3d/spatial_material.html |
So how to invert the Y axis? On godot? Do I need another software? Do I change something in blender? |
Godot doesn't have an import flag to invert the normal map's green channel yet. (This will be added by #39202 once it's merged.) You need to either modify the normal map in Blender somehow, or use third-party software to flip the normal map's green channel only. This can be done in GIMP with the help of the Colors > Components > Decompose... and Colors > Components > Compose... actions. |
That's not completely true, altough the rendering is up to the application, the specification (that exists!) says clearly that GLTF follows a right handed coordinates system (+X,+Y,+Z) so godot does not follow the specification when importing it While I do have to use some workaround now, I would think is best to follow the standards and change the behaviour. |
One proposal is to take the green channel and if it's related to a gltf2 normal texture, it would be uncompressed, negated, rewritten and exported again. |
@fire We can enable the Invert Green Channel import flag automatically for normal maps that come from glTF scenes (see my above PR). |
Hi! The shading seem fine to me, but not the environment reflection. It seem to reflect on UV space and not in world space | screenspace... I could be wrong... Your web GLTF viewer use another environment texture as Blender (Look like a black and white gradient). But the reflection mapping seem correct considering the image. By the way, the PBR shading model is all based on the Disney Whitepapers. (Blender, Godot, Unreal, etc.) so it should almost be identical. |
If I use https://hdrihaven.com/hdri/?h=venice_sunset and make it the panorma sky in Godot 3.2 latest beta it looks like this. The normal map appears to be wrong. |
Confirming, the shading is indeed corrected in the latest beta version (3.2.4.beta6). Everything looks right now. I close the issue or you guys? |
I'm trying to export a simple plane with a set of PBR textures from blender 2.8 to godot (v3.2.2-stable, on ubuntu 18.04), here how's shown in blender
and here how's show in godot
I'm ok with a little difference, after all every program is different, but this is unnaceptable.
I know it's not the exporter, because another viewers of gltf files load it correctly, like this on the web
I even tried the same test HDR background for illumination, and doesn't seem to make a lot of difference, this is the shaders that I'm using in blender
the texture set is this one:
https://cc0textures.com/view?id=Tiles058
has color, normals, metallic, roughness, like it should.
This may be a bug, because the glb file exported is correct, or the error would be visible in other gltf viewers, and it's not.
Steps to reproduce:
Download the texture set, make the same material in blender 2.8 as shown in the picture above, export to gltf and import as a new scene in godot
Minimal reproduction project:
qewrqwer.zip
The text was updated successfully, but these errors were encountered: