Exporting “Windshield” material from Blender doesn't work...!

Version Blender 3.6.17
Version exporter 1.3.2.3
Version MSFS 2024 1.2.8.0

Frequency : Consistently

Severity :Blocker

It’s difficult to summarize everything that goes wrong when exporting “Winshield” material from Blender, because there are so many details to consider. But overall, it’s impossible to create a correct Windshield based on exactly the same parameters as those described in the SDK examples (DA62). So I decided to produce a short report comparing the SDK and my project…:

Attachments : Windshield DA62 SDK and Blender project comparison.pdf (360.9 KB)

Thank you in advance for taking a look at this and correcting anything that needs correcting!

1 Like

Yes, confirm this - a few minor copy paste and mis type (float/bool) in the code, plus the issue I described to Khronos about the duplicating of the BaseColor texture when you have a detail color texture.

Is the default Blend Mask Threshold suppose to be 0.001 when the DA62 sample has it as 0.1

DETAILBLENDTHRESHOLD = "Blend Mask Threshold", 0.001, "msfs_detail_blend_threshold", "blendThreshold"

more …
The DA62 SDK sample has

                "ASOBO_material_windshield_v3": {
                    "windshieldDetailNormalTexture": {
                        "scale": 0.02,
                        "index": 32
                    },
                    "scratchesNormalTexture": {
                        "index": 33
                    },
                    "windshieldInsectsTexture": {
                        "index": 34
                    },
                    "windshieldInsectsMaskTexture": {
                        "index": 35
                    },
                    "detail1Rough": 0.05,
                    "detail2Rough": 0.05,
                    "detail1Opacity": 0.5,
                    "detail2Opacity": 0.5,
                    "microScratchesTiling": 1.1,
                    "microScratchesStrength": 0.05,
                    "detailNormalRefractScale": 0.05,
                    "wiperLines": true,
                    "rainDropScale": 0.4,
                    "wiper1State": 0.0
                }

while the blender export “could” have (if fixed)

                "ASOBO_material_windshield_v3": {
                    "detail1Rough": 0.05000000074505806,
                    "detail2Rough": 0.05999999865889549,
                    "detail1Opacity": 0.5099999904632568,
                    "detail2Opacity": 0.5,
                    "microScratchesTiling": 1.100000023841858,
                    "microScratchesStrength": 0.05999999865889549,
                    "detailNormalRefractScale": 0.05000000074505806,
                    "wiperLines": false,
                    "wiperLinesStrength": 1,
                    "wiperLinesTiling": 1,
                    "wiper1State": 0,
                    "windshieldDetailNormalTexture": {
                        "index": 2
                    },
                    "scratchesNormalTexture": {
                        "index": 3
                    },
                    "windshieldInsectsTexture": {
                        "index": 4
                    },
                    "windshieldInsectsMaskTexture": {
                        "index": 5
                    }
                },
                "ASOBO_material_rain_options": {
                    "rainDropScale": 0.4000000059604645,
                    "rainDropSide": true
                }

there is a schema for rain_options, but the SDK DA62 sample seems to be in error or behind the latest features.

Edit

Another problem is that the handler will delete the detail normal texture slot. The cockpit normal2 texture gets removed on file open, the scale is not set on export, the scale seems to be in the other asobo extention

edit:2 (because I am not allowed to have more than 3 posts in a row)
the scale for the detail nomal is removed when you build the model in the sim. the gltf in the PackageSources folder will be different than the on in the Packages folder.

edit3:

it is strange that the normal frame is NOT connected to the normal input to the BSDF when you have a detail normal texture

edit4: why is there a spelling error in some of the material extension parameters/file

“textute” - instead of “texture” for the extension data parameter in MSFS2024_MaterialExtension
AM I missing something?

edit5: yes it would be a bad naming issue for the loop param is the same name as the property - very strange

EDIT7 because you will not comment on this post (NOT ALLOWED MORE THAN 3 posts in a row)

edit4/5 - spelling textute
fixed in 1.2.2

edit3 - normal frame
no comment from ASOBO if this is an issue or not?

edit2 - detail scale
not tested by me

Blend mask Threshold
No comment from ASOBO

PDF issues:

Raindrop - is now a Boolean - fixed in 1.2.2 exporter 2.3.2

