• 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 glass problems

Messages
10
Country
slovakia
Hi! I have a problem where glass that is further away is overdrawing the one closer to the camera. Unfortunately, using different draw orders is not possible here, because the glasses can be viewed from both sides. I also tried different glass occluding situations and it's behaving super weirdly.

I'm doing all the work in blender.

Screenshot 2020-11-30 210835.jpg
Screenshot 2020-11-30 210820.jpg
unknown.png


So today I tested it with some simpler non-textured glass materials and here are the observations:


unknown2.png


And when I move the camera slightly it starts to look like this:

unknown3.png


I absolutely don't understand why.

Is there anything I'm doing fundamentally wrong? Do you have any tips for me? Thank you! :)
 
Messages
10
Country
slovakia
Trying to make some magic using multiple planes with opposite normals and draw orders, unfortunately the only two results are these:

The rear one overdrawing the front one.
1606854797413.png



The front one completely overdrawing the rear one (instead of drawing on top of it)
1606854822528.png


Is something like I'm trying to accomplish even possible?
 
Messages
1,058
Country
australia
What are your material settings and setup?

Here's a quick model I just made which seems to be working for me (excuse the very rough textures).

The glass texture is a PNG with transparency. The texture settings are MSFS standard material with Alpha mode in the Render Parameters set to Blend. Double sided material is off, the interior and exterior windows are separate faces. In the Settings tab the Blend Mode is also set to Alpha Blend and Backface Culling is ticked.
Image1.jpg
 
Messages
10
Country
slovakia
Thanks for the reply! I too use a png with an alpha channel. I tried to use the standard MSFS material instead of the glass. It looks better for sure, but still the lines in the back are overdrawing the front ones, which I believe might be the case in your screenshot as well, it's just hard to spot.

1606946911655.png


Notice the shadowed lines in the back overdrawing the front glass. Regarding the faces, I have the same setup as you.

The bad thing is that you lose that beautiful glass effect of reflecting the environment which comes with the glass material.

MSFS glass material (transparent, yet reflective - just like glass should be):

1606947289022.png


MSFS standard with high metallic and low roughness values, with alpha mode set to opaque (looks like a mirror, just as it should):

1606947393427.png


And this is the same material (high metalness, low roughness) but with alpha mode set to blend. Unfortunately, all the reflections are gone. That's why using the standard MSFS material is not the way to go I believe.

1606947511500.png
 
Messages
10
Country
slovakia
I tried simplifying it and testing it without any texture at all. However, the same still occurs, the closer glass is getting overdrawn by the one further away - Even if I don't use any texture, just vanilla material with some settings. What I tried right now, is using two materials, each with different draw order:

1. This camera facing face has a material with a low draw order.
2. This camera facing face has a separate material with a higher draw order.

1606948064420.png


This finally renders correctly. I should be able to do the same to the opposite side looking faces to make it work. However, it's super cumbersome.

@Anthony31 What happens if you try to use the MSFS glass material instead of the MSFS standard? Can you please post some screenshots of that? Thank you! :)
 
Messages
1,058
Country
australia
I think draw order is the way to go. My early model fell apart when I looked at it from the other side. I've been doing some testing myself and I could only get consistent drawing in the correct order with the draw order parameter.

For a simple walkway you only need to make the outside glass have a higher draw order than the inside. But if you start lining walkways up side by side it all falls apart as you will have outside glass being drawn over outside glass again. If you have a series of walkways it may be necessary to have separate draw orders for each walkway which really will get cumbersome.

I had earlier discounted MSFS Glass because it puts a reflection of a generic cockpit on it by default. Which is stupid for scenery. You need to turn Reflection Mask Factor down to zero to get rid of the cockpit reflections.

I also had a hard time figuring out exactly how Glass likes to be setup. In the end Albedo colour close to white and near maximum (or maximum) transparency seems to be the right mix otherwise it all appears rather opaque.
 
Messages
57
Country
china
I have the same problem earlier when I was trying to model my terminal. The glass looked better for me after the recent MSFS update. I guess it's just some render glitch?
 
Messages
10
Country
slovakia
Unfortunately, the draw order trick doesn't work with all glass objects - which you can view from all sides.

1607707572437.png
 
Messages
1,058
Country
australia
So I've had to deal with the glass problem myself now. The attached picture shows the issue. A curved windshield.

The initial plan was to have the exterior surface of the windshield set to MSFS_Windshield and double sided so you can see rain drops from both sides. The interior surface would be set to MSFS_Glass to get nice reflections of the interior. Having both materials visible inside the cockpit would provide some depth to the windshield (you can see the inside and outside surfaces of glass).

I am fairly convinced that using double sided material is a big problem for curved surfaces like this as it caused no end of graphics glitches where the back surface was drawing in front of the front surface.

