X-Plane 11’s Physically Based Rendering (PBR) uses a new material model for solid textured objects and meshes.

Physical Simulation

The X-Plane lighting and material model divide the light interaction with materials into two categories:

  • Specular reflection – this is light that bounces directly off the surface of a material. Speuclar reflection is responsible for mirror-like reflections, glossy appearances on materials and any white “sun spot”.
  • Diffuse reflection – this is light that makes it past the surface of the material and is partly absorbed. Diffuse reflection is significantly less directional and may be strongly tinted.  Diffuse reflection gives materials a “matte” look.

X-Plane 11 conserves energy between diffuse and specular reflection – having a stronger specular reflection reduces the amount of diffuse reflection automatically; in this way highly glossy and reflective materials don’t appear to be overly bright compared to matte materials.

Comparison to X-Plane 10: in X-Plane 10, specularity could be added without reducing diffuse reflectance; this meant that most reflective materials were brighter than non-reflective ones. An artist could choose to manually darken the albedo of a texture to compensate.

The microsurface of a material is considered to be rough or glossy (or some measure in between); roughness and glossiness are measures of how smooth the surface is, not how reflective it is. A surface can be highly reflective and highly rough at the same time.

Roughness serves to spread out specular reflections; a mirror image in a rough surface appears blurry, as each ray of incoming light bounces in several directions.

X-Plane 11 conserves energy as roughness is adjusted; the same amount of energy is reflected in a rough or glossy surface. The difference is that a glossy surface has a highly focused reflection; a light source’s specular reflection will go in one direction on a glossy surface, resulting in a specular highlight that is very bright but small.

By comparison, a rough surface diffuses the specular energy in all directions; the specular reflection is visible over a wide range of angles but is not very strong.

Comparison to X-Plane 10: in X-Plane 10, all surfaces are glossy and only the overall specular reflectance could be changed. Therefore it was impossible in X-Plane 10 to model a surface like asphalt, which is simultaneously very reflective and very rough. An artist could attempt to simulate this by creating a high frequency noise pattern of highly reflective and non-reflective pixels to manually “break up” the reflection, but when zoomed out this effect is incorrect.

Surfaces become more reflective when viewed at glancing angles; this is called the Fresnel effect. X-Plane 11’s rendering engine simulates this automatically. The specular reflectance of a material that is specified by the artist is its minimum reflectance, when the material is viewed directly (e.g. the camera is orthogonal to the surface).

X-Plane 11 automatically decreases diffuse light as the effective reflectivity increases. This avoids materials appearing too bright at glancing angles.

(This is probably a bug – the incoming light is not more glancing based on view angle! The actual effect of fresnel is more complicated because it is affected by the integral of all incoming light.)

Comparison to X-Plane 10: X-Plane 10 does not provide camera-angle-based variable reflectivity; as a result, materials often have to be made too reflective at all angles to make glancing angles look adequately reflective.

Material Properties

The major properties of a material are controlled by two channels of the normal map of a model:

  • Roughness is stored in the alpha channel of the object, with 1.0 (maximum opacity) being the most glossy surface, and 0.0 (the most transparent) being the roughest surface.
  • Base reflectance (how much light is reflected off of the surface at an orthogonal angle) is optionally stored in the blue channel; no blue means no base reflectance and maximum blue means a completely reflective material at all viewing angles.

This scheme is opt-in; objects use the NORMAL_METALNESS directive to indicate that the blue channel is suitable for base reflectance. (Since legacy models typically have strong blue values from tangent space normal maps, the blue channel must be ignored in legacy models.)

If metalness is not used, a base reflectance of 0.04 is assigned to the entire material; this is a good approximation for most dielectrics (plastic, wood, concrete, etc.) and also a reasonable backward-compatible value for X-Plane 10 content. The roughness channel is intentionally encoded to have the highest gloss value in X-Plane 11 match the most reflective material in X-Plane 10. (Since X-Plane 10 specular reflections were all highly glossy, this means that at least plastics and matte materials “just work” in X-Plane 11.)

X-Plane 11’s treatment of the albedo color (day texture) changes as base reflectance increases:

  • The albedo is used to tint specular reflections. While this is not strictly physically correct, it provides an affordable way to create tinted metallic reflections.
  • Because base reflection is increasing, the diffuse color becomes darker due to energy conservation.

Glass Effects vs Decals

