Open Arnklit opened 4 years ago
I checked the gltf:
I think the materials are overwriting each other. In particular, FBX's material is overwriting the other ones, since FBX's material is always set to cull double sided.
Regarding
When using gITF the "Emission" property is enabled, even though the value is set to default black in Blender.
This has no ill effects I think, so have "Emission" property" be toggled only on use could be a junior issue to PR on.
For Collada and FBX:
Blender doesn't support FBX's Arnold materials so any roughness and metalness values are guessed. The same goes for Collada. I'm not sure if there's a way to guess.
When using FBX, the Roughness value isn't set, it's left at 1.0, this does not match the value from Blender, which was the default of 0.4.
When using Collada, the Roughness value is set to 0.08, this does not match the value from Blender, which was the default of 0.4.
I'm seeing the culling set to Disabled on every material I import on two different machines. I made another new project and tried the three different types of glTF files and all of them did it for me.
Yeah the Emission thing doesn't affect the look, so it's not a big problem, but I'm gussing it still adds the emission code to the shader.
Did you put the fbx, obj and gltf in separate folders?
Did you put the fbx, obj and gltf in separate folders?
In the last example above I just did the three different types of gltf files, no other file types and yes I put each inside it's own folder so they didn't mess with each other.
I just made yet another new project, with just a single .gltf file that I imported and nothing else in the project, and again the Cull Mode gets set to Disabled.
I can make a video of it later tonight if that would help.
This material is double sided.
"materials" : [
{
"doubleSided" : true,
"emissiveFactor" : [
0,
0,
0
],
"name" : "gltf mat",
"pbrMetallicRoughness" : {
"baseColorFactor" : [
0.800000011920929,
0.800000011920929,
0.800000011920929,
1
],
"metallicFactor" : 0,
"roughnessFactor" : 0.4000000059604645
}
}
],
Ah damn, ok my bad. I must have been doing something wrong. I was sure I had tried using the "Backface Culling" setting in the Eevee material options, but not seen it working, but it works when I set it now, so it reads that value and sets Culling based of it.
I'd venture to say this is still not a great situation to read that Culling option and set Culling to disabled. 9 times our of 10 when you are using Blender you'll be modelling and want to see backfaces and not worry about that setting, but you don't expect Culling to be disabled when you then move over to a game engine. And if you are not using Eevee you won't even see this setting in the material panel in Blender.
What things can be improved?
Note that FBX is being rewritten from the ground up and there's a branch for that work. It should have this problem resolved. Need to check.
How about we just use this bug to fix the small error with emission being enabled?
I think a case could be made for never setting the Culling to Disabled, as I think it will very often not be what people actually want. But that seems like something that should be proposed as an improvement, not as a bug fix, since it is currently working as expected.
Logged a bug against blenders glTF export https://developer.blender.org/T82084
I think this is actually a problem for Maya too, what is happening agnostic of modelling application.
Basically 'emission defaults to 1.0' but no properties are set, this is a misunderstanding in our importers of emission being set to a value.
I had to put some code in the FBX importer to deal with this property correctly too.
@Arnklit I will publish the material fixes which will resolve this for FBX.
I can confirm the disabled cull mode part on master
fc09d783f. It seems that this is intentional however: https://github.com/godotengine/godot/issues/50552
My issue with this is that I'm often using GLB models downloaded from online sources such as Poly Haven. These models come with materials that have backface culling disabled, but they would render just fine with backface culling enabled. This reduces performance for no good reason, as backfaces don't need to be rendered.
We should probably have a checkbox in the Import dock to force backface culling on imported materials, and enable it by default on opaque materials at least (as most opaque materials don't need to use the Disabled cull mode).
I believe we can override the choice by force but we must respect the cull mode defined in gltf.
Emission checkbox may be a bug but it has very little performance impact. We will investigate later. Collada is not currently being maintained. FBX issue should be fixed now that we use FBX2glTF
Godot version: Godot 3.2.3
OS/device including version: Windows 10 Pro v.2004 / Inspiron 7373 Core i7-8550U / Intel(R) UHD Graphics 620
Issue description: When importing models including materials from Blender, I'm getting unexpected parameters set in the materials:
Using all three gITF, Collada and FBX, the parameter for Cull Mode is set to "Disabled", I believe it should always default to "Back". Even if you enable Backface Culling in the Eevee material settings, Cull Mode will still be "Disabled" when importing.
When using gITF the "Emission" property is enabled, even though the value is set to default black in Blender.
When using Collada, the Roughness value is set to 0.08, this does not match the value from Blender, which was the default of 0.4.
When using FBX, the Roughness value isn't set, it's left at 1.0, this does not match the value from Blender, which was the default of 0.4.
NOTE: I could not use the Better Collada exporter in Blender as it gives an error that you need to upgrade to Blender 2.8x when using both Blender 2.83.6 and Blender 2.90.1. So the Collada file used here is made using Blender's built-in Collada exporter.
Steps to reproduce: Open attached project and observe the values in the 3 materials.
Minimal reproduction project: ModelImportIssuesExample.zip