• 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.

FSX Blender Tool-set Beta For FSX/P3D Test Files

If I recall... according to the SDK, The specular power scale is 64 if '0' is entered... The default value.....

Entering a '0' doesn't turn it off... if that is what you are thinking...

@arno could confirm this
Thanks for the info. What I mean is the value differ between these two tools. That make confusions when switching between it. If both these tools can provide similar value then it will be easier for us.

Another one if we put a value, for example 30, then it remains 30 in both tools. But if 0 then it become 64 in MCX.

Regards,
Manochvarma Raman
 
Also be aware that xtomdl sometimes doesn't put values in the mdl file based on the setting of other attributes. So that might explain part of the differences. MCX should be a good indication of what's saved in the mdl.
 
Also be aware that xtomdl sometimes doesn't put values in the mdl file based on the setting of other attributes

Hi Arno,
And it would be attributes that would not be compatibles in them ...? Or is it an error of Xtomdl ...? Or xtomdl works properly, and we are looking for something impossible?
 
As far as I know those not stored are attributes that are not used based on other settings. So they are irrelevant in that case.
 
Ok! I am very confused. The FSX SDK says one thing in one part and then completely says some else in another. (Below is an image explaining what I mean)

So, if you read the information in the location one that shows the AlphTestValue to be a FLOAT. In location 2 it gives and example of a value for AlphaTestValue of 132.13005. But If you look in location 3 you will see that the SDK gives a value rang for AlphaTestValue from 0.0 - 1.0. "Very, Very Confusing"
upload_2017-7-12_14-32-3.png


So, I opened the test model in Arno's MCX to see what values that his program allow for AlphaTestValue. And what I found even confused me more. The MCX program allow a number from 0 to a number high enough that it has to be put in scientific notation. This is a very large range! So what I have come to the conclusion, is that we are going to have to set a reasonable range let's say 0.0 - 1000.0 and see how it works. We will have to do a lot of testing.

Now I have been successful in causing my transparent location to be transparent and not to be transparent by changing the AlphaTestValue in my test file. (See Images Below)

To get the transparent location to be fully transparent in FSX, I have the following setting in Blender FSX Materiel settings: Framebuffer Blend = Source Blend:SrcAlpha, Dest Blend:InvSrcAlpha, Z-Test Alpha is:True, Alpha Test Level: 128, and you must have in the enhanced parameters Z-Write Alpha checked.
upload_2017-7-12_14-52-3.png


So, you can see by the image below you can see through the wall that I a placed in FSX.
upload_2017-7-12_14-48-50.png


I decreased the Alpha test value below 128 and the transparent parts of the wall became less transparent. (See Image Below)

upload_2017-7-12_15-0-41.png


So, I believe that the function is working. I just do not know what the max value should be set to. I am uploading a new beta test of the tool-set. You can download it from above.

Thanks, Kris
 
Hi,

MCX does not check min and max values for the attributes. For the alpha test value the range is 0 to 255 for example (pixel values).
 
Hi Kris,

Thanks for the update.

I felt like there are some issues now:
  1. z-bias is not updating at all in MCX. It shows 0 (in MCX) even if we put -25 in the toolset.
  2. Z-Test Alpha only becoming True (in MCX) if the value in Test Mode is other than NEVER. I think it should be True even if we did not have any value for the Test Mode and Alpha Test Level.
  3. Alpha Test Level value is changing (in MCX) only if the value in Test Mode is other than NEVER.
  4. Specular Level and Specular Power Scale giving its own value.
Example:
in toolset:
Specular Level:0.5 (intensity)
Specular Power Scale: 0


in MCX:

Specular Level:96.07843017578125
Specular Power Scale: 64

5. I am confused with the term of No Base Material Specular (in MCX) and Use Base Material Specular (in toolset). Can you please explain it.

I am not sure whether i am correct, since i don't know how actually the value differ according to the SDK. Maybe you can check on it.

Thanks,
Manochvarma Raman
Hi MANOCHVARMA RAMAN!

When you say the the Specular Level do you mean the Specular Intensity? Because in Blender you have Specular Intensity, and Specular Hardness.

I have found a formula error in calculating Specular Hardness And I have corrected it and I am testing it right now. I will check into Specular Intensity, because I think that is what you are talking about.

Thanks, Kris
 
Ok, I just uploaded another Beta Test of the Tool-set. I think that I have Z-Test Alpha, and Specular Hardness working correctly now. You can get the new Beta test file where the old one was.

The image below shows what I had to change for the Specular Hardness code to work correctly.
upload_2017-7-12_18-12-19.png


And in this image below I added text to be printed in the .x file helping you understand what things are.
upload_2017-7-12_18-13-55.png


I will do more testing and upload images of my outcome. Thanks, Kris
 
Also please note that ztestalpha has an input value on screen of 0-1.0 and this is then multiplied for 0-255.

Code:
template AlphaData {
 <10DB69F3-E0EE-4fb3-8055-63E539EF5885>
 Boolean  ZTestAlpha;
 FLOAT    AlphaTestValue;
 STRING   AlphaTestFunction;
 Boolean  FinalAlphaWrite;
 FLOAT    FinalAlphaWriteValue;
}

