<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://www.fsdeveloper.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nickw</id>
	<title>FSDeveloper Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="http://www.fsdeveloper.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nickw"/>
	<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php/Special:Contributions/Nickw"/>
	<updated>2026-05-02T09:02:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Main_Page&amp;diff=1926</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Main_Page&amp;diff=1926"/>
		<updated>2006-11-04T20:42:02Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:fsdeveloper_logo.jpg]]&lt;br /&gt;
&lt;br /&gt;
= fsdeveloper.com Wiki =&lt;br /&gt;
&lt;br /&gt;
Welcome to the fsdeveloper.com Wiki. In this Wiki you will be able to find the following design related subjects:&lt;br /&gt;
&lt;br /&gt;
* Manuals&lt;br /&gt;
* Tutorials&lt;br /&gt;
* Code Examples&lt;br /&gt;
* Design Examples&lt;br /&gt;
* Glossary&lt;br /&gt;
&lt;br /&gt;
At the moment the manuals cover the tools available at [http://www.fsdeveloper.com fsdeveloper.com] only, but the community is free to add manuals for other tools if they want of course. The tutorials cover different subjects, like GMax, BGLC source code tweaking and many other. Everybody is invited to add his own experiences, tutorials and how-to-do&#039;s. Finally the glossary provides an overview of some of the more technical terms used in scenery design discussions. This should enable new designers to learn the scenery design slang faster. If you find a term is missing, please add it to the glossary.&lt;br /&gt;
&lt;br /&gt;
As you might have guessed from the above, this [http://en.wikipedia.org/wiki/Wiki Wiki] system allows all users to add and edit new content. Therefore this is a great way to share knowledge within a community. You might wonder if the forums do not provide a similar function? I think this Wiki system can really add something, it is a good place to find article on how to do things. While the forums are more suitable for discussions with other designers and problem solving. A lot of people who do not contribute in forum discussions are looking for flight simulation design information, so I hope this Wiki can provide some of that information.&lt;br /&gt;
&lt;br /&gt;
= A few rules for editing =&lt;br /&gt;
&lt;br /&gt;
As discussed above, everybody can edit articles found in a Wiki system and I would certainly encourage people to do so. But to keep the final articles readable for everybody, there are a few rules for the editing of them:&lt;br /&gt;
&lt;br /&gt;
* Only edit an article if you can improve it. So by adding your way of doing things or clarifying information you found unclear. So do not edit it place a little remark or add &amp;quot;I agree&amp;quot; or &amp;quot;Thank you&amp;quot;.&lt;br /&gt;
* Do not start discussions in an article. Of course you can add alternative ways of doing things, but if you want to discuss a subject use the [http://www.fsdeveloper.com/forum forums].&lt;br /&gt;
* Please make sure that the article is still readable after editing it. So it must consists of sentences, written in understandable English.&lt;br /&gt;
* Please add a line to the &amp;quot;Document version information&amp;quot; section that describes you changes and add your signature to it as well&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Night_texture_creation&amp;diff=1670</id>
		<title>Night texture creation</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Night_texture_creation&amp;diff=1670"/>
		<updated>2006-10-02T19:40:09Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Originally posted by &amp;quot;Al&amp;quot; to the forums.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Though written for Paint Shop Pro use, the concept should be pretty much the same for other &#039;paint&#039; programs. &lt;br /&gt;
&lt;br /&gt;
This tutorial creates textures for a bank that has a hanging sign on the corner of the building, night lighting on the buildings cornice and doorway night-lights. It is a simple little project intended more on getting your thoughts oriented on what can be done with night lighting. &lt;br /&gt;
&lt;br /&gt;
[http://www.example.com Download PDF]&lt;br /&gt;
[[Category:Scenery design]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Night_texture_creation&amp;diff=1669</id>
		<title>Night texture creation</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Night_texture_creation&amp;diff=1669"/>
		<updated>2006-10-02T19:38:41Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Originally posted by &amp;quot;Al&amp;quot; to the forums.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Though written for Paint Shop Pro use, the concept should be pretty much the same for other &#039;paint&#039; programs. &lt;br /&gt;
&lt;br /&gt;
This tutorial creates textures for a bank that has a hanging sign on the corner of the building, night lighting on the buildings cornice and doorway night-lights. It is a simple little project intended more on getting your thoughts oriented on what can be done with night lighting. &lt;br /&gt;
&lt;br /&gt;
[[Media:Example.ogg]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Night_texture_creation&amp;diff=1668</id>
		<title>Night texture creation</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Night_texture_creation&amp;diff=1668"/>
		<updated>2006-10-02T19:37:24Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Originally posted by &amp;quot;Al&amp;quot; to the forums.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Though written for Paint Shop Pro use, the concept should be pretty much the same for other &#039;paint&#039; programs. &lt;br /&gt;
&lt;br /&gt;
This tutorial creates textures for a bank that has a hanging sign on the corner of the building, night lighting on the buildings cornice and doorway night-lights. It is a simple little project intended more on getting your thoughts oriented on what can be done with night lighting. &lt;br /&gt;
&lt;br /&gt;
[[Image:Example.jpg]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=API_macro_custom_object_symbol&amp;diff=1667</id>
		<title>API macro custom object symbol</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=API_macro_custom_object_symbol&amp;diff=1667"/>
		<updated>2006-10-02T19:34:00Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
When you have made an API macro and want to place it with a program like Airport for Windows or FSSC you will often see the shape of the object on the screen. But for some object there is no shape or it is not accurate enough. This is because the object symbol is not defined correctly. In this article I will explain how you can modify the object symbol.&lt;br /&gt;
&lt;br /&gt;
== Code Example ==&lt;br /&gt;
&lt;br /&gt;
The position of the object symbol should be at the top of the API macro, before any of the actual code of the object. Below you see an example of an object symbol.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
mif( 0 )&lt;br /&gt;
; displays airport symbol&lt;br /&gt;
Area( 5 %1 %2 1 )&lt;br /&gt;
RotatedCall( :symbol 0 0 %5 )&lt;br /&gt;
Jump( :endsymbl )&lt;br /&gt;
:symbol&lt;br /&gt;
RefPoint( 7 : 0.5 %1 %2 )&lt;br /&gt;
Points( 0&lt;br /&gt;
-5 0 -5&lt;br /&gt;
-5 0 5&lt;br /&gt;
5 0 5&lt;br /&gt;
5 0 -5 )&lt;br /&gt;
Poly( a 0 1 2 3 )&lt;br /&gt;
Return&lt;br /&gt;
:endsymbl&lt;br /&gt;
EndA&lt;br /&gt;
mifend&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s explain what each segment of the code does.&lt;br /&gt;
&lt;br /&gt;
The first command is just the SCASM conditional check. And because there are no arguments attached to it, it will always fail. This means that when compiling this code nothing of it will end up in the BGL you make. It is only used by programs like FSSC.&lt;br /&gt;
&lt;br /&gt;
Following this check you will find the Area and RotatedCall command. This last command is needed to let the symbol rotate when you enter a heading while placing the object.&lt;br /&gt;
&lt;br /&gt;
The next important command is the RefPoint command. The parameter 0.5 is the scale that is used in the rest of the code to define the symbol. If you want to have a symbol that is very accurate you might want to use a lower scale, because now the smallest distance that can be displayed is 0.5 meter. In general this will be enough for a symbol though.&lt;br /&gt;
&lt;br /&gt;
The next command is the point list. In here you need to define all points that you need to define your symbol. In this example I just defined a box of 5x5 meter.&lt;br /&gt;
&lt;br /&gt;
The last command is the Poly command, this draws the actual symbol defining the points that are used. In this case a line is drawn from point 0 to point 1, 2, 3 and then back to point 0. For more complex symbols you might need to use more then one Poly command.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Below you find the example code and a picture of how a more complex symbol could look like. In this case a bigger scale was used for the symbol, because the entire object had been designed for a scale of 0.1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
mif( 0 )&lt;br /&gt;
Area( 5 %1 %2 1 )&lt;br /&gt;
RotatedCall( :symbol 0 0 %5 )&lt;br /&gt;
Jump( :endsymbl )&lt;br /&gt;
:symbol&lt;br /&gt;
RefPoint( 7 : 1 %1 %2 )&lt;br /&gt;
Points( 1&lt;br /&gt;
-4 0 -111&lt;br /&gt;
1 0 -111&lt;br /&gt;
1 0 112&lt;br /&gt;
-4 0 112&lt;br /&gt;
0 0 -111&lt;br /&gt;
160 0 -111&lt;br /&gt;
160 0 112&lt;br /&gt;
0 0 112&lt;br /&gt;
-84 0 -111&lt;br /&gt;
-4 0 -111&lt;br /&gt;
-4 0 112&lt;br /&gt;
-84 0 112&lt;br /&gt;
-69 0 -126&lt;br /&gt;
-39 0 -126&lt;br /&gt;
-39 0 -111&lt;br /&gt;
-69 0 -111&lt;br /&gt;
)&lt;br /&gt;
Poly( a 1 2 3 4 )&lt;br /&gt;
Poly( a 5 6 7 8 )&lt;br /&gt;
Poly( a 9 10 11 12 )&lt;br /&gt;
Poly( a 13 14 15 16 )&lt;br /&gt;
Return&lt;br /&gt;
:endsymbl&lt;br /&gt;
EndA&lt;br /&gt;
mifend&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Object_symbol.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery design]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=API_macro_custom_object_symbol&amp;diff=1666</id>
		<title>API macro custom object symbol</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=API_macro_custom_object_symbol&amp;diff=1666"/>
		<updated>2006-10-02T19:33:49Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
When you have made an API macro and want to place it with a program like Airport for Windows or FSSC you will often see the shape of the object on the screen. But for some object there is no shape or it is not accurate enough. This is because the object symbol is not defined correctly. In this article I will explain how you can modify the object symbol.&lt;br /&gt;
&lt;br /&gt;
== Code Example ==&lt;br /&gt;
&lt;br /&gt;
The position of the object symbol should be at the top of the API macro, before any of the actual code of the object. Below you see an example of an object symbol.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
mif( 0 )&lt;br /&gt;
; displays airport symbol&lt;br /&gt;
Area( 5 %1 %2 1 )&lt;br /&gt;
RotatedCall( :symbol 0 0 %5 )&lt;br /&gt;
Jump( :endsymbl )&lt;br /&gt;
:symbol&lt;br /&gt;
RefPoint( 7 : 0.5 %1 %2 )&lt;br /&gt;
Points( 0&lt;br /&gt;
-5 0 -5&lt;br /&gt;
-5 0 5&lt;br /&gt;
5 0 5&lt;br /&gt;
5 0 -5 )&lt;br /&gt;
Poly( a 0 1 2 3 )&lt;br /&gt;
Return&lt;br /&gt;
:endsymbl&lt;br /&gt;
EndA&lt;br /&gt;
mifend&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s explain what each segment of the code does.&lt;br /&gt;
&lt;br /&gt;
The first command is just the SCASM conditional check. And because there are no arguments attached to it, it will always fail. This means that when compiling this code nothing of it will end up in the BGL you make. It is only used by programs like FSSC.&lt;br /&gt;
&lt;br /&gt;
Following this check you will find the Area and RotatedCall command. This last command is needed to let the symbol rotate when you enter a heading while placing the object.&lt;br /&gt;
&lt;br /&gt;
The next important command is the RefPoint command. The parameter 0.5 is the scale that is used in the rest of the code to define the symbol. If you want to have a symbol that is very accurate you might want to use a lower scale, because now the smallest distance that can be displayed is 0.5 meter. In general this will be enough for a symbol though.&lt;br /&gt;
&lt;br /&gt;
The next command is the point list. In here you need to define all points that you need to define your symbol. In this example I just defined a box of 5x5 meter.&lt;br /&gt;
&lt;br /&gt;
The last command is the Poly command, this draws the actual symbol defining the points that are used. In this case a line is drawn from point 0 to point 1, 2, 3 and then back to point 0. For more complex symbols you might need to use more then one Poly command.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Below you find the example code and a picture of how a more complex symbol could look like. In this case a bigger scale was used for the symbol, because the entire object had been designed for a scale of 0.1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
mif( 0 )&lt;br /&gt;
Area( 5 %1 %2 1 )&lt;br /&gt;
RotatedCall( :symbol 0 0 %5 )&lt;br /&gt;
Jump( :endsymbl )&lt;br /&gt;
:symbol&lt;br /&gt;
RefPoint( 7 : 1 %1 %2 )&lt;br /&gt;
Points( 1&lt;br /&gt;
-4 0 -111&lt;br /&gt;
1 0 -111&lt;br /&gt;
1 0 112&lt;br /&gt;
-4 0 112&lt;br /&gt;
0 0 -111&lt;br /&gt;
160 0 -111&lt;br /&gt;
160 0 112&lt;br /&gt;
0 0 112&lt;br /&gt;
-84 0 -111&lt;br /&gt;
-4 0 -111&lt;br /&gt;
-4 0 112&lt;br /&gt;
-84 0 112&lt;br /&gt;
-69 0 -126&lt;br /&gt;
-39 0 -126&lt;br /&gt;
-39 0 -111&lt;br /&gt;
-69 0 -111&lt;br /&gt;
)&lt;br /&gt;
Poly( a 1 2 3 4 )&lt;br /&gt;
Poly( a 5 6 7 8 )&lt;br /&gt;
Poly( a 9 10 11 12 )&lt;br /&gt;
Poly( a 13 14 15 16 )&lt;br /&gt;
Return&lt;br /&gt;
:endsymbl&lt;br /&gt;
EndA&lt;br /&gt;
mifend&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Object_symbol.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery Design]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Flickering_ground_polygons_fix_(SCASM_tweak)&amp;diff=1665</id>
		<title>Flickering ground polygons fix (SCASM tweak)</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Flickering_ground_polygons_fix_(SCASM_tweak)&amp;diff=1665"/>
		<updated>2006-10-02T19:33:27Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A scenery that worked fine in Fs2000 sometimes has bleed through problems with the ground polygons. Usually these polygons where then made with a program like FSDS. This is because such programs use SCASM code that is meant for 3D objects and when this code is used for ground polygons the scenery engine gets confused.&lt;br /&gt;
The fix for the problem is then also to change the SCASM code used to the one for ground polygons. How to do this will be explained in the rest of this document.&lt;br /&gt;
&lt;br /&gt;
== Simple API ==&lt;br /&gt;
&lt;br /&gt;
For a simple API, that is a API that only contains a ground polygon and nothing else, the following changes must be made.&lt;br /&gt;
&lt;br /&gt;
This is an example of the code as FSDS makes it:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
PerspectiveCall( :PCall )&lt;br /&gt;
ShadowCall( :PC02 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
:PCall&lt;br /&gt;
Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 400 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 400 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
Call32( :Part0 )&lt;br /&gt;
:Skip&lt;br /&gt;
Return&lt;br /&gt;
:Exit&lt;br /&gt;
Jump32( :End )&lt;br /&gt;
;&lt;br /&gt;
; Part: Polygon&lt;br /&gt;
:Part0&lt;br /&gt;
Points( 0 &lt;br /&gt;
       0     0   100       ; 0&lt;br /&gt;
     100     0     0       ; 1&lt;br /&gt;
       0     0   -99       ; 2&lt;br /&gt;
     -99     0     0       ; 3&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 32767 0 0.00   0   1   2   3   )&lt;br /&gt;
Return&lt;br /&gt;
:End&lt;br /&gt;
EndA&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get the SCASM code for ground polygons the PerspectiveCall and the ShadowCall should be replaced by a LayerCall. The beginning of the changed API looks like this:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
;PerspectiveCall( :PCall )&lt;br /&gt;
;ShadowCall( :PC02 )&lt;br /&gt;
LayerCall( :PC02 8 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
;:PCall&lt;br /&gt;
;Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 400 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 400 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code I have commented out the PerspectiveCall and ShadowCall commands, as these are not needed. Also the Perspective command has been commented, because this command is obsolete since Fs2000.&lt;br /&gt;
After the ShadowCall I have added the LayerCall, the same label where the ShadowCall refered to is used for the LayerCall and the next parameter is the layer number, 8 in this example. This layer number can of course be changed if another layer is needed in the scenery.&lt;br /&gt;
&lt;br /&gt;
== Complex API ==&lt;br /&gt;
&lt;br /&gt;
For a more complex API the principles are the seem, but in such a macro also other object code is there which should not get a LayerCall. Therefore we need to have both a PerspectiveCall and a LayerCall.&lt;br /&gt;
&lt;br /&gt;
Here is an example of such a code from FSDS:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
PerspectiveCall( :PCall )&lt;br /&gt;
ShadowCall( :PC02 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
:PCall&lt;br /&gt;
Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 500 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 500 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
Call32( :Part0 )&lt;br /&gt;
Call32( :Part1 )&lt;br /&gt;
Call32( :Part2 )&lt;br /&gt;
:Skip&lt;br /&gt;
Return&lt;br /&gt;
:Exit&lt;br /&gt;
Jump32( :End )&lt;br /&gt;
;&lt;br /&gt;
; Part: Polygon&lt;br /&gt;
:Part0&lt;br /&gt;
Points( 0 &lt;br /&gt;
       0     0   100       ; 0&lt;br /&gt;
     100     0     0       ; 1&lt;br /&gt;
       0     0   -99       ; 2&lt;br /&gt;
     -99     0     0       ; 3&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 32767 0 -0.00   0   1   2   3   )&lt;br /&gt;
Return&lt;br /&gt;
;&lt;br /&gt;
; Part: Box&lt;br /&gt;
:Part1&lt;br /&gt;
Points( 0 &lt;br /&gt;
      75     0   -24       ; 0&lt;br /&gt;
      75    50   -24       ; 1&lt;br /&gt;
     125    50   -24       ; 2&lt;br /&gt;
     125     0   -24       ; 3&lt;br /&gt;
      75     0    25       ; 4&lt;br /&gt;
      75    50    25       ; 5&lt;br /&gt;
     125    50    25       ; 6&lt;br /&gt;
     125     0    25       ; 7&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 0 -32767 25.00   0   1   2   3   )&lt;br /&gt;
Poly( 0 0 32767 25.00   7   6   5   4   )&lt;br /&gt;
Poly( -32767 0 0 -75.00   5   1   0   4   )&lt;br /&gt;
Poly( 32767 0 0 125.00   2   6   7   3   )&lt;br /&gt;
Poly( 0 32767 0 50.00   5   6   2   1   )&lt;br /&gt;
Poly( 0 -32767 0 0.00   0   3   7   4   )&lt;br /&gt;
Return&lt;br /&gt;
;&lt;br /&gt;
; Part: Box.1&lt;br /&gt;
:Part2&lt;br /&gt;
Points( 0 &lt;br /&gt;
    -124     0   -24       ; 0&lt;br /&gt;
    -124    50   -24       ; 1&lt;br /&gt;
     -74    50   -24       ; 2&lt;br /&gt;
     -74     0   -24       ; 3&lt;br /&gt;
    -124     0    25       ; 4&lt;br /&gt;
    -124    50    25       ; 5&lt;br /&gt;
     -74    50    25       ; 6&lt;br /&gt;
     -74     0    25       ; 7&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 0 -32767 25.00   0   1   2   3   )&lt;br /&gt;
Poly( 0 0 32767 25.00   7   6   5   4   )&lt;br /&gt;
Poly( -32767 0 0 125.00   5   1   0   4   )&lt;br /&gt;
Poly( 32767 0 0 -75.00   2   6   7   3   )&lt;br /&gt;
Poly( 0 32767 0 50.00   5   6   2   1   )&lt;br /&gt;
Poly( 0 -32767 0 0.00   0   3   7   4   )&lt;br /&gt;
Return&lt;br /&gt;
:End&lt;br /&gt;
EndA&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case Part0 is the ground polygon and Part1 and Part2 are the 3D parts of the object.&lt;br /&gt;
&lt;br /&gt;
The corrected code now looks like this:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
LayerCall( :L 8 )&lt;br /&gt;
PerspectiveCall( :PC02 )&lt;br /&gt;
ShadowCall( :PC02 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
:PCall&lt;br /&gt;
;Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 500 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 500 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
Call32( :Part1 )&lt;br /&gt;
Call32( :Part2 )&lt;br /&gt;
Return&lt;br /&gt;
:L&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 500 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 500 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B2 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B2&lt;br /&gt;
Call32( :Part0 )&lt;br /&gt;
:Skip&lt;br /&gt;
Return&lt;br /&gt;
:Exit&lt;br /&gt;
Jump32( :End )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here I copied the structure and the RefPoint information from the PerspectiveCall part and also used that for the LayerCall part. The actual LayerCall is at the top and it calls the code at the bottom. I hope you can spot the differences between the origional and the changed source and that is enough for you to be able to do the same.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery design]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Flickering_ground_polygons_fix_(SCASM_tweak)&amp;diff=1664</id>
		<title>Flickering ground polygons fix (SCASM tweak)</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Flickering_ground_polygons_fix_(SCASM_tweak)&amp;diff=1664"/>
		<updated>2006-10-02T19:32:57Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
A scenery that worked fine in Fs2000 sometimes has bleed through problems with the ground polygons. Usually these polygons where then made with a program like FSDS. This is because such programs use SCASM code that is meant for 3D objects and when this code is used for ground polygons the scenery engine gets confused.&lt;br /&gt;
The fix for the problem is then also to change the SCASM code used to the one for ground polygons. How to do this will be explained in the rest of this document.&lt;br /&gt;
&lt;br /&gt;
== Simple API ==&lt;br /&gt;
&lt;br /&gt;
For a simple API, that is a API that only contains a ground polygon and nothing else, the following changes must be made.&lt;br /&gt;
&lt;br /&gt;
This is an example of the code as FSDS makes it:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
PerspectiveCall( :PCall )&lt;br /&gt;
ShadowCall( :PC02 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
:PCall&lt;br /&gt;
Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 400 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 400 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
Call32( :Part0 )&lt;br /&gt;
:Skip&lt;br /&gt;
Return&lt;br /&gt;
:Exit&lt;br /&gt;
Jump32( :End )&lt;br /&gt;
;&lt;br /&gt;
; Part: Polygon&lt;br /&gt;
:Part0&lt;br /&gt;
Points( 0 &lt;br /&gt;
       0     0   100       ; 0&lt;br /&gt;
     100     0     0       ; 1&lt;br /&gt;
       0     0   -99       ; 2&lt;br /&gt;
     -99     0     0       ; 3&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 32767 0 0.00   0   1   2   3   )&lt;br /&gt;
Return&lt;br /&gt;
:End&lt;br /&gt;
EndA&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get the SCASM code for ground polygons the PerspectiveCall and the ShadowCall should be replaced by a LayerCall. The beginning of the changed API looks like this:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
;PerspectiveCall( :PCall )&lt;br /&gt;
;ShadowCall( :PC02 )&lt;br /&gt;
LayerCall( :PC02 8 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
;:PCall&lt;br /&gt;
;Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 400 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 400 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code I have commented out the PerspectiveCall and ShadowCall commands, as these are not needed. Also the Perspective command has been commented, because this command is obsolete since Fs2000.&lt;br /&gt;
After the ShadowCall I have added the LayerCall, the same label where the ShadowCall refered to is used for the LayerCall and the next parameter is the layer number, 8 in this example. This layer number can of course be changed if another layer is needed in the scenery.&lt;br /&gt;
&lt;br /&gt;
== Complex API ==&lt;br /&gt;
&lt;br /&gt;
For a more complex API the principles are the seem, but in such a macro also other object code is there which should not get a LayerCall. Therefore we need to have both a PerspectiveCall and a LayerCall.&lt;br /&gt;
&lt;br /&gt;
Here is an example of such a code from FSDS:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
PerspectiveCall( :PCall )&lt;br /&gt;
ShadowCall( :PC02 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
:PCall&lt;br /&gt;
Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 500 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 500 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
Call32( :Part0 )&lt;br /&gt;
Call32( :Part1 )&lt;br /&gt;
Call32( :Part2 )&lt;br /&gt;
:Skip&lt;br /&gt;
Return&lt;br /&gt;
:Exit&lt;br /&gt;
Jump32( :End )&lt;br /&gt;
;&lt;br /&gt;
; Part: Polygon&lt;br /&gt;
:Part0&lt;br /&gt;
Points( 0 &lt;br /&gt;
       0     0   100       ; 0&lt;br /&gt;
     100     0     0       ; 1&lt;br /&gt;
       0     0   -99       ; 2&lt;br /&gt;
     -99     0     0       ; 3&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 32767 0 -0.00   0   1   2   3   )&lt;br /&gt;
Return&lt;br /&gt;
;&lt;br /&gt;
; Part: Box&lt;br /&gt;
:Part1&lt;br /&gt;
Points( 0 &lt;br /&gt;
      75     0   -24       ; 0&lt;br /&gt;
      75    50   -24       ; 1&lt;br /&gt;
     125    50   -24       ; 2&lt;br /&gt;
     125     0   -24       ; 3&lt;br /&gt;
      75     0    25       ; 4&lt;br /&gt;
      75    50    25       ; 5&lt;br /&gt;
     125    50    25       ; 6&lt;br /&gt;
     125     0    25       ; 7&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 0 -32767 25.00   0   1   2   3   )&lt;br /&gt;
Poly( 0 0 32767 25.00   7   6   5   4   )&lt;br /&gt;
Poly( -32767 0 0 -75.00   5   1   0   4   )&lt;br /&gt;
Poly( 32767 0 0 125.00   2   6   7   3   )&lt;br /&gt;
Poly( 0 32767 0 50.00   5   6   2   1   )&lt;br /&gt;
Poly( 0 -32767 0 0.00   0   3   7   4   )&lt;br /&gt;
Return&lt;br /&gt;
;&lt;br /&gt;
; Part: Box.1&lt;br /&gt;
:Part2&lt;br /&gt;
Points( 0 &lt;br /&gt;
    -124     0   -24       ; 0&lt;br /&gt;
    -124    50   -24       ; 1&lt;br /&gt;
     -74    50   -24       ; 2&lt;br /&gt;
     -74     0   -24       ; 3&lt;br /&gt;
    -124     0    25       ; 4&lt;br /&gt;
    -124    50    25       ; 5&lt;br /&gt;
     -74    50    25       ; 6&lt;br /&gt;
     -74     0    25       ; 7&lt;br /&gt;
    )&lt;br /&gt;
;RGBSColor( ef 121 121 121 )&lt;br /&gt;
Dwx( 2d ) ; color command&lt;br /&gt;
Dbd( 121 ) ; red&lt;br /&gt;
Dbx( ef ) ; flag/transparency&lt;br /&gt;
Dbd( 121 ) ; green&lt;br /&gt;
Dbd( 121 ) ; blue&lt;br /&gt;
Poly( 0 0 -32767 25.00   0   1   2   3   )&lt;br /&gt;
Poly( 0 0 32767 25.00   7   6   5   4   )&lt;br /&gt;
Poly( -32767 0 0 125.00   5   1   0   4   )&lt;br /&gt;
Poly( 32767 0 0 -75.00   2   6   7   3   )&lt;br /&gt;
Poly( 0 32767 0 50.00   5   6   2   1   )&lt;br /&gt;
Poly( 0 -32767 0 0.00   0   3   7   4   )&lt;br /&gt;
Return&lt;br /&gt;
:End&lt;br /&gt;
EndA&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case Part0 is the ground polygon and Part1 and Part2 are the 3D parts of the object.&lt;br /&gt;
&lt;br /&gt;
The corrected code now looks like this:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 %3 )&lt;br /&gt;
IfVarRange( :Exit 0346 %12 5 )&lt;br /&gt;
LayerCall( :L 8 )&lt;br /&gt;
PerspectiveCall( :PC02 )&lt;br /&gt;
ShadowCall( :PC02 )&lt;br /&gt;
Jump( :Exit )&lt;br /&gt;
:PCall&lt;br /&gt;
;Perspective&lt;br /&gt;
:PC02&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 500 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 500 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B&lt;br /&gt;
Call32( :Part1 )&lt;br /&gt;
Call32( :Part2 )&lt;br /&gt;
Return&lt;br /&gt;
:L&lt;br /&gt;
mif( %11 )&lt;br /&gt;
RefPoint( 2 :Skip %4 %1 %2 E= %11 v1= %10 V2= 500 )&lt;br /&gt;
melse&lt;br /&gt;
RefPoint( 7 :Skip %4 %1 %2 v1= %10 v2= 500 )&lt;br /&gt;
mifend&lt;br /&gt;
RotatedCall( :B2 0 0 %5 )&lt;br /&gt;
Return&lt;br /&gt;
:B2&lt;br /&gt;
Call32( :Part0 )&lt;br /&gt;
:Skip&lt;br /&gt;
Return&lt;br /&gt;
:Exit&lt;br /&gt;
Jump32( :End )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here I copied the structure and the RefPoint information from the PerspectiveCall part and also used that for the LayerCall part. The actual LayerCall is at the top and it calls the code at the bottom. I hope you can spot the differences between the origional and the changed source and that is enough for you to be able to do the same.&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Object_symbol.jpg&amp;diff=1663</id>
		<title>File:Object symbol.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Object_symbol.jpg&amp;diff=1663"/>
		<updated>2006-10-02T19:29:59Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=API_macro_custom_object_symbol&amp;diff=1662</id>
		<title>API macro custom object symbol</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=API_macro_custom_object_symbol&amp;diff=1662"/>
		<updated>2006-10-02T19:29:46Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
When you have made an API macro and want to place it with a program like Airport for Windows or FSSC you will often see the shape of the object on the screen. But for some object there is no shape or it is not accurate enough. This is because the object symbol is not defined correctly. In this article I will explain how you can modify the object symbol.&lt;br /&gt;
&lt;br /&gt;
== Code Example ==&lt;br /&gt;
&lt;br /&gt;
The position of the object symbol should be at the top of the API macro, before any of the actual code of the object. Below you see an example of an object symbol.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
mif( 0 )&lt;br /&gt;
; displays airport symbol&lt;br /&gt;
Area( 5 %1 %2 1 )&lt;br /&gt;
RotatedCall( :symbol 0 0 %5 )&lt;br /&gt;
Jump( :endsymbl )&lt;br /&gt;
:symbol&lt;br /&gt;
RefPoint( 7 : 0.5 %1 %2 )&lt;br /&gt;
Points( 0&lt;br /&gt;
-5 0 -5&lt;br /&gt;
-5 0 5&lt;br /&gt;
5 0 5&lt;br /&gt;
5 0 -5 )&lt;br /&gt;
Poly( a 0 1 2 3 )&lt;br /&gt;
Return&lt;br /&gt;
:endsymbl&lt;br /&gt;
EndA&lt;br /&gt;
mifend&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s explain what each segment of the code does.&lt;br /&gt;
&lt;br /&gt;
The first command is just the SCASM conditional check. And because there are no arguments attached to it, it will always fail. This means that when compiling this code nothing of it will end up in the BGL you make. It is only used by programs like FSSC.&lt;br /&gt;
&lt;br /&gt;
Following this check you will find the Area and RotatedCall command. This last command is needed to let the symbol rotate when you enter a heading while placing the object.&lt;br /&gt;
&lt;br /&gt;
The next important command is the RefPoint command. The parameter 0.5 is the scale that is used in the rest of the code to define the symbol. If you want to have a symbol that is very accurate you might want to use a lower scale, because now the smallest distance that can be displayed is 0.5 meter. In general this will be enough for a symbol though.&lt;br /&gt;
&lt;br /&gt;
The next command is the point list. In here you need to define all points that you need to define your symbol. In this example I just defined a box of 5x5 meter.&lt;br /&gt;
&lt;br /&gt;
The last command is the Poly command, this draws the actual symbol defining the points that are used. In this case a line is drawn from point 0 to point 1, 2, 3 and then back to point 0. For more complex symbols you might need to use more then one Poly command.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Below you find the example code and a picture of how a more complex symbol could look like. In this case a bigger scale was used for the symbol, because the entire object had been designed for a scale of 0.1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
mif( 0 )&lt;br /&gt;
Area( 5 %1 %2 1 )&lt;br /&gt;
RotatedCall( :symbol 0 0 %5 )&lt;br /&gt;
Jump( :endsymbl )&lt;br /&gt;
:symbol&lt;br /&gt;
RefPoint( 7 : 1 %1 %2 )&lt;br /&gt;
Points( 1&lt;br /&gt;
-4 0 -111&lt;br /&gt;
1 0 -111&lt;br /&gt;
1 0 112&lt;br /&gt;
-4 0 112&lt;br /&gt;
0 0 -111&lt;br /&gt;
160 0 -111&lt;br /&gt;
160 0 112&lt;br /&gt;
0 0 112&lt;br /&gt;
-84 0 -111&lt;br /&gt;
-4 0 -111&lt;br /&gt;
-4 0 112&lt;br /&gt;
-84 0 112&lt;br /&gt;
-69 0 -126&lt;br /&gt;
-39 0 -126&lt;br /&gt;
-39 0 -111&lt;br /&gt;
-69 0 -111&lt;br /&gt;
)&lt;br /&gt;
Poly( a 1 2 3 4 )&lt;br /&gt;
Poly( a 5 6 7 8 )&lt;br /&gt;
Poly( a 9 10 11 12 )&lt;br /&gt;
Poly( a 13 14 15 16 )&lt;br /&gt;
Return&lt;br /&gt;
:endsymbl&lt;br /&gt;
EndA&lt;br /&gt;
mifend&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Object_symbol.jpg]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Non-bumpy_taxiways_(SCASM_tweak)&amp;diff=1661</id>
		<title>Non-bumpy taxiways (SCASM tweak)</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Non-bumpy_taxiways_(SCASM_tweak)&amp;diff=1661"/>
		<updated>2006-10-02T19:13:49Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The bumpy taxiways with the clouds of dust behind your wheels are probably familiar to you. One of the solutions that is offered on the internet is adding an invisible runway to your scenery. I don&#039;t think this is a very elegant way to solve the problem and there even is a better solution. SCASM does have the command SurfaceType to define the type of surface for a scenery.&lt;br /&gt;
&lt;br /&gt;
== Command to smooth surface ==&lt;br /&gt;
&lt;br /&gt;
This command can be used to create a smooth surface with the following code:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Header( 1 53.3 50.9 6.9 4.3 )&lt;br /&gt;
LatRange( 53.3 50.9 )&lt;br /&gt;
&lt;br /&gt;
Area( 5 52.307832 4.765108 20 )&lt;br /&gt;
&lt;br /&gt;
RefPoint( 7 : 1 52.307832 4.765108 v1= 20000 )&lt;br /&gt;
SurfaceType( 0 8000 8000 0 )&lt;br /&gt;
EndA&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example is a piece of code for Schiphol in the Netherlands. To apply the code to your own scenery you must do the following.&lt;br /&gt;
&lt;br /&gt;
First change the coordiantes in the Header and LatRange commands so that they define the boundary of your own area. Note: if you want to add more airfields to the file, the boundaries should be around all of them.&lt;br /&gt;
&lt;br /&gt;
The next step is to make an Area block for each airfield. Just enter the coordinates of your airfield in the Area and RefPoint commands. Then the SurfaceType command defines a polygon that is smooth. In this example the polygon is 8000 by 8000 meters. You can of course change this to meet your own airfields size.&lt;br /&gt;
&lt;br /&gt;
You must repeat this block for every airfield you want to make smooth. Then save the source code and compile it using SCASM. Now you have a separate BGL that removes the bumps!&lt;br /&gt;
&lt;br /&gt;
If you want the smooth polygon to have the exact shape of the polygons of your airport, you must add a SenseBorder command to check the location of the aircraft. This way you can keep the grass on your airport bumpy, while the taxiways and aprons are smooth. I have made a tool that can generate such code automatically for you. You can find more information about it here.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery design]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Effect_placement_(SCASM)&amp;diff=1660</id>
		<title>Effect placement (SCASM)</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Effect_placement_(SCASM)&amp;diff=1660"/>
		<updated>2006-10-02T19:09:57Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very easy way to place effect files in your scenery using SCASM. In the new SCASM this command is mentioned:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
GObj( EFFECT &amp;quot;string1&amp;quot; &amp;quot;string2&amp;quot; )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the different strings is not documentated, but after some trial and error I found that the first string is the name of the effect file (eg. Nova_smoke_one.fx). The second string are additional parameters that can be passed to the effect. If you for example enter MOY=1:6;DOM=1 then the effect will only be visible on the first day of the first 6 months of the year. For more details see the file &amp;quot;Effects Parameters.txt&amp;quot; that is part of the Effects SDK. If you want no additional parameters you can just enter 0 for the string.&lt;br /&gt;
&lt;br /&gt;
All other parameters for the effect file that can be specified in the BGLPlacer tool from the SDK (latitude, longitude, etc) can be specified in SCASM using the normal way (in the RefPoint for example).&lt;br /&gt;
&lt;br /&gt;
This makes it very easy to add an effect to your macro. No need anymore to make a separate macro for the effect or even a seperate BGL using BGLPlacer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Don&#039;t forget the Set( fsvers 0x800 ) command in your SCASM source that tells SCASM to use the Fs2002 code, otherwise you will get an error.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery design]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Conditional_display_(SCASM_tweak)&amp;diff=1659</id>
		<title>Conditional display (SCASM tweak)</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Conditional_display_(SCASM_tweak)&amp;diff=1659"/>
		<updated>2006-10-02T19:09:40Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
With some design programs it is not possible to specify conditions for the display of your objects (or parts of them). But how about the lights that should only be shown at night or the Christmas tree that should be displayed only in December?  With a relatively simple modification to the source code it is possible to display the object only when you want it. The structure of the code is as follows:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
IfVarRange( :labelname var con1 con2 )&lt;br /&gt;
; the code you want only to display in the certain condition&lt;br /&gt;
:labelname&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
You probably think now that such code is nice, but what do you do with it? Here are some practicle examples how you can use it.&lt;br /&gt;
&lt;br /&gt;
=== Image Complexity ===&lt;br /&gt;
&lt;br /&gt;
If you want your object only to display at a certain image complexity setting you can use the IfVarRange command to display the object only at the settings you want. To do this you need to find the Area command at the begin of your object. This could look something like this:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 22 )&lt;br /&gt;
PerspectiveCall( :Obj )&lt;br /&gt;
ShadowCall( :Obj )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
Now at the following line to this code:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 22 )&lt;br /&gt;
IfVarRange( : 346 3 5 )&lt;br /&gt;
PerspectiveCall( :Obj )&lt;br /&gt;
ShadowCall( :Obj )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
Here a check is made if the variable 346, which is the image complexity setting, is between 3 (dense) and 5 (extremely dense). If that is true the code below it is displayed, if not a jump is made to the label :. This label is a special label that will take you to the end of the file right away.&lt;br /&gt;
&lt;br /&gt;
=== Time of day ===&lt;br /&gt;
&lt;br /&gt;
Another example is where you want to display a certain object only at a certain time of day. Here is a piece of code that displays a light dot:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
RGBLColor( EF 195 195 195 )&lt;br /&gt;
Dot( 0 10 0 )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
To make sure that the dot is only displayed at dusk/dawn and night you can add the following lines:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
IfVarRange( :nolight 28C 2 4 )&lt;br /&gt;
RGBLColor( EF 195 195 195 )&lt;br /&gt;
Dot( 0 10 0 )&lt;br /&gt;
:nolight&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
In this case the variable for time of day (28C) is checked. If the value is between 2 (dusk/dawn) and 4 (night) the light is displayed, otherwise a jump to the label nolight is made.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery design]]&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Conditional_display_(SCASM_tweak)&amp;diff=1658</id>
		<title>Conditional display (SCASM tweak)</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Conditional_display_(SCASM_tweak)&amp;diff=1658"/>
		<updated>2006-10-02T19:08:45Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
With some design programs it is not possible to specify conditions for the display of your objects (or parts of them). But how about the lights that should only be shown at night or the Christmas tree that should be displayed only in December?  With a relatively simple modification to the source code it is possible to display the object only when you want it. The structure of the code is as follows:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
IfVarRange( :labelname var con1 con2 )&lt;br /&gt;
; the code you want only to display in the certain condition&lt;br /&gt;
:labelname&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
You probably think now that such code is nice, but what do you do with it? Here are some practicle examples how you can use it.&lt;br /&gt;
&lt;br /&gt;
=== Image Complexity ===&lt;br /&gt;
&lt;br /&gt;
If you want your object only to display at a certain image complexity setting you can use the IfVarRange command to display the object only at the settings you want. To do this you need to find the Area command at the begin of your object. This could look something like this:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 22 )&lt;br /&gt;
PerspectiveCall( :Obj )&lt;br /&gt;
ShadowCall( :Obj )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
Now at the following line to this code:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
Area( 5 %1 %2 22 )&lt;br /&gt;
IfVarRange( : 346 3 5 )&lt;br /&gt;
PerspectiveCall( :Obj )&lt;br /&gt;
ShadowCall( :Obj )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
Here a check is made if the variable 346, which is the image complexity setting, is between 3 (dense) and 5 (extremely dense). If that is true the code below it is displayed, if not a jump is made to the label :. This label is a special label that will take you to the end of the file right away.&lt;br /&gt;
&lt;br /&gt;
=== Time of day ===&lt;br /&gt;
&lt;br /&gt;
Another example is where you want to display a certain object only at a certain time of day. Here is a piece of code that displays a light dot:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
RGBLColor( EF 195 195 195 )&lt;br /&gt;
Dot( 0 10 0 )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
To make sure that the dot is only displayed at dusk/dawn and night you can add the following lines:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
IfVarRange( :nolight 28C 2 4 )&lt;br /&gt;
RGBLColor( EF 195 195 195 )&lt;br /&gt;
Dot( 0 10 0 )&lt;br /&gt;
:nolight&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
In this case the variable for time of day (28C) is checked. If the value is between 2 (dusk/dawn) and 4 (night) the light is displayed, otherwise a jump to the label nolight is made.&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Effect_placement_(SCASM)&amp;diff=1657</id>
		<title>Effect placement (SCASM)</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Effect_placement_(SCASM)&amp;diff=1657"/>
		<updated>2006-10-02T19:03:53Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very easy way to place effect files in your scenery using SCASM. In the new SCASM this command is mentioned:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
GObj( EFFECT &amp;quot;string1&amp;quot; &amp;quot;string2&amp;quot; )&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The use of the different strings is not documentated, but after some trial and error I found that the first string is the name of the effect file (eg. Nova_smoke_one.fx). The second string are additional parameters that can be passed to the effect. If you for example enter MOY=1:6;DOM=1 then the effect will only be visible on the first day of the first 6 months of the year. For more details see the file &amp;quot;Effects Parameters.txt&amp;quot; that is part of the Effects SDK. If you want no additional parameters you can just enter 0 for the string.&lt;br /&gt;
&lt;br /&gt;
All other parameters for the effect file that can be specified in the BGLPlacer tool from the SDK (latitude, longitude, etc) can be specified in SCASM using the normal way (in the RefPoint for example).&lt;br /&gt;
&lt;br /&gt;
This makes it very easy to add an effect to your macro. No need anymore to make a separate macro for the effect or even a seperate BGL using BGLPlacer.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Don&#039;t forget the Set( fsvers 0x800 ) command in your SCASM source that tells SCASM to use the Fs2002 code, otherwise you will get an error.&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1647</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1647"/>
		<updated>2006-10-01T20:38:29Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Texture types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|200px|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
[[Image:fig4-trans.jpg||left|thumb|Figure 4 - Behaviour of different texture types]] [[Image:fig5-trans.jpg||right|thumb|Figure 5 - Behaviour of different texture types (cont)]]&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1646</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1646"/>
		<updated>2006-10-01T20:38:02Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Texture types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|200px|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
[[Image:fig4-trans.jpg||left|thumb|Figure 4 - Behaviour of different texture types]] [[Image:fig5-trans.jpg||right|thumb|Figure 5 - Behaviour of different texture types (cont)]]&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Fig5-trans.jpg&amp;diff=1645</id>
		<title>File:Fig5-trans.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Fig5-trans.jpg&amp;diff=1645"/>
		<updated>2006-10-01T20:37:19Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Fig4-trans.jpg&amp;diff=1644</id>
		<title>File:Fig4-trans.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Fig4-trans.jpg&amp;diff=1644"/>
		<updated>2006-10-01T20:36:46Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1643</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1643"/>
		<updated>2006-10-01T20:36:37Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Texture types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|200px|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
[[Image:fig4-trans.jpg|thumb|Figure 4 - Behaviour of different texture types]] [[Image:fig5-trans.jpg|thumb|Figure 5 - Behaviour of different texture types (cont)]]&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1642</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1642"/>
		<updated>2006-10-01T20:36:13Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|200px|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
[[Image:fig4-trans.jpg|thumb|Figure 4 - Behaviour of different texture types]]&lt;br /&gt;
[[Image:fig5-trans.jpg|thumb|Figure 5 - Behaviour of different texture types (cont)]]&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Ehamtopdown.jpg&amp;diff=1641</id>
		<title>File:Ehamtopdown.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Ehamtopdown.jpg&amp;diff=1641"/>
		<updated>2006-10-01T20:33:49Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1640</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1640"/>
		<updated>2006-10-01T20:32:53Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Drawing order */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|200px|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Cubetopdown.jpg&amp;diff=1639</id>
		<title>File:Cubetopdown.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Cubetopdown.jpg&amp;diff=1639"/>
		<updated>2006-10-01T20:32:13Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1638</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1638"/>
		<updated>2006-10-01T20:31:07Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|200px|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1637</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1637"/>
		<updated>2006-10-01T20:29:27Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:boxcorrect.jpg|middle|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|right|200px|Figure 1 - Incorrect]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1636</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1636"/>
		<updated>2006-10-01T20:29:02Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:boxcorrect.jpg|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|200px|Figure 1 - Incorrect]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1635</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1635"/>
		<updated>2006-10-01T20:28:46Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:boxcorrect.jpg|right|200px|Figure 1 - Correct]] [[Image:boxincorrect.jpg|right|200px|Figure 1 - Incorrect]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1634</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1634"/>
		<updated>2006-10-01T20:27:44Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:boxcorrect.jpg|left|Figure 1 - Correct]] [[Image:boxincorrect.jpg|left|Figure 1 - Incorrect]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1633</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1633"/>
		<updated>2006-10-01T20:26:59Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:boxcorrect.jpg|thumb|middle|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|middle|Figure 1 - Incorrect]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1632</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1632"/>
		<updated>2006-10-01T20:26:41Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|thumb|middle|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|middle|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1631</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1631"/>
		<updated>2006-10-01T20:26:33Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Buffeting of the scenery engine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1630</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1630"/>
		<updated>2006-10-01T20:25:30Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Buffeting of the scenery engine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
