Closed ronh991 closed 3 months ago
Hello, Not sure to understand why you think your material should be "OPAQUE". OPAQUE is the default, but in your node setup, your alpha socket of Principled BSDF node is linked to an alpha of a texture, so the alpha mode is set to BLEND.
There is no link between the alpha mode of glTF (OPAQUE, BLEND or MASK), and how alpha is managed in a texture file ( straight, premultiplied, channel packed and none)
Thank you, my point being - this is new functionality to me. The April 6th branch of 4.2 and 4.1.1 respects my setting the alphamode to OPAQUE. This is a game engine restriction - I can't change.
These are without the MSFS addon enabled - strictly Khronos gltf export
4.1 does this
{
"name":"Fuselage",
"normalTexture":{
"index":0
},
"occlusionTexture":{
"index":1
},
"pbrMetallicRoughness":{
"baseColorTexture":{
"index":2
},
"metallicFactor":0,
"metallicRoughnessTexture":{
"index":1
},
"roughnessFactor":0.5
}
},
4.2 now does this
{
"alphaMode":"BLEND",
"name":"Fuselage",
"normalTexture":{
"index":0
},
"occlusionTexture":{
"index":1
},
"pbrMetallicRoughness":{
"baseColorTexture":{
"index":2
},
"metallicFactor":0,
"metallicRoughnessTexture":{
"index":1
},
"roughnessFactor":0.5
}
},
As to the Straight, pre multipled - that is an image.alpha_mode variable in Blender. - so I asked if this is new or why it has the same name as alphamode.
Seems I am getting things mixed up as the naming does not match the my expectations. Blend Mode is OPAQUE, BLEND etc. but the gltf calls it alphaMode.
my expectations are that the setting of blend mode is respected.
blend mode is set to OPAQUE - but exports as BLEND
Starting Blender 4.2 beta (today), this option does not exist anymore in Blender
So, alphaMode can't be set anymore with this no more existing Blender value. We now have to analyze the node tree to detect what alphamode should be exported:
Ack! - ok will try to work around this with material_hook.
But there is still a alphaMode gltf json variable right?
glTF 2.0 specification didn't change
Using material hook - I was able to fix - Only works with 4.2 Beta release 01b8
Describe the bug Depending on the shader node set up, my export will always default to alphaMode = BLEND , this cause flickering in the MSFS game engine. as the materials are always trying to blend with their background textures etc.
the gather_alpha_info function in gltf2_blender_search_node_tree.py will always pass through to the last if and default to BLEND
Blender BSDF has alphamode naming as straight, premultiplied, channel packed and none. Is there a conflict with BLEND, OPAQUE, DITHER and MASK
To Reproduce Steps to reproduce the behavior: Utilize a shader node structure where alpha from texture is not connected in the base color, and utilize the ASOBO exporter updated to 4.2 (with all the other issues resolved)
Expected behavior The default alphamode should be OPAQUE?
Screenshots If applicable, add screenshots to help explain your problem.
.blend file/ .gltf (mandatory) a blend file will not work without the MSFS exporter edit: yes it does set to blend without the MSFS/ASOBO exporter
alphamode_test.zip
Version
Additional context trying to understand where the to_node_nav selects the alpha socket.
an example of error info is these materials should be opaque
however this material has to have blend - windshield transparent