00001 /* -*-c++-*- 00002 * 00003 * Copyright (C) 2006-2007 Tim Moore 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License as 00007 * published by the Free Software Foundation; either version 2 of the 00008 * License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00018 * MA 02110-1301, USA. 00019 * 00020 */ 00021 00022 #ifndef SIMGEAR_RENDER_CONSTANTS_HXX 00023 #define SIMGEAR_RENDER_CONSTANTS_HXX 00024 // Constants used in the scene graph, both node masks and render bins. 00025 namespace simgear { 00026 00027 enum NodeMask { 00028 TERRAIN_BIT = (1 << 0), 00029 MAINMODEL_BIT = (1 << 1), 00030 CASTSHADOW_BIT = (1 << 2), 00031 RECEIVESHADOW_BIT = (1 << 3), 00032 GUI_BIT = (1 << 4), 00033 PANEL2D_BIT = (1 << 5), 00034 PICK_BIT = (1 << 6), 00035 // Different classes of lights turned on by node masks 00036 GROUNDLIGHTS0_BIT = (1 << 7), 00037 GROUNDLIGHTS1_BIT = (1 << 8), 00038 GROUNDLIGHTS2_BIT = (1 << 9), 00039 RUNWAYLIGHTS_BIT = (1 << 10), 00040 LIGHTS_BITS = (GROUNDLIGHTS0_BIT | GROUNDLIGHTS1_BIT | GROUNDLIGHTS2_BIT 00041 | RUNWAYLIGHTS_BIT), 00042 // Sky parts 00043 BACKGROUND_BIT = (1 << 11), 00044 // Everything else that isn't terrain. Initially for clouds; 00045 // eventually for other models? 00046 MODEL_BIT = (1 << 12) 00047 }; 00048 00049 // Theory of bin numbering: 00050 // 00051 // Normal opaque objects are assigned bin 0. 00052 // 00053 // Random objects like trees may have transparency, but there are too 00054 // many to depth sort individually. By drawing them after the terrain 00055 // we can at least keep the sky under the ground from poking through. 00056 // 00057 // Point lights blend with the terrain to simulate attenuation but 00058 // should completely obscure any transparent geometry behind 00059 // them. Also, they should be visible through semi-transparent cloud 00060 // layers, so they are rendered before the cloud layers. 00061 // 00062 // Clouds layers can't be depth sorted because they are too big, so 00063 // they are rendered before other transparent objects. The layer 00064 // partial ordering is handled in the clouds code. 00065 // 00066 // OSG and its file loaders throw all transparent objects into bin 10. 00067 00068 enum RenderBin { 00069 RANDOM_OBJECTS_BIN = 2, 00070 POINT_LIGHTS_BIN = 8, 00071 CLOUDS_BIN = 9, 00072 TRANSPARENT_BIN = 10 // assigned by OSG 00073 }; 00074 } 00075 #endif