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-2013 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 #include "OgreHeaderPrefix.h" 00035 00036 namespace Ogre { 00136 class _OgreExport ShadowVolumeExtrudeProgram : public ShadowDataAlloc 00137 { 00138 private: 00139 static String mPointArbvp1; 00140 static String mPointVs_1_1; 00141 static String mPointVs_4_0; 00142 static String mPointVs_glsl; 00143 static String mPointVs_glsles; 00144 static String mDirArbvp1; 00145 static String mDirVs_1_1; 00146 static String mDirVs_4_0; 00147 static String mDirVs_glsl; 00148 static String mDirVs_glsles; 00149 // same as above, except the color is set to 1 to enable debug volumes to be seen 00150 static String mPointArbvp1Debug; 00151 static String mPointVs_1_1Debug; 00152 static String mPointVs_4_0Debug; 00153 static String mPointVs_glslDebug; 00154 static String mPointVs_glslesDebug; 00155 static String mDirArbvp1Debug; 00156 static String mDirVs_1_1Debug; 00157 static String mDirVs_4_0Debug; 00158 static String mDirVs_glslDebug; 00159 static String mDirVs_glslesDebug; 00160 00161 static String mPointArbvp1Finite; 00162 static String mPointVs_1_1Finite; 00163 static String mPointVs_4_0Finite; 00164 static String mPointVs_glslFinite; 00165 static String mPointVs_glslesFinite; 00166 static String mDirArbvp1Finite; 00167 static String mDirVs_1_1Finite; 00168 static String mDirVs_4_0Finite; 00169 static String mDirVs_glslFinite; 00170 static String mDirVs_glslesFinite; 00171 // same as above, except the color is set to 1 to enable debug volumes to be seen 00172 static String mPointArbvp1FiniteDebug; 00173 static String mPointVs_1_1FiniteDebug; 00174 static String mPointVs_4_0FiniteDebug; 00175 static String mPointVs_glslFiniteDebug; 00176 static String mPointVs_glslesFiniteDebug; 00177 static String mDirArbvp1FiniteDebug; 00178 static String mDirVs_1_1FiniteDebug; 00179 static String mDirVs_4_0FiniteDebug; 00180 static String mDirVs_glslFiniteDebug; 00181 static String mDirVs_glslesFiniteDebug; 00182 00183 static String mGeneralFs_4_0; 00184 static String mGeneralFs_glsl; 00185 static String mGeneralFs_glsles; 00186 00187 static bool mInitialised; 00188 00189 public: 00190 #define OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS 8 00191 enum Programs 00192 { 00193 // Point light extruder, infinite distance 00194 POINT_LIGHT = 0, 00195 // Point light extruder, infinite distance, debug mode 00196 POINT_LIGHT_DEBUG = 1, 00197 // Directional light extruder, infinite distance 00198 DIRECTIONAL_LIGHT = 2, 00199 // Directional light extruder, infinite distance, debug mode 00200 DIRECTIONAL_LIGHT_DEBUG = 3, 00201 // Point light extruder, finite distance 00202 POINT_LIGHT_FINITE = 4, 00203 // Point light extruder, finite distance, debug mode 00204 POINT_LIGHT_FINITE_DEBUG = 5, 00205 // Directional light extruder, finite distance 00206 DIRECTIONAL_LIGHT_FINITE = 6, 00207 // Directional light extruder, finite distance, debug mode 00208 DIRECTIONAL_LIGHT_FINITE_DEBUG = 7 00209 00210 }; 00211 static const String programNames[OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS]; 00212 static String frgProgramName; 00213 00215 static void initialise(void); 00217 static void shutdown(void); 00219 static const String& getPointLightExtruderArbvp1(void) { return mPointArbvp1; } 00221 static const String& getPointLightExtruderVs_1_1(void) { return mPointVs_1_1; } 00223 static const String& getPointLightExtruderVs_4_0(void) { return mPointVs_4_0; } 00225 static const String& getPointLightExtruderVs_glsl(void) { return mPointVs_glsl; } 00227 static const String& getPointLightExtruderVs_glsles(void) { return mPointVs_glsles; } 00229 static const String& getDirectionalLightExtruderArbvp1(void) { return mDirArbvp1; } 00231 static const String& getDirectionalLightExtruderVs_1_1(void) { return mDirVs_1_1; } 00233 static const String& getDirectionalLightExtruderVs_4_0(void) { return mDirVs_4_0; } 00235 static const String& getDirectionalLightExtruderVs_glsl(void) { return mDirVs_glsl; } 00237 static const String& getDirectionalLightExtruderVs_glsles(void) { return mDirVs_glsles; } 00238 00240 static const String& getPointLightExtruderArbvp1Debug(void) { return mPointArbvp1Debug; } 00242 static const String& getPointLightExtruderVs_1_1Debug(void) { return mPointVs_1_1Debug; } 00244 static const String& getPointLightExtruderVs_4_0Debug(void) { return mPointVs_4_0Debug; } 00246 static const String& getPointLightExtruderVs_glslDebug(void) { return mPointVs_glslDebug; } 00248 static const String& getPointLightExtruderVs_glslesDebug(void) { return mPointVs_glslesDebug; } 00250 static const String& getDirectionalLightExtruderArbvp1Debug(void) { return mDirArbvp1Debug; } 00252 static const String& getDirectionalLightExtruderVs_1_1Debug(void) { return mDirVs_1_1Debug; } 00254 static const String& getDirectionalLightExtruderVs_4_0Debug(void) { return mDirVs_4_0Debug; } 00256 static const String& getDirectionalLightExtruderVs_glslDebug(void) { return mDirVs_glslDebug; } 00258 static const String& getDirectionalLightExtruderVs_glslesDebug(void) { return mDirVs_glslesDebug; } 00260 static const String& getProgramSource(Light::LightTypes lightType, const String syntax, 00261 bool finite, bool debug); 00262 00263 static const String& getProgramName(Light::LightTypes lightType, bool finite, bool debug); 00264 00265 00267 static const String& getPointLightExtruderArbvp1Finite(void) { return mPointArbvp1Finite; } 00269 static const String& getPointLightExtruderVs_1_1Finite(void) { return mPointVs_1_1Finite; } 00271 static const String& getPointLightExtruderVs_4_0Finite(void) { return mPointVs_4_0Finite; } 00273 static const String& getPointLightExtruderVs_glslFinite(void) { return mPointVs_glslFinite; } 00275 static const String& getPointLightExtruderVs_glslesFinite(void) { return mPointVs_glslesFinite; } 00277 static const String& getDirectionalLightExtruderArbvp1Finite(void) { return mDirArbvp1Finite; } 00279 static const String& getDirectionalLightExtruderVs_1_1Finite(void) { return mDirVs_1_1Finite; } 00281 static const String& getDirectionalLightExtruderVs_4_0Finite(void) { return mDirVs_4_0Finite; } 00283 static const String& getDirectionalLightExtruderVs_glslFinite(void) { return mDirVs_glslFinite; } 00285 static const String& getDirectionalLightExtruderVs_glslesFinite(void) { return mDirVs_glslesFinite; } 00286 00288 static const String& getPointLightExtruderArbvp1FiniteDebug(void) { return mPointArbvp1FiniteDebug; } 00290 static const String& getPointLightExtruderVs_1_1FiniteDebug(void) { return mPointVs_1_1FiniteDebug; } 00292 static const String& getPointLightExtruderVs_4_0FiniteDebug(void) { return mPointVs_4_0FiniteDebug; } 00294 static const String& getPointLightExtruderVs_glslFiniteDebug(void) { return mPointVs_glslFiniteDebug; } 00296 static const String& getPointLightExtruderVs_glslesFiniteDebug(void) { return mPointVs_glslesFiniteDebug; } 00298 static const String& getDirectionalLightExtruderArbvp1FiniteDebug(void) { return mDirArbvp1FiniteDebug; } 00300 static const String& getDirectionalLightExtruderVs_1_1FiniteDebug(void) { return mDirVs_1_1FiniteDebug; } 00302 static const String& getDirectionalLightExtruderVs_4_0FiniteDebug(void) { return mDirVs_4_0FiniteDebug; } 00304 static const String& getDirectionalLightExtruderVs_glslFiniteDebug(void) { return mDirVs_glslFiniteDebug; } 00306 static const String& getDirectionalLightExtruderVs_glslesFiniteDebug(void) { return mDirVs_glslesFiniteDebug; } 00307 00308 }; 00311 } 00312 00313 #include "OgreHeaderSuffix.h" 00314 00315 #endif
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:40:47