[[Image:boxcorrect.jpg|thumb|middle|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|middle|Figure 1 - Incorrect]]&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1629</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1629"/>
		<updated>2006-10-01T20:24:27Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Buffeting of the scenery engine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|thumb|middle|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|middle|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1628</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1628"/>
		<updated>2006-10-01T20:23:52Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Buffeting of the scenery engine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|thumb|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1627</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1627"/>
		<updated>2006-10-01T20:23:36Z</updated>

		<summary type="html">&lt;p&gt;Nickw: /* Drawing order */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|thumb|left|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|left|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Boxincorrect.jpg&amp;diff=1626</id>
		<title>File:Boxincorrect.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Boxincorrect.jpg&amp;diff=1626"/>
		<updated>2006-10-01T20:22:57Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Boxcorrect.jpg&amp;diff=1625</id>
		<title>File:Boxcorrect.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Boxcorrect.jpg&amp;diff=1625"/>
		<updated>2006-10-01T20:22:48Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1624</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1624"/>
		<updated>2006-10-01T20:21:39Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occurred when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed through for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparent textures. You expect to see polygons through your transparent polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red colour and for the outside you have used a green transparent texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the different polygons. The order in which the different polygons are drawn is the order in which they are placed in the BGL File. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our File. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL File before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|thumb|left|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|left|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn First. The polygon further away is drawn after that and this gives a conflict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A top-down view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|left|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparent textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hiding by the scenery engine by now. But you will probably think: What has this to do with my transparent texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparent texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparent texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is fine and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯first drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparent textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯fine. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯Figure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparent windows, so you can look at the interior of the pier (see the passengers waiting for your °flight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the different texture types that can be used in Fs2002 sometimes give different results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this effect I have applied two different textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in Figure 4 and Figure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1623</id>
		<title>Drawing order problems with transparent textures</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=Drawing_order_problems_with_transparent_textures&amp;diff=1623"/>
		<updated>2006-10-01T20:16:50Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Maybe you started making sceneries before Fs2000 was there? Then you will surely remember how much time it could take to get rid of all those irritating bleed through problems that occured when making a complex object. With the introduction of Fs2000 this problem was solved because the scenery engine now eliminates these bleed throughs for you. But a side effect of this nice new feature is that you sometimes run into trouble when using transparant textures. You expect to see polygons through your transparant polygon, but you look right into nothing. This problem appears relatively often in the scenery design forums and I have the feeling that a lot of people do not understand the underlaying principles that cause it. In this tutorial I&#039;ll try to explain where these problems come from and how you can solve them.&lt;br /&gt;
&lt;br /&gt;
== The problem ==&lt;br /&gt;
&lt;br /&gt;
OK, before we start talking about how to solve the problem, let&#039;s first get clear what the problem actually is. Assume you want to make a cube. You have painted the inside with a nice red color and for the outside you have used a green transparant texture. Then you would expect the result to be as the left picture in Figure 1, but too often the result looks more like the right one. How can this happen?&lt;br /&gt;
&lt;br /&gt;
== Buffeting of the scenery engine ==&lt;br /&gt;
&lt;br /&gt;
To understand where the problem comes from we have to look at how the scenery engine draws the di®erent polygons. The order in which the di®erent polygons are drawn is the order in which they are placed in the BGL ¯le. So the scenery engine just reads through the BGL and displays the polygons in the order they are found. So assume we have two polygons in our ¯le. One is 50 meter ahead of us and the other is 100 meter ahead of us. Let&#039;s also assume that the code of the the polygon closest to us is in the BGL ¯le before the code of the other polygon.&lt;br /&gt;
&lt;br /&gt;
[[Image:boxcorrect.jpg|thumb|left|Figure 1 - Correct]] [[Image:boxincorrect.jpg|thumb|left|Figure 1 - Incorrect]]&lt;br /&gt;
&lt;br /&gt;
In that case the polygon closest to us is drawn ¯rst. The polygon further away is drawn after that and this gives a con°ict. Before Fs2000 this would give a bleed through problem, because a polygon further away is drawn over a polygon closer to us and therefore the order on the screen is wrong.&lt;br /&gt;
&lt;br /&gt;
Since Fs2000 a new feature has been build into the scenery engine that check for these sort of problems and that hides the part of polygon that is further away if it would display over a polygon closer to us. Therefore we don&#039;t have those bleed through problems anymore.&lt;br /&gt;
&lt;br /&gt;
== Drawing order ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume we have a cube. I&#039;ll only consider the four side polygons here. We will call them polygon A, B, C and D from now on. All these polygons are drawn double sides, so they all have an inner and an outer face. I&#039;ll call them Ai, Ao, Bi, Bo, Ci, Co, Di and Do. A topdown view of the situation is given in Figure 2.&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s assume that the order of the polygons in the source code is like this: Ai, Ao, Bi, Bo, Ci, Co, Di, Do. This is an order that is often used by scenery design programs. If we look from viewpoint 1 (see the arrow) at the cube the scenery engine will hide some polygons for us, to prevent bleedthroughs. The polygon Ci for example is drawn after Ao has been drawn to the screen. So Ci will be hidden to prevent problems.&lt;br /&gt;
&lt;br /&gt;
But when we look from viewpoint 2 you&#039;ll see that there are no problems, as Ai is drawn before Co, so there is no problem here. If we consider another option for the order like Ai, Bi, Ci, Di, Ao, Bo, Co, Do, then you will see that there are no conflicts in this case and no polygon is hidden for us. But when we would use Ao, Bo, Co, Do, Ai, Bi, Ci, Di then there is a conflict from each drawing angle and all inner polygons are hidden.&lt;br /&gt;
&lt;br /&gt;
[[Image:cubetopdown.jpg|thumb|left|Figure 2 - Top Down View of Cube]]&lt;br /&gt;
&lt;br /&gt;
== Transparant textures ==&lt;br /&gt;
&lt;br /&gt;
I hope you understand the principle of the polygon hidding by the scenery engine by now. But you will probably think: What has this to do with my transparant texture? Well, actually the scenery engine does not know what kind of texture is applied to your polygon and it will still hide polygons to prevent bleed through problems. Let go back to the cube from the previous section and assume we apply a transparant texture to the outside polygons, while the inside polygons are solid.&lt;br /&gt;
&lt;br /&gt;
If the drawing order is like the last example we considered there (Ao, Bo,Co, Do, Ai, Bi, Ci, Di) then you will see that the scenery engine hides all the inner polygon and through your transparant texture on the outer ones you see absolutely nothing.  On the order hand if we use the second drawing order (Ai, Bi, Ci, Di, Ao, Bo, Co, Do) then everything is ¯ne and it looks like you intended.&lt;br /&gt;
&lt;br /&gt;
For the ¯rst drawing order (Ai, Ao, Bi, Bo, Ci, Co, Di, Do) you should by now understand that from viewpoint 2 everything looks like you intended, but from viewpoint 1 you look into nothing again. This shows that the drawing order is really important to prevent problems when you use transparant textures. The general rule is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Draw to polygons of the inside before you draw the polygons of the outside&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For most simple objects this works ¯ne. Although it is not always very easy to achieve in scenery design programs. Unfortunately most do not have an option to control the drawing order directly (I believe NOVA is an exception there). So it might require some hand editing of the SCASM (or BGLC) source to get the required results.  I will not discuss it in great detail here, but assume you have a really complex object like the terminal of Schiphol I have made. A top down view of a piece of one of the piers is given in ¯gure 3.&lt;br /&gt;
&lt;br /&gt;
[[Image:ehamtopdown.jpg|thumb|left|Figure 2 - Top down view of a pier at EHAM]]&lt;br /&gt;
&lt;br /&gt;
In the current version of the Schiphol scenery this terminal has been made with transparant windows, so you can look at the interior of the pier (see the passengers waiting for your °ight for example) and you can look through it and see what happens on the other side of it. Let&#039;s have a closer look at the head of the pier. We will only look at the four polygons named A, B, C and D. And just like the cube before they have an inner and an outer side (Ai, Ao, Bi, Bo, Ci, Co, Di, Do). If we look from&lt;br /&gt;
direction 1 (see the arrow) then the optimal drawing order would be: Do, Di, Ci, Co, Bo, Bi, Ai, Ao. But if we look from direction 2 then the optimal order is: Ao, Ai, Bi, Bo, Co, Ci, Di, Do. It is clear that it is not possible to create one drawing order that can satisfy both of these conditions. In this case we would need to make the drawing order dependant on the viewing angle. The SCASM command VectorJump can be used to do this. I will not give more details about how this has been done here1. But I just wanted to indicate with this example that for complex objects it is not always possible to ¯nd one certain correct drawing order.&lt;br /&gt;
&lt;br /&gt;
== Texture types ==&lt;br /&gt;
&lt;br /&gt;
The theory above is always valid, but it has been reported that the di®erent texture types that can be used in Fs2002 sometimes give di®erent results. This will be discussed in this section. &lt;br /&gt;
&lt;br /&gt;
To see this e®ect I have applied two di®erent textures to a cube with a wrong drawing order, one has a semi transparant piece, while the other has a completely transparant piece. The result for the di®erent formats that can be found in ImageTool and support an alpha channel have been given in ¯gure 4 and ¯gure 5.&lt;br /&gt;
&lt;br /&gt;
It is interesting to see that for all textures with a 1 bit alpha channel the problem doesn&#039;t appear anymore. So it seems that Fs2002 has an extra feature compared to Fs2000 that prevents the transparancy problem. But for a semi-transparant texture the problem happens all the time. It should be noted that having the correct drawing order will prevent the problem in any case, althought for a 1 bit alpha channel choosing the correct texture format might be a faster way to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
² For the 8 bit image ImageTool corrupted the alpha channel for the fully transparant texture, this caused it to have also some gray tints and should probably explain the results for it.&lt;br /&gt;
² For the DXT 1 image the semi transparant texture is equivalant to the transparant one, because that format only has a 1 bit alpha channel. Therefore the results are also the same.&lt;br /&gt;
² For the DXT 3 texture with a 1 bit alpha channel something really strange happens, here the complete texture isn&#039;t visible anymore. At the moment I have no clue what is the cause of this e®ect.&lt;br /&gt;
² The 555 also has a 1 bit alpha channel like the DXT 1 format, but at DXT 1 my gray color for the semi transparant texture became black, where at 555 one dot became white and the neighbour became black. This explains the di®erent look, but also that the result is still rather OK.&lt;br /&gt;
&lt;br /&gt;
== Comments? ==&lt;br /&gt;
&lt;br /&gt;
I hope this tutorial has helped you in understanding where the problems withtransparant textures come from. But if you still have a question, a comment or a suggestion, please don&#039;t hesitate to contact me. You can ¯nd me on the AvSim scenery design forum under the nick arno or mail me at arno@nl-2000.com&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season12.jpg&amp;diff=1611</id>
		<title>File:Season12.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season12.jpg&amp;diff=1611"/>
		<updated>2006-10-01T19:41:52Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season11.jpg&amp;diff=1609</id>
		<title>File:Season11.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season11.jpg&amp;diff=1609"/>
		<updated>2006-10-01T19:41:43Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season10.jpg&amp;diff=1608</id>
		<title>File:Season10.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season10.jpg&amp;diff=1608"/>
		<updated>2006-10-01T19:41:32Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season9.jpg&amp;diff=1607</id>
		<title>File:Season9.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season9.jpg&amp;diff=1607"/>
		<updated>2006-10-01T19:41:19Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season8.jpg&amp;diff=1606</id>
		<title>File:Season8.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season8.jpg&amp;diff=1606"/>
		<updated>2006-10-01T19:41:10Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season7.jpg&amp;diff=1605</id>
		<title>File:Season7.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season7.jpg&amp;diff=1605"/>
		<updated>2006-10-01T19:41:01Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season6.jpg&amp;diff=1604</id>
		<title>File:Season6.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season6.jpg&amp;diff=1604"/>
		<updated>2006-10-01T19:40:51Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season5.jpg&amp;diff=1603</id>
		<title>File:Season5.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season5.jpg&amp;diff=1603"/>
		<updated>2006-10-01T19:40:40Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season4.jpg&amp;diff=1602</id>
		<title>File:Season4.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season4.jpg&amp;diff=1602"/>
		<updated>2006-10-01T19:40:30Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
	<entry>
		<id>http://www.fsdeveloper.com/wiki/index.php?title=File:Season3.jpg&amp;diff=1601</id>
		<title>File:Season3.jpg</title>
		<link rel="alternate" type="text/html" href="http://www.fsdeveloper.com/wiki/index.php?title=File:Season3.jpg&amp;diff=1601"/>
		<updated>2006-10-01T19:40:17Z</updated>

		<summary type="html">&lt;p&gt;Nickw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nickw</name></author>
	</entry>
</feed>