• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS Blender2MSFS Limitation? Color Multipliers

Messages
124
Country
unitedstates
I have been trying to get the Color Multipliers in Blender2MSFS to work in MSFS. After some experimentation, I do not believe this is implemented completely in Blender2MSFS and have found a workaround.

To provide context, I am talking about this panel located near the top of the MSFS Material Params panel:

Screenshot 2020-11-26 062130.png


In this panel, the Albedo Color value is the equivalent of the Base Color described in the FlightSim Material and glTF Materials sections of the MSFS SDK Documentation. According to the documentation, this value colors or tints a material applied to an object in MSFS. If a texture is assigned, the value is multiplied with the texture's color values. In this case, "multiplied" means how it is blended with another value just like the Multiply blending mode in Photoshop and other graphics packages. This is important because it allows you to recolor textures which allows for reuse of a texture. In other words, you can reduce the number of textures used by your scenery by recoloring similar materials in the sim rather than using multiple DDS files. I discovered this while investigating how Asobo textured their buildings and found many of them used tiled materials located in the asobo-modellib-texture package. Many of these textures are white or light grey but, when rendered in MSFS, they take on a variety of colors. This effect is achieved through the Base Color or Albedo Color property.

With Blender2MSFS, the Albedo Color property sets the color of an object if a texture is not assigned. For example, if you were to just create a cube, assigned the MSFS Standard material, change the Albedo Color property to red, exported the object using Blender2MSFS, and loaded into MSFS, you would see a red cube. Now, if you assign a texture to the cube and export it again, the texture will override the red color. This is not the way it is supposed to work. Instead, the red should be blended/multiplied with the texture's color(s) in MSFS. The reason why this is not working has to do with what is being exported by Blender2MSFS.

Looking at the glTF created by Blender2MSFS, our red cube's material without a texture assigned would look like this:
Code:
"name" : "Red-Material",
  "pbrMetallicRoughness" : {
    "baseColorFactor" : [
      1,
      0,
      0,
      1
    ],
   "metallicFactor" : 0,
   "roughnessFactor" : 0.5
}

The baseColorFactor represents the value in the Albedo Color field in the Color Multipliers panel and is an RGBA value. Once a texture is assigned the material, the glTF created by Blender2MSFS looks like this:
Code:
"name" : "Red-Material",
  "pbrMetallicRoughness" : {
    "baseColorTexture" : {
     "index" : 4,
     "texCoord" : 0
   },
   "metallicFactor" : 0,
   "roughnessFactor" : 0.5
}

Notice that the baseColorFactor has been replaced by baseColorTexture. This is not correct. Instead, the output should contain both the baseColorFactor and the baseColorTexture, and it should look like this:
Code:
"name" : "Red-Material",
  "pbrMetallicRoughness" : {
    "baseColorFactor" : [
      1,
      0,
      0,
      1
    ],
   "baseColorTexture" : {
     "index" : 4,
     "texCoord" : 0
   },
   "metallicFactor" : 0,
   "roughnessFactor" : 0.5
}

As a real world example, I created a box and assigned three materials to it:
  • A material with a yellow Albedo Color and no texture.
  • A material with a blue Albedo Color and a white corrugated metal texture.
  • A material with a red Albedo Color and the same white corrugated meta texture I used with the blue one.
When I export using Blender2MSFS, I get this in MSFS:

Screenshot 2020-11-26 071602.png


The face without a texture appears yellow as it should. The two other faces, however, are white (the base color of the texture) and are not tinted blue or red. This is because the baseColorFactor is not exported for the materials where a texture has been assigned. However, if I edit the glTF file to include the baseColorFactor, I get this which is what I expected:

Screenshot 2020-11-26 071438.png


Please do not misconstrue my post as criticism of Blender2MSFS. This addon makes so much possible and I am so appreciative for it. Instead, I hope this post documents an improvement that could be made in a future release and a workaround (editing the glTF) for those that want to make use of this powerful feature in MSFS.

Let me know if you have any questions or other thoughts on this.
 
Messages
85
Country
germany
After writing you a PM on this topic, I dug deeper in the python code.
What I found is, that I am able to tint AND export the gltf correctly when instead of using the color multiplier and the "albedo tint", using the Blender Base Color -> Color2 value.

albedo_tint.PNG


The "albedo_tint" node, does not seem to set anything when exporting to GLTF and also using an albedo texture.
But what is working is setting the "Color2" value to your "tinting" color. It then correctly exports to this:

{
"emissiveFactor" : [
0,
0,
0
],
"name" : "PfeilerRot",
"pbrMetallicRoughness" : {
"baseColorFactor" : [
1,
0,
0,
1
],
"baseColorTexture" : {
"index" : 0,
"texCoord" : 0
},
"metallicFactor" : 0,
"roughnessFactor" : 0.5
}
},

Hope this helps you too.

albedo_tint2.PNG


Now I am using the same texture for both, and one material is just tinted red.
 
Messages
760
Country
italy
Thank you so much, great find, i had to correct the gltf manually previously!

Inviato dal mio Mi 9 Lite utilizzando Tapatalk
 