In the end, after much tinkering, I came up with this solution. The exterior surface points outwards and is single sided only and set the MSFS_Windshield. This surface was then duplicated and the normals flipped so they point inwards. This allows the rain drops to be seen from the inside. Finally, the inside surface of the windshield is set the MSFS_Glass to provide the reflections of the cockpit interior.

No double sided materials were used.

As a final step I named the parts in an order that puts the exterior surface pointing inwards first (Cockpit_window03), interior surface second (Cockpit_window04) and exterior surface pointing outwards last (Cockpit_window05). I have no idea if putting parts in alphabetical order affects the draw order but I did it anyway. Note that the 3 textures used for the windshield all have Draw order 0.

As far as I can tell this seems to work for my aircraft.

Final point, If using the Blender exporter check to make sure that your export options have Include - Custom Properties ticked to make sure it exports the MSFS materials code. At some point I had this unticked and I'm not sure what effect that had.

Very final point. I'm not sure if this will be the final format I use. While the cockpit reflections of the glass material are nice I am finding the material itself somewhat difficult to work with as it creates a very dark texture plus there are numerous artifacts in the reflections that aren't pretty. Changing the direction of the eyepoint also tends to affect the reflections. Something for me to worry about in the future.

Drifter_Glass.jpg
 
Messages
1,058
Country
australia
Hi,

Concernning rain effects, I think I read on discord that it was necessary to use a cube with MSFS Environment Occluder material to display the rain?
Have you had any information about this type of material and do you experiment it?

Ref: https://discord.com/channels/766957329232166933/766957481275424768
unknown-1.png

On the screen, the cube seems to be IN the VC ...
Just selecting Windshield material and mapping it as recommended in the SDK works. Look at Aircraft Texture Mapping in the SDK. It shows the direction you need to map the windshield texture to get the rain to flow in the right direction.

I don't even know what this means:

EnvironmentOccluder​


This material will be used to hide environmental meshes that eventaully compenetrate with a mesh with this material assigned.
 

Lagaffe

Resource contributor
Messages
865
Country
france
This information was present on the discord of NewkTV and it is associated to Discus development (follow my link).
 

Lagaffe

Resource contributor
Messages
865
Country
france
Ok, I better understand in this acception and after that it seems logical. ;)
 
Messages
1,058
Country
australia
I always add a EO-cube to my objects
otherwise it rains inside :)
Thanks, I see what you mean now. My aircraft has an open cockpit so I guess I never noticed the rain being inside the cockpit because that's where the rain should be in an open cockpit plane. Just looking at my plane now in the rain I can see rain drops falling between the windscreen and eyepoint so it would seem like you would need to make an Environment Occluder object to keep it out of your cockpit if it was enclosed.

I took some screenshots but they didn't really come out well so there's no point in posting them.

I don't think the Environment Occluder and the Windshield materials would affect each other. The Environment Occluder should affect the moving rain drops (more like dashes) and the splashes on the ground. The Windshield material would still draw as that is a different type of effect. For example the moving rain drops do not actually hit the windshield and have a rain drop form at that location. One thing I need to do is remap my windshield as the rain drops are too small. If I reduce the area in the UV map I expect it to make the rain drops a bit larger.

To sum up and answer Lagaffe's question, the rain appears without the Environment Occluded. It seems like you will need to create an Environment Occluder object to prevent rain drops appearing inside the cockpit.
 
Messages
123
Country
italy
right 👍
I add that this EO prevents all atmospheric conditions, not just the rain.
even the fog, the humidity and the others.
I have not checked the wind but logically I would say yes, the wind too
;)
 

Christian Bahr

Resource contributor
Messages
951
Country
germany
I add that this EO prevents all atmospheric conditions, not just the rain.
even the fog, the humidity and the others.
I have not checked the wind but logically I would say yes, the wind too
Environment Occluder Material also works great in grass and snowfall:

msfs_sdk_environment_occluder.jpg

This may open up some new possibilities. Here you get the best tips! 👍👍👍
 
Messages
10,088
Country
us-arizona
As a final step I named the parts in an order that puts the exterior surface pointing inwards first (Cockpit_window03), interior surface second (Cockpit_window04) and exterior surface pointing outwards last (Cockpit_window05). I have no idea if putting parts in alphabetical order affects the draw order but I did it anyway. Note that the 3 textures used for the windshield all have Draw order 0.


View attachment 66173

Genius! Very nice work, by the way.

Where is the adjustment for Draw Order located in Blender?
 
Messages
1,058
Country
australia
Genius! Very nice work, by the way.

Where is the adjustment for Draw Order located in Blender?
Draw Order is somewhere in the MSFS materials section that the MSFS2Blender plugin adds so it's not a Blender parameter, it's an MSFS parameter. I'm not at the PC at the moment but I think it only shows up for some material types (such as glass and windscreen) and not for others.
 
Top