# OgreShadowVolumeExtrudeProgram.h

Go to the documentation of this file.

    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-2009 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 mDirArbvp1;
    00142         static String mDirVs_1_1;
    00143         static String mDirVs_4_0;
    00144         // same as above, except the color is set to 1 to enable debug volumes to be seen
    00145         static String mPointArbvp1Debug;
    00146         static String mPointVs_1_1Debug;
    00147         static String mPointVs_4_0Debug;
    00148         static String mDirArbvp1Debug;
    00149         static String mDirVs_1_1Debug;
    00150         static String mDirVs_4_0Debug;
    00151
    00152         static String mPointArbvp1Finite;
    00153         static String mPointVs_1_1Finite;
    00154         static String mPointVs_4_0Finite;
    00155         static String mDirArbvp1Finite;
    00156         static String mDirVs_1_1Finite;
    00157         static String mDirVs_4_0Finite;
    00158         // same as above, except the color is set to 1 to enable debug volumes to be seen
    00159         static String mPointArbvp1FiniteDebug;
    00160         static String mPointVs_1_1FiniteDebug;
    00161         static String mPointVs_4_0FiniteDebug;
    00162         static String mDirArbvp1FiniteDebug;
    00163         static String mDirVs_1_1FiniteDebug;
    00164         static String mDirVs_4_0FiniteDebug;
    00165
    00166         static String mGeneralFs_4_0;
    00167
    00168         static bool mInitialised;
    00169
    00170     public:
    00171 #define OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS 8
    00172         enum Programs
    00173         {
    00174             // Point light extruder, infinite distance
    00175             POINT_LIGHT = 0,
    00176             // Point light extruder, infinite distance, debug mode
    00177             POINT_LIGHT_DEBUG = 1,
    00178             // Directional light extruder, infinite distance
    00179             DIRECTIONAL_LIGHT = 2,
    00180             // Directional light extruder, infinite distance, debug mode
    00181             DIRECTIONAL_LIGHT_DEBUG = 3,
    00182             // Point light extruder, finite distance
    00183             POINT_LIGHT_FINITE = 4,
    00184             // Point light extruder, finite distance, debug mode
    00185             POINT_LIGHT_FINITE_DEBUG = 5,
    00186             // Directional light extruder, finite distance
    00187             DIRECTIONAL_LIGHT_FINITE = 6,
    00188             // Directional light extruder, finite distance, debug mode
    00189             DIRECTIONAL_LIGHT_FINITE_DEBUG = 7
    00190
    00191         };
    00192         static const String programNames[OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS];
    00193         static String frgProgramName;
    00194
    00196         static void initialise(void);
    00198         static void shutdown(void);
    00200         static const String& getPointLightExtruderArbvp1(void) { return mPointArbvp1; }
    00202         static const String& getPointLightExtruderVs_1_1(void) { return mPointVs_1_1; }
    00204         static const String& getPointLightExtruderVs_4_0(void) { return mPointVs_4_0; }
    00206         static const String& getDirectionalLightExtruderArbvp1(void) { return mDirArbvp1; }
    00208         static const String& getDirectionalLightExtruderVs_1_1(void) { return mDirVs_1_1; }
    00210         static const String& getDirectionalLightExtruderVs_4_0(void) { return mDirVs_4_0; }
    00211
    00213         static const String& getPointLightExtruderArbvp1Debug(void) { return mPointArbvp1Debug; }
    00215         static const String& getPointLightExtruderVs_1_1Debug(void) { return mPointVs_1_1Debug; }
    00217         static const String& getPointLightExtruderVs_4_0Debug(void) { return mPointVs_4_0Debug; }
    00219         static const String& getDirectionalLightExtruderArbvp1Debug(void) { return mDirArbvp1Debug; }
    00221         static const String& getDirectionalLightExtruderVs_1_1Debug(void) { return mDirVs_1_1Debug; }
    00223         static const String& getDirectionalLightExtruderVs_4_0Debug(void) { return mDirVs_4_0Debug; }
    00225         static const String& getProgramSource(Light::LightTypes lightType, const String syntax,
    00226             bool finite, bool debug);
    00227
    00228         static const String& getProgramName(Light::LightTypes lightType, bool finite, bool debug);
    00229
    00230
    00232         static const String& getPointLightExtruderArbvp1Finite(void) { return mPointArbvp1Finite; }
    00234         static const String& getPointLightExtruderVs_1_1Finite(void) { return mPointVs_1_1Finite; }
    00236         static const String& getPointLightExtruderVs_4_0Finite(void) { return mPointVs_4_0Finite; }
    00238         static const String& getDirectionalLightExtruderArbvp1Finite(void) { return mDirArbvp1Finite; }
    00240         static const String& getDirectionalLightExtruderVs_1_1Finite(void) { return mDirVs_1_1Finite; }
    00242         static const String& getDirectionalLightExtruderVs_4_0Finite(void) { return mDirVs_4_0Finite; }
    00243
    00245         static const String& getPointLightExtruderArbvp1FiniteDebug(void) { return mPointArbvp1FiniteDebug; }
    00247         static const String& getPointLightExtruderVs_1_1FiniteDebug(void) { return mPointVs_1_1FiniteDebug; }
    00249         static const String& getPointLightExtruderVs_4_0FiniteDebug(void) { return mPointVs_4_0FiniteDebug; }
    00251         static const String& getDirectionalLightExtruderArbvp1FiniteDebug(void) { return mDirArbvp1FiniteDebug; }
    00253         static const String& getDirectionalLightExtruderVs_1_1FiniteDebug(void) { return mDirVs_1_1FiniteDebug; }
    00255         static const String& getDirectionalLightExtruderVs_4_0FiniteDebug(void) { return mDirVs_4_0FiniteDebug; }
    00256
    00257
    00258
    00259
    00260     };
    00263 }
    00264 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun May 8 2011 20:28:09