The alpha channel of the albedo (day texture) is used to create translucent rendering, e.g. the mesh being drawn is blended with the mesh behind it to create a mixture of both colors. There are two physical interpretations of this alpha effect:

  • The top mesh is “translucent”, e.g. like tinted glass; the color taken from behind the mesh represents light transferred through the top mesh (translucency).
  • The top mesh does not always exist in the alpha-clear parts of the texture, e.g. like the holes in a fence. The top texture acts like a ‘decal’ over what is behind it. In this situation, partial alpha represents a blend of both materials as if there is a pattern of holes in the top mesh so small that both the presence and absence of the material happen in a single pixel. (Think of zooming out with a chain-link fence – the result is translucency.)

In practice, authors use one effect (alpha blending) for both physical cases (translucency and decals). The meaning of alpha matters for physical correctness.

When alpha means ‘decal’, clear alpha removes all lighting effects from the mesh. This is the correct simulation of the mesh not existing.

When alpha means ‘glass’, clear alpha removes the diffuse but not specular component of lighting effects from the mesh. This is the correct simulation of light passing through the boundary layer from ‘stuff behind the mesh’, rather than being absorbed.

X-Plane 11’s default interpretation is the ‘decal’ interpretation, which:

  • Matches X-Plane 10.
  • Is HDR/deferred rendering compatible.
  • Preserves decal behavior on surfaces like runway pavement.

Authors have the option in X-Plane 11 to use glass alpha as long as:

  1. The object is attached to an aircraft and
  2. The aircraft’s lighting mode is marked as “glass”.

In this situation, authors can put the BLEND_GLASS directive into an object header; this will cause alpha to make the diffuse channel translucent while keeping specular effects, for reflections on clear glass.