Code:
                Exporter.File.Write("AlphaData {\n")
                Exporter.File.Write("    %i;    // ZTest Alpha\n" %(Material.fsxm_ztest))
                Exporter.File.Write("    {:9f}; // Alpha test threshold\n" .format(Material.fsxm_ztestlevel))
                Exporter.File.Write("    \"{}\"; // Alpha test function\n" .format(Material.fsxm_ztestmode))
                Exporter.File.Write("    %i;    // Perform final alpha write\n" %(Material.fsxm_falpha))
                Exporter.File.Write("    {:9f}; // Final alpha value\n" .format(Material.fsxm_falphamult * 255.0))
                Exporter.File.Write("}\n")

Code:
            layout.label(text = "Material Alpha Test")
            box = layout.box()
            box.prop(mat, 'fsxm_ztest')
            box.prop(mat, 'fsxm_ztestlevel')
            box.prop(mat, 'fsxm_ztestmode')
        
            if (context.scene.fsx_bool_p3dSDK == True):
                #print("Use P3d = True")
                box.prop(mat, 'fsxm_zbias')
            #else:
                #print("Use P3d = False")
        
        
            #box.prop(mat, 'fsxm_zbias')
        
            layout.label(text = "Final Alpha Blend")
            box = layout.box()
            box.prop(mat, 'fsxm_falpha')
            box.prop(mat, 'fsxm_falphamult')

Code:
    Material.fsxm_ztest = BoolProperty(name = "Z-Test Alpha", default = False)
    Material.fsxm_ztestlevel = FloatProperty(name ="Alpha Test Level", default = 0.0, min = 0.0, max = 1.0)
    Material.fsxm_ztestmode = EnumProperty(name ="Test Mode", default = 'Greater', items = ztesttypes)
    Material.fsxm_zbias = FloatProperty(name ="Z-Bias", default = 0.0, min = -50.0, max = 0.0)
 
    Material.fsxm_falpha = BoolProperty(name = "Set final alpha value at render time", default = False)
    Material.fsxm_falphamult = FloatProperty(name ="Final Alpha Multiply", default = 1.0, min = 0.0, max = 1.0)

the ztestlevel may have to be reviewed

P3D shows example for 3DS Max input as 0-255 not 0-1.0. What does Gmax say?
 
Last edited:
Hi MANOCHVARMA RAMAN!

When you say the the Specular Level do you mean the Specular Intensity? Because in Blender you have Specular Intensity, and Specular Hardness.

I have found a formula error in calculating Specular Hardness And I have corrected it and I am testing it right now. I will check into Specular Intensity, because I think that is what you are talking about.

Thanks, Kris
Hi Kris,

I am not very sure the Specular Level in MCX referring to which part of specular in blender, either the intensity or the hardness.

What i was referring is:
Specular Highlight.PNG


After testing with the new updated toolset, i found:

  1. The Specular level in MCX referring to the specular hardness in blender and for it to be worked correctly, Use Base Material Specular must be checked in the toolset. I hope that is how it should work (i have no idea about it).
  2. Z-Test Alpha only becoming True (in MCX) if the value in Test Mode is other than NEVER.
    I personally thinks that even when we do not have any value for Alpha Test Level and Test Mode, the Z-Test Alpha button should give small function without depending with Alpha Test Level and Test Mode value. That is how it works in MCX.
For example:
Image 1: Z-Test Alpha is False
Screenshot (158).png

Image 2:Z-Test Alpha is True
Screenshot (159).png

The shiny surface in image 1 is a bounding box wrapping the cube of attachpoint for effect. I have mapped it with black UV texture and the following setting in Blender FSX Materiel settings: Framebuffer Blend = One; Dest Blend:One. In order to hide the shiny surface, i need to set Z-Test Alpha to true without changing any value for Alpha Test Level and Test Mode .


3. Z-bias still has no changes. It doesn't give any value in MCX as I have posted previously.
Code:
    Material.fsxm_zbias = FloatProperty(name ="Z-Bias", default = 0.0, min = -50.0, max = 0.0)

I think the default and max value should be -1.