MicroscratchesTiling is fixed - > 1 can be entered

MicroscratchesStrength - Not fixed in [2024 SU1] SDK 1.2.2 Exporter 2.3.2

  • still remains at 1

Windshielddetailnormaltexture scale - fixed in 1.2.2 exporter 2.3.2

There is still an issue that has been reported to Khronos about detail textures put into the BaseColor texture slot in the gltf.

Test file here
windshield_test_detail.zip (155.6 KB)

Detail map issue may be related to this bug report

EDIT 8:
new finding. wiper lines checkbox reverts to false - unchecked when save and reopen
this means that wiper lines tiling and wiperlines strength both revert to 1.0

But is you set the values and export - wiperlinestiling is ok, but wiper lines strength is not exported.

Reviewing microscratches strength has the value put into wiper lines strength. the wrong value is exported

1 Like

Hello,

@Chris-SMS
I read your attached pdf :

Issues that I logged in our backlog :

  • microScratchesStrength that stay to 1 in the gltf.

Issues that are already fixed in the last flighting SDK 1.2.2 that contains the blender plugin 2.3.2 :

  • rainDropSide value type is a boolean in the gltf.
  • microScratchesTilling now taking into account the value at the export
  • windshieldDetailNormalTexture missing

Yes, it’s by design.

I checked and this is what we have now when exporting with blender flighting 2.3.2

We are working on updating the Da62 Sdk Sample that should arrive in a future update.

This is logged.

This is likely by design as some optimization are made on GLTF during the build package process.

It’s likely caused by the normal slot not having a texture in it.

This is logged in our backlog.

This is logged

This one too is logged.

I could not repro this one.
Do you still encounter the issue when using a new project in blender and not?

Regards,
Boris

1 Like

This is related to the incorrect value in the post

Hello,

The windshield material has been fixed and cleaned up in the last Flighting SU1 SDK Core 1.2.3.
Can you confirm that you no longer encounter the issues ?

Regards,
Boris

Regards,
Boris

Let me chime in:

After several attempts at getting Windshield to export properly, it still does not work:

-Attempt exporting the x0_common from the DA-62 sample. The material looks like this:

			},
			"name":"Windshield",
			"occlusionTexture":{
				"index":24
			},
			"pbrMetallicRoughness":{
				"baseColorFactor":[
					0.38499999046325684,
					0.38499999046325684,
					0.38499999046325684,
					0.009999999776482582
				],
				"baseColorTexture":{
					"index":25
				},
				"metallicFactor":0,
				"metallicRoughnessTexture":{
					"index":24
				},
				"roughnessFactor":0.019999999552965164
			}
		}

When trying with my own project, I noted that it fails as soon as any texture past the Secondary Details Details (RGBA) is inserted. Basically, only Reflection (R) roughness (G) Metallic (B) and Secondary Details (RGBA) textures can be added.

If none of the textures below the entry is inserted, it exports correctly:

{
            "alphaMode": "BLEND",
            "emissiveFactor": [
                0,
                0,
                0
            ],
            "extensions": {
                "ASOBO_material_windshield_v3": {
                    "detail1Rough": 0.10000000149011612,
                    "detail2Rough": 0.10000000149011612,
                    "detail1Opacity": 0.5,
                    "detail2Opacity": 0.5,
                    "microScratchesTiling": 1,
                    "microScratchesStrength": 1,
                    "detailNormalRefractScale": 1,
                    "wiperLines": false,
                    "wiperLinesStrength": 1,
                    "wiperLinesTiling": 1,
                    "wiper1State": 0
                },
                "ASOBO_material_rain_options": {
                    "rainDropScale": 1,
                    "rainDropSide": false
                }
            },
            "extras": {},
            "name": "C22J_Windshield",
            "occlusionTexture": {
                "index": 30
            },
            "pbrMetallicRoughness": {
                "baseColorFactor": [
                    1,
                    1,
                    1,
                    0.5
                ],
                "metallicFactor": 0,
                "metallicRoughnessTexture": {
                    "index": 30
                },
                "roughnessFactor": 0.10000000149011612
            }
        },

