Tech Support Blog

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 16 February 2007

Polygons Part 4 - Anatomy of a .pol file

Posted on 14:16 by Unknown
Before I do this, an important disclaimer: we want you to use the .pol files that are found in the default scenery using the library system, not to copy the files! I encourage you to look inside the X-Plane resources folder to see how the system works, but don't copy a file if you can use it via the library; the library system saves loading time and VRAM.*

With that in mind, here's a line-by-line of what we might find in a .pol file. This one came from my X-System folder in Resources/default scenery/820 world terrain/pol/apt_desert_hot.pol. We have:

A
850
DRAPED_POLYGON

This is a standard header for a .pol file, which defines the look of a draped polygon.

TEXTURE ../textures/apt/apt_desert.png

This defines what texture the polygon will be drawn with. In this case, we are using our apt_desert.png file, found elsewhere in our package. (The double periods, .. move us up to a higher level directory. This is legal within a single scenery package.)

SCALE 500 500

This defines how large the texture appears in the X-Plane world. In this case, the horizontal span of the entire texture (before it repeats) is 500 meters (the first number), and the vertical span is also 500 meters.

NO_ALPHA

This tells X-Plane to ignore the alpha channel on the PNG file. Often PNG files used for base textures have alpha channels consisting of noise, for the purpose of creating terrain transitions. Since seeing this alpha isn't desirable in an overlay polygon, this command can be used to strip out the alpha. This lets us use one PNG file for two purposes.

SURFACE dirt

This defines the physical surface properties of the polygon. In this case, it is "dirt", which for X-Plane means some dust puffs will come off the wheels and your plane will clonk around. See the OBJ8 specification for a list of all possible surface types. (These names match the ATTR_hard command in X-Plane 8 objects.)

LAYER_GROUP airports -1

This defines where in the drawing stack to draw. In this case, we will draw one layer under airports (-1 means under, +1 would mean over). This means that this surface will be seen right below all aspects of the airport, but above regular terrain, which is what we want. The names here correspond to the same names you'd find in an OBJ8 in ATTR_layer_group - see the OBJ8 spec for the complete list of names.

* Basically any time there are two PNG files on disk, the VRAM is allocated twice, but any time one PNG file is referenced multiple times, the VRAM is shared. Since the library system lets you share other packages' resources, using it almost always means a savings in VRAM.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Developer Hardware
    So...just how awesome is my main development machine? Not that awesome. Periodically users ask me what my setup is. Usually the user wants...
  • That's one biiiiig polygon
    Something I'm seeing now that WED is in beta: airport layouts with the entire taxiway structure made from one really complex polygon. I...
  • Caught With My Pants Down
    My friends say I have become a technological curmudgeon...whenever a new gadget or device or operating system comes out, I just grumble abo...
  • Who Am I?
    This week we've seen an increase in questions from new users, potential customers (both in the consumer and professional spaces) and thi...
  • Mirrored Normal Maps
    Normal maps in X-Plane 940 have a funny property: if you flip the normal map horizontally or vertically, the bumps change direction. Things...
  • What is a panel region?
    X-Plane 9 introduces a new OBJ feature: panel regions. The basic idea is this: In X-Plane 8 you could use the 2-d panel as a texture in you...
  • The Future of WED
    WED 1.0 has gone RC . The on ly change from beta 5 is that I have the latest manual changes from Tom (including Cormac's illustrations ...
  • The 3-d Panel Is Not Always Necessary
    There is no need to use the 3-d panel if you only want 3-d cockpit. That might be the most counter-intuitive statement in the entire univers...
  • OS X 10.6.3 Performance
    OS X 10.6.3 is out. Besides adding a bunch of OpenGL extensions*, it looks like vertex performance is improved on nVidia hardware. My quic...
  • Bad Alloc Crashes in 920 - Bad Timing
    I just received a series of reports today that certain converted scenery will cause X-Plane to crash with a "bad alloc" error. Ba...

Categories

  • absurdly cute
  • Air Traffic Control
  • aircraft
  • Android
  • animation
  • announce
  • cockpits
  • documentation
  • drivers
  • file formats
  • global scenery
  • Goofy Screenshots
  • hacks
  • hardware
  • hobbies
  • inside x-plane
  • installer
  • ipad
  • iphone
  • legal
  • localization
  • modeling
  • off topic
  • palm pre
  • panels
  • performance
  • plugins
  • political
  • scenery system
  • tools
  • X-Plane 10
  • XSquawkBox

Blog Archive

  • ►  2011 (12)
    • ►  February (1)
    • ►  January (11)
  • ►  2010 (111)
    • ►  December (4)
    • ►  November (4)
    • ►  October (10)
    • ►  September (9)
    • ►  August (12)
    • ►  July (8)
    • ►  June (4)
    • ►  May (13)
    • ►  April (13)
    • ►  March (11)
    • ►  February (12)
    • ►  January (11)
  • ►  2009 (130)
    • ►  December (16)
    • ►  November (11)
    • ►  October (6)
    • ►  September (16)
    • ►  August (12)
    • ►  July (11)
    • ►  June (9)
    • ►  May (5)
    • ►  April (10)
    • ►  March (9)
    • ►  February (9)
    • ►  January (16)
  • ►  2008 (147)
    • ►  December (18)
    • ►  November (10)
    • ►  October (7)
    • ►  September (11)
    • ►  August (15)
    • ►  July (9)
    • ►  June (14)
    • ►  May (9)
    • ►  April (14)
    • ►  March (13)
    • ►  February (6)
    • ►  January (21)
  • ▼  2007 (100)
    • ►  December (17)
    • ►  November (13)
    • ►  October (13)
    • ►  September (9)
    • ►  August (17)
    • ►  July (7)
    • ►  June (4)
    • ►  May (6)
    • ►  April (9)
    • ►  March (2)
    • ▼  February (3)
      • Fine Print: Water on the Bottom Please
      • Polygons Part 5 - Orthophotos
      • Polygons Part 4 - Anatomy of a .pol file
Powered by Blogger.

About Me

Unknown
View my complete profile