The actual draw order for airplane-related objects is this:
- Far away weapons.
- All of the airplanes that we are not inside (this means the user's plane in an external view, and AI planes all the time). For each of these planes, the external cockpit object is drawn first, then the parts, then the attached objects in order.
- Clouds and puffs and other such environmental phenomena.
- The geometry of our plane, if it is to be drawn and we are in an inside view.
- The attached objects in order for our plane, if internal geometry is drawn and we are in an inside view.
- Weapons that are very close to the plane.
- The inside cockpit object, if we are inside the plane.
- Note that weapons appear twice in the category of "near" and "far". This is all about the clipping plane - if a weapon is close to us, it must be drawn with the cockpit object, late in the draw cycle, when we are doing "close" things. Weapons are treated dynamically - they change where they are in the draw cycle depending on their position in space. This is necessary because a weapon starts out real close (just off your wing) and then goes real far away.
- The user's airplane is special-cased when we are in an internal view ... at that point if external things are being drawn, they are done in the later "close" view with the cockpit.
- The external cockpit object is (strangely) quite early in the draw order. There's really no good reason for that. What's particularly annoying is that it's inconsistent with the internal draw order. The main point of internal/external cockpit objects is to let you simplify your cockpit object in external view for performance.
- Put any translucent windshield/canopy/etc. in the last attached object.
- Put only the interior panel (and not the canopy) in the cockpit object.
No comments:
Post a Comment