• 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:SE Z-sorting 2 objects that contain material with alpha transparency

Messages
927
Country
ca-ontario
I am having one heck of a time finding a material setting that would properly display one object in front of another. Object A is a 3D representations of rocket flames and it is in front of object B (tower structure with staircases).
(Objects A1 and A2 are the same instances of object A, I just use them for testing various settings)

AlphaSorting.jpg


Both objects (A and B) contain materials that have transparencies in their alpha channel. And here is a catch:

The object A has gradated transparency, so, "soft edges", not just a "hole" with hard edges.

When NOT using a 3DS MAX material setting "Z-write Alpha", object A renders perfectly against all scenery elements (sky, clouds, terrain, other 3D objects without alpha transparency), but as soon as it is placed in front of Object B (a 3D tower structure with elements containing transparency), it is sorted and rendered behind it.

When using a 3DS MAX material setting Z-write Alpha", object A sorts properly (as in the above screenshot), however, I cannot get the soft edge alpha to show up properly. The material settings that I tweaked are in the "Material Alpha Test" section of the 3DS MAX's FSX Material rollout.

So, is there a way to properly display "soft edge" transparency in front of another object with transparency?
 
I'm no expert in alpha sorting, but the only thing I can think of would be to try adjusting the material's Z-bias setting...set it to -0.1 or -0.2 and see what happens.
 
I'm no expert in alpha sorting, but the only thing I can think of would be to try adjusting the material's Z-bias setting...set it to -0.1 or -0.2 and see what happens.
Thanks for the suggestion!

Z-bias - which parameter is that in MAX FSX Material rollout? "Alpha Test Level" or "Final Alpha Multiply"?

Also, are you suggesting negative values? The sliders on the rollout don't allow for negative values...
 
Hi Misho:

FSX MDLs normally do not have the option of a Z-Bias attribute, but MCX can apparently impart one:

MCX > Options > Exporter Settings > XWriter > ZBias Offset > (value)




AFAIK, pre-FSX and P3D v2.x et seq. 3D models have the option for a Z-Bias attribute (L-M calls it a "functionality").




And of course, as you may already know, the 3D model Z-Bias attribute is distinct from the one used with BGLComp placement.



Hope this helps. :)

GaryGB
 
Last edited:
Thanks Gary!

So - I located the MCX Z-Bias option, it is in Materials dialog, near the bottom. The problem is, as I am working with FSX:SE, when I export MDL as FSX format, the option is not written... and I don't have P3D4.x, and no exporter that goes along with it...

EDIT: I noticed you updated your answer - I accordingly adjusted. Writing into X file and then manually converting using XtoMDL, I noticed that now the x file does have z-bias entries, but it is not writing the value I set, keeps writing zero. My MCX is 1.4.0.0 DEV 7/2/2019

I suppose I could manually search and replace...
 
Last edited:
Hi again:

Perhaps a few additional links might shed some light on this:


https://en.wikipedia.org/wiki/Z-buffering

https://en.wikipedia.org/wiki/Z-fighting


https://www.fsdeveloper.com/forum/threads/z-bias-in-fsx-model.436392/

https://www.fsdeveloper.com/forum/threads/zbias-for-fs9-models.184752/

https://www.fsdeveloper.com/forum/threads/flickering-polygons.429056/

https://www.fsdeveloper.com/forum/threads/vc-gauge-polygons-out-of-place.446459/

https://www.simforums.com/forums/shadow-removal_topic45214.html

https://www.fsdeveloper.com/forum/threads/fsx-material-with-zbias_.8069/



http://www.prepar3d.com/SDK/Environment Kit/Modeling SDK/new aircraft procedures.html#Gauges

NOTE: This latter info is also found in the original Microsoft online documentation for ESP (which became P3D v1.4x):

https://docs.microsoft.com/en-us/pr...(v=msdn.10)#note-z-fighting-in-gauge-textures


Note: Z-Fighting in Gauge Textures

It is possible that some of the gauge texture sheets will encounter Z-buffer fighting issues. This issue can be addressed with additional settings. If you are experiencing Z fighting issues with gauge texture sheets, try applying the following change in the material and re-export.

  1. Select the Set Default Opaque button in the Framebuffer Blend dialog.
  2. Check the Z-Test Alpha box in the Material Alpha Test dialog.
  3. Set the Alpha Test Level slider greater than 128.
  4. Select Greater in the Alpha Test Mode drop-down dialog.

cc526974.alpha_blend%28en-us%2cmsdn.10%29.jpg
PS: Here's some old info from the early days of FSX post RTM:





ACES' Adrian Woods (aka "Torgo3000") explanation of Z-sorting transparent objects for FSX:



Settings used for forcing transparency Z-sorting with *.X-file edits:

http://www.aerodynamika.com/cgi-bin/yabb2/YaBB.pl?num=1223381932


...and Dicks' test results / worked examples:

https://www.fsdeveloper.com/forum/threads/fsx-z-sorting-between-objects.3695/post-23294

https://onedrive.live.com/?id=F3950C5BBD2BCFA1!395&cid=F3950C5BBD2BCFA1

See: My_Z_Alpha.zip

https://pqxalw.ch.files.1drv.com/y4...Csxg27Jh8kBF0U/My_Z_Alpha.zip?download&psid=1


Semi Transparent Box.zip



Transparency.zip


[EDITED]

PS
: The latter examples above correlate with the example objects in Arno's wiki:

Drawing order problems with transparent textures

https://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures

[END_EDIT]


Hope this helps a bit more. :)

GaryGB
 
Last edited:
Ah, I didn't realize at the time of writing that the FSX SDK didn't have that material option yet. It's been so long since I've worked with the FSX tools that apparently I forgot it didn't exist back then. o_O Looking back, it seems that LM introduced that feature in order to solve Z-fighting in terrain textures with DX11. @GaryGB, your solution seems to be the FSX equivalent of achieving the same result, and @Misho should be able to tweak the sliders and parameters from there if it doesn't solve his problem right away.
 
Thanks @ozzman1997, @GaryGB!

I've been looking at this for what seems an eternity, and I'm no closer to the solution. I did make a bit of a headway, though... turns out that I had the material settings correct, and the object displays fine IF I look at it from above (object being below the camera viewpoint)...

If I look at the object from below (object being elevated and camera on ground), the sorting issue manifests itself... so, yeah, quite annoying... :rolleyes:
 
Back
Top