New Feature - Ground Textures

General discussion about Scenery Design. Questions about SBuilder for Flight Simulator FS2004.
Post Reply
User avatar
Luis Sa
Posts: 1736
Joined: Sun May 18, 2003 11:17 am
Location: Portugal
Contact:

New Feature - Ground Textures

Post by Luis Sa » Mon Jun 06, 2005 8:27 am

Hi,

I uploaded Revision 03 (http://www.ptsim.com/forum/topic.asp?TOPIC_ID=411) which has support for ground polygons. You can now make polygons and apply any texture to them. This is useful if you want to make your custom taxiways, your own markings, or to place any polygon that goes with a texture.

One problem: these polygons are called using LayerCall() SCASM command. As in high res photo scenery these polygons cover the runway and approns made with XML (that is to say with AFCAD). I do not know how to force the "AFACAD runway" to be drawn after (over) these polygons.

In the following I will describe what you can do in order to make a tilted runway. The first thing you need is to define a folder where you place copies of the textures that you are working with. You can do that through this modified menu:

Image

When, later on, you define a texture, SBuilder looks into this folder. If it does not find the texture in this working folder, SBuilder tries the FS standard texture folder. In my case this folder is:

C:\Programas\Microsoft Games\Flight Simulator 9\Texture

Before I proceed, let me say that you need Martin Wright's graphic DLLs. If you are not sure if you have them installed do not worry because Sbuilder will give you a warning and will show you the web site from where you can get these DLLs.

So I create a polygon with 4 points which is supposed to be a runway. In Revision 03 you can define one more TYPE for polygons. I refer to the TEXTURE type. Here is what I get as soon as I set the type to TEXTURE.

Image

There is no texture yet applied to the polygon. At this stage I could press the Tab "Points", just on the side of the Tab "Texture", and set the altitude of all the points. I could even set the altitude of the polygon so that it would become a "tilted" polygon (search this forum to know how this could be done). I will skip this altitude setting stage and I go for the setting of the texture. In the shown case I picked up the standard runway20.bmp texture:

Image

Now I have the problem that the texture is orientated N to S and my runway is orientated NW to SE. What I need to do is to change the mapping of the texture to the polygon. By mapping I refer to the correspondence between the vertex of the polygon and the pixels of the texture. In order to start this I need to click the small picture. I get this enlarged window:

Image

The picture shows me the part of the texture that will be applied to the polygon. The properties of the red point are shown on the right. You can see that this point is point #1 and you can see the pixel coordinates that will be used for that point. At the moment this is not very useful but, in other projects, it could help you to know which point are you working on. Returning to my orientation problem, I moved the points with the mouse so that I end up with the following settings:

Image

Note that I can return to the original mapping in 2 ways: by pressing Cancel to leave this window; or by pressing Reset which will keep me in this window. What I have done was to press OK to accept the settings and return to starting Polygon window:

Image

At this stage I set the tiling of the texture. I want the texture to repeat twice on the width and 10 times on the lengh. So I enter the X and Y Tiles boxes with 2 and 10. I also set priority to be 4. For runways I could set an higher number (24 is common). What is the meaning of this number, you could ask? It is simple to answer: if I make another polygon and give it a priority of 3, this new polygon will be covered the the one with priorty of 4; and if I create a third polygon with priority of 5, it will cover the fist two. So what I need to finish the runway is to compile:

Image

This is the new arrangement for the Compile window. It is almost identical to what it was before, except for the new "TEXTURED POLYS". I have not really check the result in FS but I created the BGL. Here is the intermediate PROJECT_TEXP.SCM SCASM file:

<font color="green">

Header( 1 41 39 -9 -11 )
LatRange( 39 41 )

; Textured Poly # 1

Area( 5 39.98663187 -10.17333865 50 )
LayerCall( :lcall 4 )
Jump( : )
:lcall
RefPoint( 2 :return 1 39.98663187 -10.17333865 E= 155.00000000 v1= 15000 v2= 1721 )
BGLVersion( 0800 )
TextureList( 0
6 FF 255 255 255 0 50.000000 runway20.bmp
)
MaterialList( 0 0.000 0.502 0.000 1.00 0.000 0.502 0.000 1.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 1.00 0.00 )
VertexList( 0
-1079.8893 0000.0000000 0800.2757 0.0 1.0 0.0 00.000 10.000 ; vertex #000
-0934.2316 0000.0000000 0953.1642 0.0 1.0 0.0 02.000 10.000 ; vertex #001
1079.7347 0000.0000000 -0805.0534 0.0 1.0 0.0 02.000 00.000 ; vertex #002
0934.3862 0000.0000000 -0948.3864 0.0 1.0 0.0 00.000 00.000 ; vertex #003
)
SetMaterial( 0 0 )
DrawTriList( 0
002 001 000
003 002 000
)
EndVersion
:return
Return
EndA

</font id="green">

For the "technical" users: as you see you can set the visibilty (15000 meters in the shown case). The V2 parameter is evaluated automatically so that the polygon is not processed when it is becomes behind the viewer. You could specify a texture with a night map (not the present case) or you could simply specify a color without texture. To get this you would need to set the color that you want by clicking the texture box on the Polygon Properties window and remove the name (if you had one). If the Texture Box is blank, SBuilder assumes that your polygon is colored only (not textured).

Now I will turn to my present scenery project and I will use this to make some nice car parks! [:)]

Luis

PS: I hope all this works as described. Please be prepared to get some problems. After all, I have finished the coding of this part some hours ago!

scott967
Posts: 67
Joined: Wed Oct 06, 2004 5:08 am
Location: O'ahu Hawai'i

Post by scott967 » Tue Jun 07, 2005 6:23 am

Thanks Luis,

Now i think "TexPoly" is out of business for me!

scott s.
.

Post Reply