New ways to have fun with CFS1

Chapter 3

The following chapters will deal with colors. We'll study first the "old" coloring system that dates back to the beginnings of flight simulation, but is still very present in CFS1, and then the "new" one. This is important because most polygons, even the textured ones, need a color, if only to fall back on when texturing go "haywire". Knowing which coloring method, or methods, are being used, their advantages and limitations and, when the need arises, how to change, not only the color, but the coloring method is an advantage that even AF99 users don't have... unless they're ready to delve into SCASMing.

Colors (part one) - Our canvas; The cube 

To begin, we will build a cube. This cube will play an important role for many lessons to come. I am reproducing here a drawing that was used in chapter 2 to build the "yard". It uses the same eight points' declaration. We will simply add a top and a bottom to the ensemble.



:BEGINNING
Call( :TheCube )
Return

:TheCube ;10x10x10 cube
Points( 1 ; 8 points
780 0 780 ; 1
780 1560 780 ; 2
780 1560 -780 ; 3
780 0 -780 ; 4
-780 0 780 ; 5
-780 1560 780 ; 6
-780 1560 -780 ; 7
-780 0 -780 ; 8
)
SurfaceColor( 05 F0 ) ;red
Poly( ai 5 8 4 1 ) ;bottom int
Poly( ai 2 3 7 6 ) ;top int
Poly( ai 1 2 6 5 ) ;fore int
Poly( ai 8 7 3 4 ) ;aft int
Poly( ai 4 3 2 1 ) ;right int
Poly( ai 5 6 7 8 ) ;left int
SurfaceColor( 06 F0 ) ;green
Poly( a 5 8 4 1 ) ;bottom ext
Poly( a 2 3 7 6 ) ;top ext
Poly( a 1 2 6 5 ) ;fore ext
Poly( a 8 7 3 4 ) ;aft ext
Poly( a 4 3 2 1 ) ;right ext
Poly( a 5 6 7 8 ) ;left ext
Return


You will note that two subroutines have been created (:BEGINNING and :TheCube). The first subroutine simply call the second one, why? Because, this way, ":BEGINNING" will always be the first subroutine called, no matter what other subroutines it will call in return. When we'll add other subroutines,and we certainly will, they'll always be tied-up in some ways to ":BEGINNING" without having to change that Label called in the opening lines three times. This, in turn, increases the reading delay, but so lightly that it doesn't really matter. The advantages outweigh the inconveniences by a fairly large margin as the Call command is one of the fastest read, if not the fastest.

The second subroutine is basically what ":BEGINNING" used to be. The description line is behind semi-colon after the Label ":TheCube", which is pretty much self-describing. All  six surfaces are painted first from the interior, then from the exterior. Note that the bottom points' calling is done counterclockwise so that red will be in the interior. The other surfaces will automatically choose the "right" side to be painted. Return and read the previous chapter if you don't understand the "special treatment" we're reserving to the bottom polygon.

Once compiled, you should see an interior with some different shades of red (S key once), this is called "hard shading" and will do the job for rectangular or "un-round" shapes. But the exterior view is much more interesting to look at;

the green also appear in different shades. If you let time go by (hint; use CFOWeather "Time and Season") you'll see this;



This is a view from 6 AM to 6 PM from 10h30 O'clock high. At night, the cube, internally and externally, will be pitch black;



These are "old" colors dating back to FS4, maybe even older,  but still in use in AF99. The command line goes this way;

SurfaceColor( num attr )

Where num is the hexadecimal color code (you will often see 0x, a prefix announcing an hex number, in SCASM SCX) and attr the color attribute, also hexadecimal. The attribute F0, most frequently used, is for normal colors changing with sun ray's direction. This will be studied next.

Documented F0 attribute colors

The following list does enumerate the documented solid F0 colors. A more extensive list will come later;
----------------
Colour Name / 16bit (hexadecimal) Value
C_BLACK / 00
C_DKGRAY / 01
C_GRAY / 02
C_LTGRAY / 03
C_WHITE / 04
C_RED / 05
C_GREEN / 06
C_BLUE / 07
C_ORANGE / 08
C_YELLOW / 09
C_BROWN / 0A
C_TAN / 0B
C_BRICK / 0C
C_OLIVE / 0D
C_WATER / 0E


