OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCompositorShadowNodeDef.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __CompositorShadowNodeDef_H__
30 #define __CompositorShadowNodeDef_H__
31 
32 #include "OgreHeaderPrefix.h"
33 
35 #include "OgreMath.h"
36 
37 namespace Ogre
38 {
47  {
48  SHADOWMAP_UNIFORM, //Default
52  };
53 
56  {
57  public:
60  float widthFactor;
61  float heightFactor;
62  PixelFormatList formatList; // more than one means MRT
63  uint fsaa; // FSAA level
64  bool hwGammaWrite; // Do sRGB gamma correction on write (only 8-bit per channel formats)
65  uint16 depthBufferId; // Depth Buffer's pool ID
66 
67  size_t light; //Render Nth closest light
68  size_t split; //Split for that light (only for PSSM/CSM)
69 
71 
72  //PSSM params
76 
77  protected:
80 
81  public:
83  size_t _light, size_t _split ) :
84  width(1024), height(1024), fsaa(0), hwGammaWrite(false), depthBufferId(2),
85  light(_light), split(_split), shadowMapTechnique(t),
86  pssmLambda( 0.95f ), splitPadding( 1.0f ), numSplits( 3 ),
87  name( _name ), sharesSetupWith( -1 ) {}
88 
89  IdString getName() const { return name; }
90 
91  void _setSharesSetupWithIdx( size_t idx ) { sharesSetupWith = idx; }
92  size_t getSharesSetupWith() const { return sharesSetupWith; }
93  };
94 
109  {
110  friend class CompositorShadowNode;
111 
112  protected:
116 
118  size_t mNumLights;
119  size_t mMinRq; //Minimum RQ included by one of our passes
120  size_t mMaxRq; //Maximum RQ included by one of our passes
121 
122  IdString addShadowTextureSourceName( const String &name, size_t index,
123  TextureSource textureSource );
124 
125  public:
126  CompositorShadowNodeDef( const String &name, CompositorManager2 *compositorManager ) :
127  CompositorNodeDef( name, compositorManager ), mDefaultTechnique( SHADOWMAP_UNIFORM ),
128  mNumLights( 0 ), mMinRq( ~0 ), mMaxRq( 0 ) {}
130 
132  virtual IdString addTextureSourceName( const String &name, size_t index,
133  TextureSource textureSource );
134 
135  void setDefaultTechnique( ShadowMapTechniques techn ) { mDefaultTechnique = techn; }
136 
143  void setNumShadowTextureDefinitions( size_t numTex )
144  { mShadowMapTexDefinitions.reserve( numTex ); }
145 
162  ShadowTextureDefinition* addShadowTextureDefinition( size_t lightIdx, size_t split,
163  const String &name, bool isAtlas );
164 
173  virtual void _validateAndFinish(void);
174  };
175 
178 }
179 
180 #include "OgreHeaderSuffix.h"
181 
182 #endif
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:255
Compositor nodes are the core subject of compositing.
void setNumShadowTextureDefinitions(size_t numTex)
Reserves enough memory for all texture definitions.
ShadowTextureDefinition(ShadowMapTechniques t, IdString _name, size_t _light, size_t _split)
vector< PixelFormat >::type PixelFormatList
void setDefaultTechnique(ShadowMapTechniques techn)
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Hashed string.
Definition: OgreIdString.h:94
Shadow Nodes are special nodes (not to be confused with.
size_t mNumLights
Not the same as mShadowMapTexDefinitions.size(), because splits aren't included.
CompositorShadowNodeDef(const String &name, CompositorManager2 *compositorManager)
_StringBase String
Definition: OgreCommon.h:53
vector< ShadowTextureDefinition >::type ShadowMapTexDefVec
unsigned short uint16
Definition: OgrePlatform.h:421
Shadow Nodes are special nodes (not to be confused with.
Main system for managing Render Targets through the use of nodes.
unsigned int uint