Code:
This functionality only works with "No Z Write" checked on the material. Using values between -1 and -50, you can set and order the layering of the ground polygon textures above the default airport aprons, taxiways and runways. The more negative the Z-bias, the higher layer the material will be.
(Source:http://www.prepar3d.com/SDKv4/sdk/modeling/3ds_max/modeling/modeling_materials.html#ZBiasLevel)
 
Last edited:
Hi all Blender users!

I have uploaded a new Tool-set Beta file to be tested. And I uploaded my Blender test file so that you can use it as a guide how to set up certain function to work correctly in FSX. When I have time I will try to make a new video on how to use the tool-set.

Below are image of my test results.

this is a surface using the platform attribute. And if you do not have settings correctly set for your material in Blender it will not work correctly. Number 1 thing to make sure you set right is the material used as the platform material. FS10 Material settings: Frame Buffer Blend-Source Blend=srcAlpha; Dest Blend=InvSrcAlpha, Material Alpha Test-Z-Test Alpha=True; Alpha Test Level = 120; Test Mode=Greater, Enhanced Parameters-Z-Write Alpha=True; No Shadow=True; Do Not Use Specular Map=True AKA (NoBaseSpecular). If these setting are not correct you will not get shadows showing up in FSX.
upload_2017-7-13_17-42-44.png


upload_2017-7-13_17-53-47.png


upload_2017-7-13_17-54-16.png


upload_2017-7-13_17-54-38.png


upload_2017-7-13_17-55-0.png


upload_2017-7-13_17-55-33.png


You can download the new Tool-set Beta version and my test file from the first page of this thread.

Thanks, Kris
 
Hi all Blender users!

I have uploaded a new Tool-set Beta file to be tested. And I uploaded my Blender test file so that you can use it as a guide how to set up certain function to work correctly in FSX. When I have time I will try to make a new video on how to use the tool-set.

Below are image of my test results.

this is a surface using the platform attribute. And if you do not have settings correctly set for your material in Blender it will not work correctly. Number 1 thing to make sure you set right is the material used as the platform material. FS10 Material settings: Frame Buffer Blend-Source Blend=srcAlpha; Dest Blend=InvSrcAlpha, Material Alpha Test-Z-Test Alpha=True; Alpha Test Level = 120; Test Mode=Greater, Enhanced Parameters-Z-Write Alpha=True; No Shadow=True; Do Not Use Specular Map=True AKA (NoBaseSpecular). If these setting are not correct you will not get shadows showing up in FSX.
View attachment 35971

View attachment 35972

View attachment 35973

View attachment 35974

View attachment 35975

View attachment 35976

You can download the new Tool-set Beta version and my test file from the first page of this thread.

Thanks, Kris
Hi Kris,

Thanks for the updates. I personally thanking you for uploading the test file together with your toolset. I have learned few new info from your blender test file especially on using some settings and mapping with texture settings.

Thank you,
Manochvarma Raman
 
A big big thank you to all the contributors of this awesome tool
For us developers!

I develop landscape only, do not hesitate to solicit me
If you want to test a function :)

I will offer you a very practical function
(For landscape developers)

I hope this will be possible.

Good luck
 
Hi Krispy and Ron,

I continue my tests with the latest version of the tool-set, in real situation on my last project, and everything seems to work perfectly! I even reproduced the realistic glass explained by Bill in this thread, which had been difficult for me with the previous BlenderToFSX versions. This glass precisely uses Z-Test Alpha... and it works!

A huge thank you for this wonderful work! We can soon switch to a non-Beta version ..!
 
Hi Krispy and Ron,

I continue my tests with the latest version of the tool-set, in real situation on my last project, and everything seems to work perfectly! I even reproduced the realistic glass explained by Bill in this thread, which had been difficult for me with the previous BlenderToFSX versions. This glass precisely uses Z-Test Alpha... and it works!

A huge thank you for this wonderful work! We can soon switch to a non-Beta version ..!
Hi Chrismot,
Can you please share the diffuse texture you used for the glass texture?

One more thing, what does the:

Code:
Blinn Opacity: ~6%

in his recipe means?

Thanks,
Manochvarma Raman
 
Hi Manochvarma Raman,

I simply use the texture proposed by Bill HERE ... Then I added a little color, according to my model.
 
Hello,... hopefully this will not confuse,...

The Blinn Opacity is used within Max/GMax and isn't used per se by MCX directly, but the formula is:

If Bill's formula recipe states that the Blinn Opacity value is 6% then the transparency would be 15 (.06 * 256). Color numbers are represented as 0-255 ( 256 integers ), that is where the 256 is coming from. Within MCX, this would be represented within the color slots,... within the Diffuse color: 15, 38, 75, 70. The first number is the transparency and the next 3 numbers is the color.

I found this out in an earlier thread (eons ago, at least it feels that way), with me asking the very same question. Just search for Blinn.
 
Hi Manochvarma Raman,

I simply use the texture proposed by Bill HERE ... Then I added a little color, according to my model.
Thank you Christmot.

Hello,... hopefully this will not confuse,...

The Blinn Opacity is used within Max/GMax and isn't used per se by MCX directly, but the formula is:

If Bill's formula recipe states that the Blinn Opacity value is 6% then the transparency would be 15 (.06 * 256). Color numbers are represented as 0-255 ( 256 integers ), that is where the 256 is coming from. Within MCX, this would be represented within the color slots,... within the Diffuse color: 15, 38, 75, 70. The first number is the transparency and the next 3 numbers is the color.

I found this out in an earlier thread (eons ago, at least it feels that way), with me asking the very same question. Just search for Blinn.

Thank you for the explanation Doug.
 
Hi Kris,

When I load blender at startup, and Blender2FSXP3D with P3D checked, I can not open the TAG Visibility to select. I have to go through FSX checked to be able to select the TAG Visibility ...!

Thanks for checking this issue ...
 
Back
Top