All these colors are shaded during daylight and pitch black at night.

----------------

C_BRIGHT_RED / 0F
C_BRIGHT_GREEN / 10
C_BRIGHT_BLUE / 11
C_BRIGHT_AQUA / 12
C_BRIGHT_ORANGE / 13
C_BRIGHT_YELLOW / 14
C_BRIGHT_WHITE / 15
C_CONST_WHITE / 16


All these colors are unshaded during daylight(image on top), which explains why we can't see the box angles, and keep their colors at night (bottom). Can't say for sure if there's a difference between 15 and 16, maybe the latter is a tid bit brighter, maybe.

----------------
C_DARK_RED / 17
C_DARK_GREEN / 18
C_DARK_BLUE / 19
C_DARK_ORANGE / 1A
C_DARK_YELLOW / 1B
C_DARK_BROWN / 1C
C_DARK_TAN / 1D
C_DARK_BRICK / 1E
C_DARK_OLIVE / 1F


Darker shaded colors during daylight but pitch black at night. Similar to 00 - 0E in properties.

----------------
C_MED_RED / 20
C_MED_GREEN / 21
C_MED_BLUE / 22
C_MED_ORANGE / 23
C_MED_YELLOW / 24
C_MED_BROWN / 25
C_MED_TAN / 26
C_MED_BRICK / 27
C_MED_OLIVE / 28


Medium-dark shaded colors during daylight but pitch black at night. Similar to 00 - 0E in properties.

----------------
C_LIGHT_RED / 29
C_LIGHT_GREEN / 2A
C_LIGHT_BLUE / 2B
C_LIGHT_ORANGE / 2C
C_LIGHT_YELLOW / 2D
C_LIGHT_BROWN / 2E
C_LIGHT_TAN / 2F
C_LIGHT_BRICK / 30
C_LIGHT_OLIVE / 31


Lighter dark shaded colors during daylight but pitch black at night. Similar to 00 - 0E in properties.

----------------
C_BRIGHT_DKGRAY / 32
C_BRIGHT_GRAY / 33
C_BRIGHT_LTGRAY / 34


Unshaded gray tones during daylight visible at night. Similar to 0F - 16 in properties.

----------------

These are "officials" F0 attribute colors. The palette is limited but sufficient for basic objects. Anyway, this is what AF99 has to offer in terms of solid colors. When examining a model build with it, you will often see them.

But what goes beyond the "officials" F0 colors? 

Un-documented F0 attribute colors

Normally, I would have stopped at color 34 and be satisfied whit it. But further experimentation revealed a world of colors I was unaware of. So, out of curiosity, I went back to solid colors beyond 34. This is what I've found;



These colors are not disorganized, which proves that they are not placed aleatory. This palette is filled with pitch black entries, all removed here, that tend to make you think they are. Some are simply doubles of previous colors, but many do offer different nuances, and some are night colors. I stopped at 117 because it was starting to get redundant, but you may explore even further. 

The series between 9F and AF is of particular interest; it gives a pitch black in daylight that turns into a shade of orange at night. Apparently, these colors were used in creating "glow in the dark" panels and dials in the "old" FS. I also found, quite by accident,  "weird" colors between EF and FF. As an example, here is F3 from 4 AM to daylight;



As you can see it goes through gray, then red, then green and, finally, blue tones. Each "colors" has its own sequence, and F3 is not the wildest one! Here is FF in all its weirdness;


I don't have many uses for them in mind right now, but we never know!

Conclusions

F0 colors are limited in tones and shades but, with the "extended" palette, your choices appears less limited. They are very useful for "quick n' dirty" colors, especially for small objects that are left untextured like pitot tube, antennas, air intakes, and the likes. The "glow in the dark" colors make very convincing lights and lights effects. All these colors are "framerate-friendly".