- Messages
- 1,025
- Country

Here's a little information some developers might be interested in. This is information I've been holding on to since 2009 and special thanks to Paul Roussin for this information.
Using Paul's techniques you can view FS objects in wireframe mode.
BEWARE: THIS AFFECTS YOUR SHADERS FOLDER AND TO RESTORE YOU'D NEED TO RE-BUILD YOUR SHADERS DIRECTORY BY DELETING THE FOLDERS IN THE FOLLOWING DIRECTORY:
C:\Users\yourusername\AppData\Local\Microsoft\FSX
---------------------------------------------------------------
Here is a modified technique to display the airplane in wireframe.
Look in your general.fx file.
Mine is here:
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\General\General.fx
Find this technique near the end of the file. Look from the bottom up.
Add the code in green and this will wireframe the airplane.
The selection is done by #if defined(PS_USES_FRESNEL)
You can look through the file and test other selections.
Note once you set a mode it sticks! So the #else was needed to restore the fill mode of the triangles to solid. Without that most of the scene is wireframe. FSX does not clear the scene each frame so without the solid painting the wireframes will smear all over and make a mess.
If you wish to wirefram just the terrain, then add fillmode = wireframe; to the terrain file. That sticks so you have to set the mode back to solid using fillmode = Solid; in the next thecnique that is used. FSX does not restore the prior state after using a technique so yo have to do it your self.
technique T0
<
int Performance = EffectPerfLevel_MaxShader20;
>
{
pass P0
{
#include <DefaultStates.fxh>
#ifndef SHD_BLOOM
FogColor = 0;
#endif
VertexShader = compile vs_3_0 VS(); //NULL;//
PixelShader = compile ps_3_0 PS();
AlphaBlendEnable = (State_AlphaBlendEnable);
SrcBlend = (State_SrcBlend);
DestBlend = (State_DstBlend);//begin wireframe
#if defined(PS_USES_FRESNEL)
FillMode = WIREFRAME;
cullmode = ccw;
#else
FillMode = Solid;
#endif
//end wireframe
}
#ifdef SHD_SHADOWMAP
pass ShadowMap
{
#include <DefaultStates.fxh>
VertexShader = compile vs_2_0 VS_ShadowMap();
PixelShader = compile ps_2_0 PS_ShadowMap();
AlphaBlendEnable = (State_ShadowAlphaBlendEnable);
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
}
#endif
}
This is the result:
You can also play with other files.
For clouds look here: C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\misc\SwarmCloud.fx
Terrain: C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\Terrain\Terrain20.fx
Remember to return the fillmode to solid or many parts of the scene will not clear for a fresh repaint. Old stuff will stay in the scene.
Say you want the terrain in wireframe mode and solid otherwise.
Add the green FillMode = WIREFRAME; line to the T0 technique in the Terrain20.fx file as shown below.
Be sure to add FillMode = Solid; to the other files to restore the drawing state!!!
I added it to the General.fx as it is called frequently.
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\Terrain\Terrain20.fxtechnique T0
<
>
{
pass p0
{
#include<DefaultStates.fxh>
#ifdef
SHD_BLOOM
FogColor = 0;
#endif
FillMode = WIREFRAME;
cullmode = ccw;
VertexShader = compile vs_2_0 Terrain20VS();
PixelShader = compile ps_2_0 Terrain20PS();
ColorWriteEnable = Red | Green | Blue | Alpha;
}
}
Here is the result (note the airplane modification was removed from the general file).
Paul
Using Paul's techniques you can view FS objects in wireframe mode.
BEWARE: THIS AFFECTS YOUR SHADERS FOLDER AND TO RESTORE YOU'D NEED TO RE-BUILD YOUR SHADERS DIRECTORY BY DELETING THE FOLDERS IN THE FOLLOWING DIRECTORY:
C:\Users\yourusername\AppData\Local\Microsoft\FSX
---------------------------------------------------------------
Here is a modified technique to display the airplane in wireframe.
Look in your general.fx file.
Mine is here:
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\General\General.fx
Find this technique near the end of the file. Look from the bottom up.
Add the code in green and this will wireframe the airplane.
The selection is done by #if defined(PS_USES_FRESNEL)
You can look through the file and test other selections.
Note once you set a mode it sticks! So the #else was needed to restore the fill mode of the triangles to solid. Without that most of the scene is wireframe. FSX does not clear the scene each frame so without the solid painting the wireframes will smear all over and make a mess.
If you wish to wirefram just the terrain, then add fillmode = wireframe; to the terrain file. That sticks so you have to set the mode back to solid using fillmode = Solid; in the next thecnique that is used. FSX does not restore the prior state after using a technique so yo have to do it your self.
technique T0
<
int Performance = EffectPerfLevel_MaxShader20;
>
{
pass P0
{
#include <DefaultStates.fxh>
#ifndef SHD_BLOOM
FogColor = 0;
#endif
VertexShader = compile vs_3_0 VS(); //NULL;//
PixelShader = compile ps_3_0 PS();
AlphaBlendEnable = (State_AlphaBlendEnable);
SrcBlend = (State_SrcBlend);
DestBlend = (State_DstBlend);//begin wireframe
#if defined(PS_USES_FRESNEL)
FillMode = WIREFRAME;
cullmode = ccw;
#else
FillMode = Solid;
#endif
//end wireframe
}
#ifdef SHD_SHADOWMAP
pass ShadowMap
{
#include <DefaultStates.fxh>
VertexShader = compile vs_2_0 VS_ShadowMap();
PixelShader = compile ps_2_0 PS_ShadowMap();
AlphaBlendEnable = (State_ShadowAlphaBlendEnable);
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
}
#endif
}
This is the result:
You can also play with other files.
For clouds look here: C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\misc\SwarmCloud.fx
Terrain: C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\Terrain\Terrain20.fx
Remember to return the fillmode to solid or many parts of the scene will not clear for a fresh repaint. Old stuff will stay in the scene.
Say you want the terrain in wireframe mode and solid otherwise.
Add the green FillMode = WIREFRAME; line to the T0 technique in the Terrain20.fx file as shown below.
Be sure to add FillMode = Solid; to the other files to restore the drawing state!!!
I added it to the General.fx as it is called frequently.
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\ShadersHLSL\Terrain\Terrain20.fxtechnique T0
<
>
{
pass p0
{
#include<DefaultStates.fxh>
#ifdef
SHD_BLOOM
FogColor = 0;
#endif
FillMode = WIREFRAME;
cullmode = ccw;
VertexShader = compile vs_2_0 Terrain20VS();
PixelShader = compile ps_2_0 Terrain20PS();
ColorWriteEnable = Red | Green | Blue | Alpha;
}
}
Here is the result (note the airplane modification was removed from the general file).
Paul