24 comments on “X-Plane 11 Material Model

  1. I’m not an expert designer/programmer, so I need to see an example of an object with these atributes. I added NORMAL_METALNESS and the texture with blue channels, but nothing happened. Does it go below the TEXTURE and TEXTRE_LIT lines (and then the texture)? Or is it after the ATTR…etc. Help, please. Sorry for being ignorant.

    ax

      1. I’m sorry, I didn’t see this reply until now. I’m using Blender to export the obj, but I’m editing the obj in text (using NotePad++).
        So it would be something like:
        A
        850

        DRAPED_POLYGON

        NORMAL_METALNESS Apron_1_NM.png
        TEXTURE Apron_1.png
        LAYER_GROUP taxiways +1

        SURFACE asphalt
        SCALE 35 35
        MIRROR

        DECAL_LIB lib/g10/decals/apt_asphalt.dcl

        1. NORMAL_METALNESS doesn’t have a parameter – it doesn’t have have anything afterwards like a file path. I’m surprised that the log doesn’t have a relevant message about that. It it doesn’t or it wasn’t helpful I suggest filing a bug saying what you thought it meant and what you think might communicate it better.

        2. The NORMAL_METALNESS should just be used to tell X-Plane it uses the new PBR functionality. Your file should look like this instead.

          A
          850

          DRAPED_POLYGON

          TEXTURE Apron_1.png
          TEXTURE_NORMAL Apron_1_NM.png
          NORMAL_METALNESS
          GLOBAL_specular 1
          LAYER_GROUP taxiways +1

          SURFACE asphalt
          SCALE 35 35
          MIRROR

          DECAL_LIB lib/g10/decals/apt_asphalt.dcl

  2. In the text above it states

    “Roughness is stored in the alpha channel of the object”

    what alpha channel? I have exported out of substance painter with glossiness channel in the alpha of the normal map but I have to save as a .tiff (for example) to keep the alpha channel?? my understanding is .PNG cant be saved with an alpha channel? How can a PGN have an alpha channel?

    thanks

    1. I’m not sure how Surface Painter works, but .png can definitely have an alpha channel. You might want to look again to see what Substance Painter is doing.

      1. Hi Ted,

        thanks for replying

        Take substance Painter out of the equation, lets say then I have a normal map saved as a .psd in photoshop which has R,G,B and alpha channels. The R and G channels are the X and Y for the normal, the Blue is metalness and the Alpha is Glossiness (roughness) and I save it as a PNG. If I reopen the PNG in photoshop it only has the R,G,B channels and the alpha is lost. I cant seem to save it with an alpha channel, I can save it with transparency if I save for web or export the PNG.

        is it a case of or should I assume that Photoshop is saving the Alpha out and it is when I reopen it in photoshop to view it, is when the Alpha channel is lost???

        At the moment i am using .dds

        thanks for your time.

      2. Hi

        Interestingly, Photoshop (the 2015 version I use) indeed does loose the alpha when I reopen it. I saved the file from photoshop then downloaded and opened the file in Gimp, where the alpha channel is present. if I open the same file in photoshop no alpha channel is present.

        live and learn! paid for program, free program…go figure!

        1. Just to double check, when opening a png in photoshop, do

          Layer -> Layer from transparency

          Should generate an alpha channel if it isn’t explicitly shown in the channels box.

    2. An alpha channel is usually a grayscale channel like RGB with 256 bits of information. What X-Plane and the .png format uses (as I understand it) is called opacity instead. Opacity is a 0 to 100 instead of 0 to 255. This means a little less detail in the opacity layer but also a lower file size.

  3. I want to know how to set two-sided model in .obj format. My obj model is all single-sided, which makes some models look strange. I make it through 3dsmax, but I found this problem finally. Can I modify it in the code of .obj model? My friend built it through SketchUp, but he didn’t encounter this problem.I found the two-sided problem in the file of obj format, but it didn’t seem to tell me how to set it, just told me that the default is single-sided

      1. Ben – Is the thinking that the viewpoint will never be inside of a totally closed object, since there will always be doors and windows on an aircraft?

        1. Partly it’s that you won’t be inside, so it’s better to cull the inside than draw it. But also it’s rare that in the real world the things you go inside look the same from the inside and outside. The exception is e.g. a wood fence modeled as a vertical quad in autogen – there we’re doubling the geometry just because geometry is cheap and shader changes are expensive. But e..g if you go into an aircraft ,the inside looks different from the outside, so for most cases, you want to double the geometry, reverse its side, and then retexture it.

          1. Ben –

            I’m creating a model of a Grumman G-159 (a.k.a. G-1) using Autodesk Fusion 360. I’m a ME/Product Designer who’s been using professional CAD software for 3 decades and prefer the accuracy and precision of CAD/CAM over apps like Blender and Maya. I’ve had excellent results exporting the Fusion models as .fbx files and importing them into Blender. The import/export process is good enough that some of the materials and appearances I applied in Fusion make it into the Blender file and show up correctly on the imported model. Getting those out of Blender and into xPLane has proven to be a challenge.

            My ultimate goal is to create a full 3D version of the G-1 and I thought I’d start with the 2D version I’ve already done. As a relative NOOB, my workflow may be misguided. Are there any articles from Laminar describing the process of converting a 2D aircraft to 3D?

            I was hoping there might be a way to utilize existing resources in PlaneMaker, but at this point I’ve had mixed results. I was able to borrow some instrument .obj files from the Laminar C-172, place them into the objects folder and nudge them into position using their global co-ordinates using PlaneMaker, but I need turbine RPM gauges and TIT gauges. (Rolls Royce Dart engines) The complexity of the Blender and xPLane2Blender UI’s is a bit daunting also.

  4. Above it says “The aircraft’s lighting mode is marked as glass.” Should that be “The object’s lighting mode is set to Glass in PlaneMaker.” ?

  5. Hello. I am a bit confused with the opacity.

    BLEND_GLASS only applies for aircraft objects. But, what happens with scenery objects. IE. I have a hangar with windows that I want to show the interior of the hangar. I have already modeled the interior with “double walls” to avoid the back culling, but still when I see through the window glass, I don´t see the inside wall but full transparency, as if there was no wall. Funny thing is that I can see the airplane inside the hangar through the window properly, but not the inside wall.

    When I look through the open hangar door, everything looks fine, showing the interior of the hangar as it should.

    So, what ATTR I should use in this case?

    Thanks!

    1. First: BLEND_GLASS wouldn’t address this issue – the issue you see is the depth buffer occluding geometry behind the windows. BLEND_GLASS does not fix this.

      There is no general way to fix this in X-Plane but there are some work-arounds:
      1. Within the OBJ, make sure the glass mesh is last in the OBJ, as they are drawn in order. If you have interior and exterior windows (each one-sided), have the exterior be last.
      2. If you have lots of scenery and only a small number of translucent objects, put the objects into layer groups OBJECTS +1 to ensure they are drawn after the rest.
      What we don’t have is a generalized distance sort of those objects against each other, so e.g. there’s no way to make a series of glass phone booths as separate objects with correct Z order. But the above two steps can fix a lot of problems.

  6. Thanks for the reply Ben.

    Now seems more clear. For the layer groups is fine and pretty straight forward. I tried it and it is working. Thank you for this tip.

    For finding in the .obj file the vertex groups for the face with the transparency is a bit more complicated, unless I am missing something on how to find or group those vertices and move them to the end.

    Cheers!

    By the way Xplane 11.5 rocks!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Please do not report bugs in the blog comments.
Only bugs reported via the X-Plane Bug Reporter are tracked.

Meta

Topic:

  • Aircraft Development

Article type:

  • Reference