- Messages
- 24
- Country
Hi all, I just wanted to share my technique for creating realistic shadows and AO. This is something I notice that many new developers either struggle with or don't do at all, which is a shame since this can really help make your textures go to the next level.
Intro
First, I want to explain AO, GI/Ray Tracing, and rendering in the context of the sim. If you are familiar with these terms, skip to the example below.
AO or Ambient Occlusion in general is a technique in rendering that adds occlusion (soft shadows) around places where 2 or more faces and their normals of a model are perpendicular and cross each other. See below.
Notice how normals closer to the intersection start to cross each other.
In X-Plane, MSFS, and DCS, AO is calculated through SSAO (Screen Space Ambient Occlusion) which is an efficient technique to approximate a realistic AO effect. Generally, SSAO has done pretty well, however, it is still only an approximation. This means that either an AO effect generated by the sim can be inaccurate, or its quality is reduced. There are other, newer methods such as HBAO and VXAO (Horizon Based Ambient Occlusion and Voxel Accelerated Ambient Occlusion) but these methods are not employed by any flight simulator as of yet.
In general rendering, SSAO is too inaccurate to be used. This is where GI (Global Illumination) and Ray Tracing come in. Ray Tracing works by shooting many "rays" of light out of a camera or viewpoint, and then calculating where each ray will bounce off an object as well as how much light will be dissipated from this bouncing. Much like in real life, photons of light reflect and bounce in many directions from a surface, just like the concept of Ray Tracing. Flight simulators currently do not have Ray Tracing as this method is very taxing on the GPU and CPU to compute, and even though there are many new games that do have Ray Tracing, these games tend to compute at reduced ray amounts compared to traditional rendering. There are other methods employed by renderers like Path Tracing and Photon Mapping, but these are not relevant to Flight Simulator. Global illumination is the overall process in computing indirect bounces of light and shadows, which uses Ray Tracing to do so. You can think of GI as the name of the technique, while RT is how GI is calculated.
So, what does this mean for FS? It means that we can employ a general renderer (such as V-Ray, Corona, Arnold, Eevee, etc) to do all the heavy lifting regarding Ray Tracing, GI and AO, then insert this information into your textures. Many computers today are unable to calculate these effects in real-time without severe performance loss, so calculating them beforehand will improve the quality of your textures without any performance hit.
NOTE: This method is generally more noticeable and effective for interior scenes only. Exterior scenes such as an exterior model of an aircraft, or a building will generally not benefit from this method, as the shadows required to calculate this scene is generally simple enough for your simulator's renderer to handle normally.
Example
In this example, I will be using 3ds Max, V-Ray, Substance Painter, and Photoshop. However, this process can also be done with alternative software, as the overall concept is still the same.
To start, I have a room with two poles and a window and have already UV mapped this model and is now ready for texturing.
In Max, make sure your renderer is set to V-Ray (Or V-Ray GPU if you wish to use the GPU) before rendering this map. Then, go to Rendering > Bake To Texture (For 2021+ only, if you are using Max 2020 or below, use Render To Texture instead).
Select your model and click "More Bake Elements" and under V-Ray, assign the VRayCompleteMap to it. Then, open your material editor, and make sure your object is colored grey. This will help you later on.
You now need to enable GI. This is done differently with different rendering engines, but in V-Ray it is in Render Setup > V-Ray > Environment > GI Environment. Other engines may require the use of a dome light, sky light, ambient light, or an environment map. I also recommend changing your image sampler from Progressive to Bucket if you are using V-Ray. Note that denoising is not available for baking textures as denoising relies on 3D perspectives to achieve.
Click "Bake" to start the baking process. Note that depending on the resolution of your texture, the complexity of your model, your computer's hardware, as well as your render settings, this can take a few minutes or a few hours. If you have a weak computer or you're calculating hundreds of textures, I suggest using a burner computer just for the purposes of rendering and let it render for a couple of days.
Once this map has completed rendering and saved, texture this model as you normally would in Substance, but disable AO baking.
Export your model in the desired format. Then, assign these texture sets to your material in your material editor. This is now what your model should look like WITHOUT the rendered GI/AO map.
Looks pretty flat right?
Next, we'll take a look into adding this map into Prepar3D, X-Plane, and MSFS.
FSX/Prepar3D Standard (NO PBR) / X-Plane PBR (NO AO CHANNEL)
Open your Diffuse/BaseColor map in Photoshop. Then, overlay your completed GI map over it as a separate layer. In the blending mode, switch it from "Normal" to "Multiply". Save your diffuse texture.
MSFS/Prepar3D (PBR)
Each simulator has it's own AO channel within their material.
For Prepar3D PBR, AO maps are stored within the Metallic map's GREEN channel.
For MSFS PBR, AO maps are stored within the COMP map's RED channel.
Open your Metallic/COMP map into photoshop, and then add your AO map as a separate layer. On the bottom right, click the fx button, and choose Blending Options.
Under "Advanced Blending", hide either the G and B channel or the R and B channel depending on what simulator you are targeting.
Save this map.
For P3D PBR specifically, I also recommend adding this map into your Diffuse texture. But it may or may not look correct, so this is up for experimentation.
That's it! You now have realistic shadows and AO baked into your textures. Take a look at this comparison.
Conclusion
This is a long process (especially the rendering part) but it is well worth it. It can really help make your interiors look so much more realistic with just (a few) clicks of a button. If you have any questions, ask them below.
Intro
First, I want to explain AO, GI/Ray Tracing, and rendering in the context of the sim. If you are familiar with these terms, skip to the example below.
AO or Ambient Occlusion in general is a technique in rendering that adds occlusion (soft shadows) around places where 2 or more faces and their normals of a model are perpendicular and cross each other. See below.
Notice how normals closer to the intersection start to cross each other.
In X-Plane, MSFS, and DCS, AO is calculated through SSAO (Screen Space Ambient Occlusion) which is an efficient technique to approximate a realistic AO effect. Generally, SSAO has done pretty well, however, it is still only an approximation. This means that either an AO effect generated by the sim can be inaccurate, or its quality is reduced. There are other, newer methods such as HBAO and VXAO (Horizon Based Ambient Occlusion and Voxel Accelerated Ambient Occlusion) but these methods are not employed by any flight simulator as of yet.
In general rendering, SSAO is too inaccurate to be used. This is where GI (Global Illumination) and Ray Tracing come in. Ray Tracing works by shooting many "rays" of light out of a camera or viewpoint, and then calculating where each ray will bounce off an object as well as how much light will be dissipated from this bouncing. Much like in real life, photons of light reflect and bounce in many directions from a surface, just like the concept of Ray Tracing. Flight simulators currently do not have Ray Tracing as this method is very taxing on the GPU and CPU to compute, and even though there are many new games that do have Ray Tracing, these games tend to compute at reduced ray amounts compared to traditional rendering. There are other methods employed by renderers like Path Tracing and Photon Mapping, but these are not relevant to Flight Simulator. Global illumination is the overall process in computing indirect bounces of light and shadows, which uses Ray Tracing to do so. You can think of GI as the name of the technique, while RT is how GI is calculated.
So, what does this mean for FS? It means that we can employ a general renderer (such as V-Ray, Corona, Arnold, Eevee, etc) to do all the heavy lifting regarding Ray Tracing, GI and AO, then insert this information into your textures. Many computers today are unable to calculate these effects in real-time without severe performance loss, so calculating them beforehand will improve the quality of your textures without any performance hit.
NOTE: This method is generally more noticeable and effective for interior scenes only. Exterior scenes such as an exterior model of an aircraft, or a building will generally not benefit from this method, as the shadows required to calculate this scene is generally simple enough for your simulator's renderer to handle normally.
Example
In this example, I will be using 3ds Max, V-Ray, Substance Painter, and Photoshop. However, this process can also be done with alternative software, as the overall concept is still the same.
To start, I have a room with two poles and a window and have already UV mapped this model and is now ready for texturing.
In Max, make sure your renderer is set to V-Ray (Or V-Ray GPU if you wish to use the GPU) before rendering this map. Then, go to Rendering > Bake To Texture (For 2021+ only, if you are using Max 2020 or below, use Render To Texture instead).
Select your model and click "More Bake Elements" and under V-Ray, assign the VRayCompleteMap to it. Then, open your material editor, and make sure your object is colored grey. This will help you later on.
You now need to enable GI. This is done differently with different rendering engines, but in V-Ray it is in Render Setup > V-Ray > Environment > GI Environment. Other engines may require the use of a dome light, sky light, ambient light, or an environment map. I also recommend changing your image sampler from Progressive to Bucket if you are using V-Ray. Note that denoising is not available for baking textures as denoising relies on 3D perspectives to achieve.
Click "Bake" to start the baking process. Note that depending on the resolution of your texture, the complexity of your model, your computer's hardware, as well as your render settings, this can take a few minutes or a few hours. If you have a weak computer or you're calculating hundreds of textures, I suggest using a burner computer just for the purposes of rendering and let it render for a couple of days.
Once this map has completed rendering and saved, texture this model as you normally would in Substance, but disable AO baking.
Export your model in the desired format. Then, assign these texture sets to your material in your material editor. This is now what your model should look like WITHOUT the rendered GI/AO map.
Looks pretty flat right?
Next, we'll take a look into adding this map into Prepar3D, X-Plane, and MSFS.
FSX/Prepar3D Standard (NO PBR) / X-Plane PBR (NO AO CHANNEL)
Open your Diffuse/BaseColor map in Photoshop. Then, overlay your completed GI map over it as a separate layer. In the blending mode, switch it from "Normal" to "Multiply". Save your diffuse texture.
MSFS/Prepar3D (PBR)
Each simulator has it's own AO channel within their material.
For Prepar3D PBR, AO maps are stored within the Metallic map's GREEN channel.
For MSFS PBR, AO maps are stored within the COMP map's RED channel.
Open your Metallic/COMP map into photoshop, and then add your AO map as a separate layer. On the bottom right, click the fx button, and choose Blending Options.
Under "Advanced Blending", hide either the G and B channel or the R and B channel depending on what simulator you are targeting.
Save this map.
For P3D PBR specifically, I also recommend adding this map into your Diffuse texture. But it may or may not look correct, so this is up for experimentation.
That's it! You now have realistic shadows and AO baked into your textures. Take a look at this comparison.
Conclusion
This is a long process (especially the rendering part) but it is well worth it. It can really help make your interiors look so much more realistic with just (a few) clicks of a button. If you have any questions, ask them below.
Last edited: