ALS technical notes: Difference between revisions

Jump to navigation Jump to search
Line 277: Line 277:
[[File:interior01.jpg|640px|Interior shading effect]]
[[File:interior01.jpg|640px|Interior shading effect]]


This effect is based on an opacity map - a cube map of textures which tells the renderer where the cockpit is transparent and where not. The opacity map has to be created beforehand, which allows to make it quite detailed. In this map, white stands for a completely transparent surface, black for an opaque surface, colors for tinted glass which will create a colored light spot in the cockpit, grey hues for partial shadowing allowing to paint dirt effects onto the windows, and caustics can be drawn using the alpha channel: (1-alpha) will be used as an enhancement of the light at a certain spot.


This is typically created in an effect file such as c172-interior.eff which looks like this
The effect is typically declared as derived by inheritance using an effect file such as c172-interior.eff which looks like this


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
Line 307: Line 308:
which is called by inheritance in the model.xml file.
which is called by inheritance in the model.xml file.


ie:
Imagine the opacity map as a box surrounding the cockpit and trying to closely follow its contours. The origin in the box needs to be placed into the center of the cockpit, which is what <b><opacity-cube-center></b> does. Each of the three dimensions then needs to be stretched to roughly fit the layout of the canopy, this is done by <b><opacity-cube-scale></b>.
 
If opacity map center and scale are wrong, you will still see shadows, but they won't match the real cockpit layout (the lightspot of a window will be seen displaced and at a different size of the real window). Thus, carefully measuring the best box layout in a 3d tool is moderately important.
 
 
 
Aircraft-side the effect is called as


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
1,360

edits

Navigation menu