I have taken these textures from the DA-62 sample.
Secondary Details is from FS-2020. Taking it out has no impact. Inserting any other textures below it stops the material from working. Even if this one is not inserted.
This is under blender 4.2.6LTS and the newer exporter provided with SDK 1.2.3.

This is due to a Khronos change to Blender - the detail texture gets populated in to the BaseColor texture. I have reported this to Khronos - there is no fix by them.

You must check the Detail color texture and see if the gltf has a base color texture or not. The set the basecolor texture to None.

Do this in the gather material hook

OMR does this too in some cases.

    def gather_material_hook(
        self,
        gltf2_material,
        blender_material,
        export_settings
    ):
        msfs_parameters = bpy.context.scene.msfs_multi_exporter_settings
        if not msfs_parameters.enable_msfs_extension:
            return
        # blender 4.0 and now 3.6 issue with detail textures added twice once correct and once as a regular basecolor texture
        # if it has a detail color texture then set basecolor texture to none
        #print("*** MSFS WARNING *** - gather_material_hook - Started with gltf2_material", gltf2_material, gltf2_material.pbr_metallic_roughness, gltf2_material.pbr_metallic_roughness.base_color_texture)
        #print("*** MSFS WARNING *** - gather_material_hook - blender material - delete base color before", blender_material, blender_material.msfs_detail_color_texture, blender_material.msfs_base_color_texture)
        print("gather_material_hook - bmat list", blender_material.msfs_base_color_texture, blender_material.msfs_detail_color_texture, blender_material.msfs_occlusion_metallic_roughness_texture)
        print("gather_material_hook - gmat list", gltf2_material.pbr_metallic_roughness.base_color_texture, gltf2_material.pbr_metallic_roughness.metallic_roughness_texture)
        if blender_material.msfs_detail_color_texture is not None and blender_material.msfs_base_color_texture is None:
            gltf2_material.pbr_metallic_roughness.base_color_texture = None
            print("*** MSFS WARNING *** - blender material - delete the base color", blender_material, blender_material.msfs_detail_color_texture, blender_material.msfs_base_color_texture)
        if gltf2_material.pbr_metallic_roughness.base_color_texture is not None and blender_material.msfs_base_color_texture is None:
            gltf2_material.pbr_metallic_roughness.base_color_texture = None
            print("*** MSFS WARNING *** - blender material - delete the base color - has gltf2 base color no blender texture", blender_material, gltf2_material.pbr_metallic_roughness.base_color_texture, blender_material.msfs_base_color_texture)
        if (gltf2_material.pbr_metallic_roughness.metallic_roughness_texture is not None or gltf2_material.occlusion_texture is not None) and blender_material.msfs_occlusion_metallic_roughness_texture is None:
            gltf2_material.pbr_metallic_roughness.metallic_roughness_texture = None
            gltf2_material.occlusion_texture = None
            print("*** MSFS WARNING *** - blender material - delete the OMR color - has gltf2 OMR color no blender texture", blender_material, gltf2_material.pbr_metallic_roughness.metallic_roughness_texture, blender_material.msfs_occlusion_metallic_roughness_texture)
        
        MSFS2024_MaterialExtension.export(
            gltf2_material=gltf2_material,
            blender_material=blender_material,
            export_settings=export_settings
        )

Edit: fixed bug - my bad sorry

adding your code in the (correct?) place in msfs_export.py has gotten one of the added warning messages to show up in the console.
However now, not even a windshield material without textures will get exported …

Sorry this was a hint to ASOBO on what needs to be looked at. Not meant to be a fix for all users, as I have updated to code to suit my requirements.

I am not in competition with ASOBO. And everyone will have to wait for fixes to windshield, clearcoat and glass.

edit this shows the issues in detail texture base and OMR

geo_decal_test.zip (222.9 KB)

edit2: gltf compared ASOBO to corrected - notice 5 textures compared to only 2
Preset1.zip (6.1 KB)

1 Like

Hello,

It seems this issue is specific to 4.2 LTS.
We will investigate further.

Regards,
Boris

I’m sorry no it is with 3.6 also as Khronos backported this to 3.6. My examples are 3.6

Edit. This was ok with early releases of 3.6.x however the latest ones , 3.6.20 have this issue

Hello,

This is a Khronos limitation and this will be fixed for SU2.

Regards,
Boris

1 Like

So what’s the solution until then ?