Messages
124
Country
unitedstates
@sleepy_t, you are a rock star! This is a big! I had a chance to experiment with this and it works well. A few notes about this technique:
  1. You have to change the blending mode in the albedo_detail_mix node from Mix (it's default) to Multiply.
  2. To see the color appear in Blender as it will in MSFS, you need to set the albedo_tint to white (RGB: 1, 1, 1, ) and set the abedo_detail_mix Fac value to 1. Otherwise, it will appear as Color 1 (the color coming from the albedo_tint_mix node).
Thank you. This is a huge time saver.
 
Messages
85
Country
germany
@sleepy_t, you are a rock star! This is a big! I had a chance to experiment with this and it works well. A few notes about this technique:
  1. You have to change the blending mode in the albedo_detail_mix node from Mix (it's default) to Multiply.
  2. To see the color appear in Blender as it will in MSFS, you need to set the albedo_tint to white (RGB: 1, 1, 1, ) and set the abedo_detail_mix Fac value to 1. Otherwise, it will appear as Color 1 (the color coming from the albedo_tint_mix node).
Thank you. This is a huge time saver.
No no, thanks to your posts regarding this issue, I looked for this 🙃
And thanks for your posts about Decals I am now able to create dirty houses without baking my textures.

Sometimes it just needs a simple trick 🙂
 
Messages
372
Country
austria
If this helps you i found the part in the code to connect the albedo_tint with the albedo_detail_mix and i can change the default mix fac to 1. (With this setup the albedo allways gets a color and you have to set the mix fac to 0) would be cool to have the mix fac in the settings panel too.
 
Messages
372
Country
austria
This is a unofficial Version of the Toolkit with the added feature of the texture coloring thing. I hope Vitus and the mods dont mind :)
I also added a slider to change the mix factor in the msfs material properties. (it is called "Albedo Color Mix")
and i fixed the emission tint color slider (i allways thought if you switch it to white the emission value is way too bright)

i did not test to export a model so if there are problems let me know maybe i can fix it.
(i am just a total noob, did a try and error this evening and in blender it looks like it is working) :D

2021-02-11 00_29_32-Window.jpg
 
Last edited:
Messages
85
Country
germany
Great! I'll try it out soon. Would be great to have the MSFSToolkit in a github, so the community could build upon it in a more organized way 🙃
 
Messages
760
Country
italy
Wow very nice!
Are you also able to fix the Decal material transparency?

The alpha multiplier with the msfstoolkit Is ignored, manual solution Is to modify gltf material property adding a basecolor 1,1,1, x (where x the alpha value between 0 transparent and 1 opaque)



Inviato dal mio Mi 9 Lite utilizzando Tapatalk
 
Messages
372
Country
austria
i actualy dont know exactly what you want to do :)
You have a Object lik a house.
You have a second Object like a plane with a dirt texture with that MSFS Decal material on it. and you wand this material to be semi transparent? to mix it to your house.

do you need the decal material for this or is this working with the msfs standard material / Blend mode / and the alpha multiplier?
Is there a work around inside of Blender to get the export right?

Hm maybe i just have to write the alpha multiplier to the albedo_tint node too 🤔
if it is that easy i think i can fix it :D
 
Messages
372
Country
austria
@mamu just let me know if it was really that easy :D
i added the feature that the alpha multiplier is affecting the albedo_tint node too.
with this ned setup i think you have to set the values like this:
Albedo Color to: White
Alpa multiplier to: the transparency value you like
Albedo Color mix to: 1
 
Last edited:
Messages
760
Country
italy
i actualy dont know exactly what you want to do :)
You have a Object lik a house.
You have a second Object like a plane with a dirt texture with that MSFS Decal material on it. and you wand this material to be semi transparent? to mix it to your house.

do you need the decal material for this or is this working with the msfs standard material / Blend mode / and the alpha multiplier?
Is there a work around inside of Blender to get the export right?

Hm maybe i just have to write the alpha multiplier to the albedo_tint node too
if it is that easy i think i can fix it :D
Exactly!
With this workflow It's Easy to add dirt and grounge to Buildings mantaining Pbr
I've a single texture with a variation of Rust dirt oil and Moss,
Applying that to simple planes, so with little more geometry it's Easy to add nice details keepying a good resolution.
The ability to make the texture more or less trasnparent Is the Key to obtain realistic renditions


Yup gonna try that tonight!!



Inviato dal mio Mi 9 Lite utilizzando Tapatalk
 
Messages
372
Country
austria
i am not sure if MULTIPLY is really the right type for the albedo_detail_mix node.
With a white texture it is good but not if you have a blue one. if you multiply that with red you get brown or something like that.
In the sim this blend type should not take an affect it is just for the blender display.
Maybe SCREEN would be better.

would be nice if some one could test that and compare it with the simulator. how is a cube looking with a blue color and a tint color of red. if we know the result in the sim we can find the right type for the node in blender :)
 
Messages
760
Country
italy
@Mikea.at thanks for your effort,
unfortunately your solution does work only if the object has not textures

if you apply a texture for albedo color, the only way to get a colored texture is with @sleepy_t solution: a plain color in Color2

same goes for transparency in decals, only way is to set a Color2 with some alpha value

There should be something wrong in the exporter, because your coding (and the logic behind it) works nice in the blender viewport
 
Messages
372
Country
austria
@mamu
so one more try, i think this is fixed now. tested it with a texture and the color and both are in the exported .gltf file now.

2021-02-12 08_56_31-Window.png


the node shader setup is now like this:
i removed the connections from the albedo_tint node. the color picker in the settings still work i update all the values trough the code.
with the Albedo Color Mix slider, in the settings, you affect the alpha value of the exported "baseColorFactor" so this is the slider to adjust the transparency of the overlay color in MSFS
i think that in the Blender viewport the Color is not representing the real colors that will appear in the sim. this should be testet with the sim. maybe we can optimize that later. :)

2021-02-12 08_55_23-Window.png
 
Last edited:
Messages
124
Country
unitedstates
@Mikea.at, thanks for the updates. The Albedo Color Mix slide is defaulted to 1 but it looks like the Fac variable in the albedo_detail_mix node is still at 0. Any chance you can update the albedo_detail_mix Fac to default to 1, too?
 
Top