00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright (c) 2000-2012 Torus Knot Software Ltd 00008 00009 Permission is hereby granted, free of charge, to any person obtaining a copy 00010 of this software and associated documentation files (the "Software"), to deal 00011 in the Software without restriction, including without limitation the rights 00012 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00013 copies of the Software, and to permit persons to whom the Software is 00014 furnished to do so, subject to the following conditions: 00015 00016 The above copyright notice and this permission notice shall be included in 00017 all copies or substantial portions of the Software. 00018 00019 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00020 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00021 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00022 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00023 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00024 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00025 THE SOFTWARE. 00026 ----------------------------------------------------------------------------- 00027 */ 00028 00029 #ifndef __SHADOWVOLUMEEXTRUDEPROGRAM_H__ 00030 #define __SHADOWVOLUMEEXTRUDEPROGRAM_H__ 00031 00032 #include "OgrePrerequisites.h" 00033 #include "OgreLight.h" 00034 00035 namespace Ogre { 00135 class _OgreExport ShadowVolumeExtrudeProgram : public ShadowDataAlloc 00136 { 00137 private: 00138 static String mPointArbvp1; 00139 static String mPointVs_1_1; 00140 static String mPointVs_4_0; 00141 static String mPointVs_glsles; 00142 static String mDirArbvp1; 00143 static String mDirVs_1_1; 00144 static String mDirVs_4_0; 00145 static String mDirVs_glsles; 00146 // same as above, except the color is set to 1 to enable debug volumes to be seen 00147 static String mPointArbvp1Debug; 00148 static String mPointVs_1_1Debug; 00149 static String mPointVs_4_0Debug; 00150 static String mPointVs_glslesDebug; 00151 static String mDirArbvp1Debug; 00152 static String mDirVs_1_1Debug; 00153 static String mDirVs_4_0Debug; 00154 static String mDirVs_glslesDebug; 00155 00156 static String mPointArbvp1Finite; 00157 static String mPointVs_1_1Finite; 00158 static String mPointVs_4_0Finite; 00159 static String mPointVs_glslesFinite; 00160 static String mDirArbvp1Finite; 00161 static String mDirVs_1_1Finite; 00162 static String mDirVs_4_0Finite; 00163 static String mDirVs_glslesFinite; 00164 // same as above, except the color is set to 1 to enable debug volumes to be seen 00165 static String mPointArbvp1FiniteDebug; 00166 static String mPointVs_1_1FiniteDebug; 00167 static String mPointVs_4_0FiniteDebug; 00168 static String mPointVs_glslesFiniteDebug; 00169 static String mDirArbvp1FiniteDebug; 00170 static String mDirVs_1_1FiniteDebug; 00171 static String mDirVs_4_0FiniteDebug; 00172 static String mDirVs_glslesFiniteDebug; 00173 00174 static String mGeneralFs_4_0; 00175 static String mGeneralFs_glsles; 00176 00177 static bool mInitialised; 00178 00179 public: 00180 #define OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS 8 00181 enum Programs 00182 { 00183 // Point light extruder, infinite distance 00184 POINT_LIGHT = 0, 00185 // Point light extruder, infinite distance, debug mode 00186 POINT_LIGHT_DEBUG = 1, 00187 // Directional light extruder, infinite distance 00188 DIRECTIONAL_LIGHT = 2, 00189 // Directional light extruder, infinite distance, debug mode 00190 DIRECTIONAL_LIGHT_DEBUG = 3, 00191 // Point light extruder, finite distance 00192 POINT_LIGHT_FINITE = 4, 00193 // Point light extruder, finite distance, debug mode 00194 POINT_LIGHT_FINITE_DEBUG = 5, 00195 // Directional light extruder, finite distance 00196 DIRECTIONAL_LIGHT_FINITE = 6, 00197 // Directional light extruder, finite distance, debug mode 00198 DIRECTIONAL_LIGHT_FINITE_DEBUG = 7 00199 00200 }; 00201 static const String programNames[OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS]; 00202 static String frgProgramName; 00203 00205 static void initialise(void); 00207 static void shutdown(void); 00209 static const String& getPointLightExtruderArbvp1(void) { return mPointArbvp1; } 00211 static const String& getPointLightExtruderVs_1_1(void) { return mPointVs_1_1; } 00213 static const String& getPointLightExtruderVs_4_0(void) { return mPointVs_4_0; } 00215 static const String& getPointLightExtruderVs_glsles(void) { return mPointVs_glsles; } 00217 static const String& getDirectionalLightExtruderArbvp1(void) { return mDirArbvp1; } 00219 static const String& getDirectionalLightExtruderVs_1_1(void) { return mDirVs_1_1; } 00221 static const String& getDirectionalLightExtruderVs_4_0(void) { return mDirVs_4_0; } 00223 static const String& getDirectionalLightExtruderVs_glsles(void) { return mDirVs_glsles; } 00224 00226 static const String& getPointLightExtruderArbvp1Debug(void) { return mPointArbvp1Debug; } 00228 static const String& getPointLightExtruderVs_1_1Debug(void) { return mPointVs_1_1Debug; } 00230 static const String& getPointLightExtruderVs_4_0Debug(void) { return mPointVs_4_0Debug; } 00232 static const String& getPointLightExtruderVs_glslesDebug(void) { return mPointVs_glslesDebug; } 00234 static const String& getDirectionalLightExtruderArbvp1Debug(void) { return mDirArbvp1Debug; } 00236 static const String& getDirectionalLightExtruderVs_1_1Debug(void) { return mDirVs_1_1Debug; } 00238 static const String& getDirectionalLightExtruderVs_4_0Debug(void) { return mDirVs_4_0Debug; } 00240 static const String& getDirectionalLightExtruderVs_glslesDebug(void) { return mDirVs_glslesDebug; } 00242 static const String& getProgramSource(Light::LightTypes lightType, const String syntax, 00243 bool finite, bool debug); 00244 00245 static const String& getProgramName(Light::LightTypes lightType, bool finite, bool debug); 00246 00247 00249 static const String& getPointLightExtruderArbvp1Finite(void) { return mPointArbvp1Finite; } 00251 static const String& getPointLightExtruderVs_1_1Finite(void) { return mPointVs_1_1Finite; } 00253 static const String& getPointLightExtruderVs_4_0Finite(void) { return mPointVs_4_0Finite; } 00255 static const String& getPointLightExtruderVs_glslesFinite(void) { return mPointVs_glslesFinite; } 00257 static const String& getDirectionalLightExtruderArbvp1Finite(void) { return mDirArbvp1Finite; } 00259 static const String& getDirectionalLightExtruderVs_1_1Finite(void) { return mDirVs_1_1Finite; } 00261 static const String& getDirectionalLightExtruderVs_4_0Finite(void) { return mDirVs_4_0Finite; } 00263 static const String& getDirectionalLightExtruderVs_glslesFinite(void) { return mDirVs_glslesFinite; } 00264 00266 static const String& getPointLightExtruderArbvp1FiniteDebug(void) { return mPointArbvp1FiniteDebug; } 00268 static const String& getPointLightExtruderVs_1_1FiniteDebug(void) { return mPointVs_1_1FiniteDebug; } 00270 static const String& getPointLightExtruderVs_4_0FiniteDebug(void) { return mPointVs_4_0FiniteDebug; } 00272 static const String& getPointLightExtruderVs_glslesFiniteDebug(void) { return mPointVs_glslesFiniteDebug; } 00274 static const String& getDirectionalLightExtruderArbvp1FiniteDebug(void) { return mDirArbvp1FiniteDebug; } 00276 static const String& getDirectionalLightExtruderVs_1_1FiniteDebug(void) { return mDirVs_1_1FiniteDebug; } 00278 static const String& getDirectionalLightExtruderVs_4_0FiniteDebug(void) { return mDirVs_4_0FiniteDebug; } 00280 static const String& getDirectionalLightExtruderVs_glslesFiniteDebug(void) { return mDirVs_glslesFiniteDebug; } 00281 00282 }; 00285 } 00286 #endif
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:36:27 2012