RigsofRods
Soft-body Physics Simulation
OgreTerrainPSSMMaterialGenerator.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-2012 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 #pragma once
30 
31 #include <Terrain/OgreTerrainPrerequisites.h>
32 #include <Terrain/OgreTerrainMaterialGenerator.h>
33 #include <OgreGpuProgramParams.h>
34 
35 namespace Ogre {
36 class PSSMShadowCameraSetup;
37 
38 
39 
44 class TerrainPSSMMaterialGenerator : public TerrainMaterialGenerator
45 {
46 public:
49 
52  class SM2Profile : public TerrainMaterialGenerator::Profile
53  {
54  public:
55  SM2Profile(TerrainMaterialGenerator* parent, const String& name, const String& desc);
56  ~SM2Profile();
57  MaterialPtr generate(const Terrain* terrain);
58  MaterialPtr generateForCompositeMap(const Terrain* terrain);
59  uint8 getMaxLayers(const Terrain* terrain) const;
60  void updateParams(const MaterialPtr& mat, const Terrain* terrain);
61  void updateParamsForCompositeMap(const MaterialPtr& mat, const Terrain* terrain);
62  void requestOptions(Terrain* terrain);
63  bool isVertexCompressionSupported() const;
64 
70  void setLayerNormalMappingEnabled(bool enabled);
71 
77  void setLayerParallaxMappingEnabled(bool enabled);
78 
84  void setLayerSpecularMappingEnabled(bool enabled);
85 
93  void setGlobalColourMapEnabled(bool enabled);
94 
98  bool isLightmapEnabled() const { return mLightmapEnabled; }
102  void setLightmapEnabled(bool enabled);
103 
111  void setCompositeMapEnabled(bool enabled);
112 
120  void setReceiveDynamicShadowsEnabled(bool enabled);
121 
125  void setReceiveDynamicShadowsPSSM(PSSMShadowCameraSetup* pssmSettings);
126 
130  PSSMShadowCameraSetup* getReceiveDynamicShadowsPSSM() const { return mPSSM; }
133  void setReceiveDynamicShadowsDepth(bool enabled);
134 
140  void setReceiveDynamicShadowsLowLod(bool enabled);
141 
145 
147  bool _isSM3Available() const { return mSM3Available; }
148  bool _isSM4Available() const { return mSM4Available; }
149 
150  protected:
151 
153  {
157  };
158 
159  void addTechnique(const MaterialPtr& mat, const Terrain* terrain, TechniqueType tt);
160 
162  class ShaderHelper : public TerrainAlloc
163  {
164  public:
166  {
167  }
168 
169  virtual ~ShaderHelper()
170  {
171  }
172 
173  virtual HighLevelGpuProgramPtr generateVertexProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
174  virtual HighLevelGpuProgramPtr generateFragmentProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
175  virtual void updateParams(const SM2Profile* prof, const MaterialPtr& mat, const Terrain* terrain, bool compositeMap);
176  protected:
177  virtual String getVertexProgramName(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
178  virtual String getFragmentProgramName(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
179  virtual HighLevelGpuProgramPtr createVertexProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt) = 0;
180  virtual HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt) = 0;
181  virtual void generateVertexProgramSource(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
182  virtual void generateFragmentProgramSource(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
183  virtual void generateVpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) = 0;
184  virtual void generateFpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) = 0;
185  virtual void generateVpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream) = 0;
186  virtual void generateFpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream) = 0;
187  virtual void generateVpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) = 0;
188  virtual void generateFpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) = 0;
189  virtual void defaultVpParams(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, const HighLevelGpuProgramPtr& prog);
190  virtual void defaultFpParams(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, const HighLevelGpuProgramPtr& prog);
191  virtual void updateVpParams(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, const GpuProgramParametersSharedPtr& params);
192  virtual void updateFpParams(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, const GpuProgramParametersSharedPtr& params);
193  static String getChannel(uint idx);
194 
197  };
198 
201  {
202  protected:
203  HighLevelGpuProgramPtr createVertexProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
204  HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
205  void generateVpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
206  void generateFpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
207  void generateVpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream);
208  void generateFpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream);
209  void generateVpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
210  void generateFpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
211  uint generateVpDynamicShadowsParams(uint texCoordStart, const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
212  void generateVpDynamicShadows(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
213  void generateFpDynamicShadowsHelpers(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
214  void generateFpDynamicShadowsParams(uint* texCoord, uint* sampler, const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
215  void generateFpDynamicShadows(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream);
216  };
217 
219  {
220  protected:
221  HighLevelGpuProgramPtr createVertexProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
222  HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
223  };
224 
227  {
228  protected:
229  HighLevelGpuProgramPtr createVertexProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
230  HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
231 
232  void generateVpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
233 
234  void generateFpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
235 
236  void generateVpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream) {}
237 
238  void generateFpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream) {}
239 
240  void generateVpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
241 
242  void generateFpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
243  };
244 
247  {
248  protected:
249  HighLevelGpuProgramPtr createVertexProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
250  HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt);
251 
252  void generateVpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
253 
254  void generateFpHeader(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
255 
256  void generateVpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream) {}
257 
258  void generateFpLayer(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType& outStream) {}
259 
260  void generateVpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
261 
262  void generateFpFooter(const SM2Profile* prof, const Terrain* terrain, TechniqueType tt, StringUtil::StrStreamType& outStream) {}
263  };
264 
273  PSSMShadowCameraSetup* mPSSM;
278 
279  bool isShadowingEnabled(TechniqueType tt, const Terrain* terrain) const;
280  };
281 };
282 
283 }
284 
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperHLSL
Definition: OgreTerrainPSSMMaterialGenerator.h:218
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mLayerNormalMappingEnabled
bool mLayerNormalMappingEnabled
Definition: OgreTerrainPSSMMaterialGenerator.h:266
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::createFragmentProgram
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1731
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper
Interface definition for helper class to generate shaders.
Definition: OgreTerrainPSSMMaterialGenerator.h:162
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::defaultVpParams
virtual void defaultVpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const HighLevelGpuProgramPtr &prog)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:521
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::createVertexProgram
virtual HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::getChannel
static String getChannel(uint idx)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:667
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setLayerNormalMappingEnabled
void setLayerNormalMappingEnabled(bool enabled)
Whether to support normal mapping per layer in the shader (default true).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:111
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateVpHeader
virtual void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateFpLayer
virtual void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isLayerNormalMappingEnabled
bool isLayerNormalMappingEnabled() const
Whether to support normal mapping per layer in the shader (default true).
Definition: OgreTerrainPSSMMaterialGenerator.h:67
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::generateVpLayer
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:256
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isCompositeMapEnabled
bool isCompositeMapEnabled() const
Whether to use the composite map to provide a lower LOD technique in the distance (default true).
Definition: OgreTerrainPSSMMaterialGenerator.h:107
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::getReceiveDynamicShadowsLowLod
bool getReceiveDynamicShadowsLowLod() const
Whether to use shadows on low LOD material rendering (when using composite map) (default false).
Definition: OgreTerrainPSSMMaterialGenerator.h:144
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::mShadowSamplerStartLo
size_t mShadowSamplerStartLo
Definition: OgreTerrainPSSMMaterialGenerator.h:196
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::updateVpParams
virtual void updateVpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const GpuProgramParametersSharedPtr &params)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:629
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::getReceiveDynamicShadowsEnabled
bool getReceiveDynamicShadowsEnabled() const
Whether to support dynamic texture shadows received from other objects, on the terrain (default true)...
Definition: OgreTerrainPSSMMaterialGenerator.h:116
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setGlobalColourMapEnabled
void setGlobalColourMapEnabled(bool enabled)
Whether to support a global colour map over the terrain in the shader, if it's present (default true)...
Definition: OgreTerrainPSSMMaterialGenerator.cpp:141
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES
Utility class to help with generating shaders for GLSL ES.
Definition: OgreTerrainPSSMMaterialGenerator.h:246
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isShadowingEnabled
bool isShadowingEnabled(TechniqueType tt, const Terrain *terrain) const
Definition: OgreTerrainPSSMMaterialGenerator.cpp:423
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::defaultFpParams
virtual void defaultFpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const HighLevelGpuProgramPtr &prog)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:560
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::createVertexProgram
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:731
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mShaderGen
ShaderHelper * mShaderGen
Definition: OgreTerrainPSSMMaterialGenerator.h:265
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::generateFpHeader
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:254
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::generateVpLayer
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:236
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mLayerSpecularMappingEnabled
bool mLayerSpecularMappingEnabled
Definition: OgreTerrainPSSMMaterialGenerator.h:268
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::generateFpHeader
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:234
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateFpFooter
virtual void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isLayerParallaxMappingEnabled
bool isLayerParallaxMappingEnabled() const
Whether to support parallax mapping per layer in the shader (default true).
Definition: OgreTerrainPSSMMaterialGenerator.h:74
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::_isSM3Available
bool _isSM3Available() const
Internal.
Definition: OgreTerrainPSSMMaterialGenerator.h:147
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::LOW_LOD
@ LOW_LOD
Definition: OgreTerrainPSSMMaterialGenerator.h:155
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateFpFooter
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1243
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::updateParams
void updateParams(const MaterialPtr &mat, const Terrain *terrain)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:431
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateVpFooter
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1213
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateFragmentProgram
virtual HighLevelGpuProgramPtr generateFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:465
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateFpDynamicShadows
void generateFpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1522
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::_isSM4Available
bool _isSM4Available() const
Definition: OgreTerrainPSSMMaterialGenerator.h:148
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::createFragmentProgram
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:755
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperHLSL::createVertexProgram
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1577
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg
Utility class to help with generating shaders for Cg / HLSL.
Definition: OgreTerrainPSSMMaterialGenerator.h:200
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setLightmapEnabled
void setLightmapEnabled(bool enabled)
Whether to support a light map over the terrain in the shader, if it's present (default true).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:151
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateVpFooter
virtual void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateVpLayer
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1138
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::HIGH_LOD
@ HIGH_LOD
Definition: OgreTerrainPSSMMaterialGenerator.h:154
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::getReceiveDynamicShadowsPSSM
PSSMShadowCameraSetup * getReceiveDynamicShadowsPSSM() const
Whether to use PSSM support dynamic texture shadows, and if so the settings to use (default 0).
Definition: OgreTerrainPSSMMaterialGenerator.h:130
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isVertexCompressionSupported
bool isVertexCompressionSupported() const
Definition: OgreTerrainPSSMMaterialGenerator.cpp:105
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::addTechnique
void addTechnique(const MaterialPtr &mat, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:314
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::~SM2Profile
~SM2Profile()
Definition: OgreTerrainPSSMMaterialGenerator.cpp:90
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL
Utility class to help with generating shaders for GLSL.
Definition: OgreTerrainPSSMMaterialGenerator.h:226
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setLayerParallaxMappingEnabled
void setLayerParallaxMappingEnabled(bool enabled)
Whether to support parallax mapping per layer in the shader (default true).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:121
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateFragmentProgramSource
virtual void generateFragmentProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:503
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::generateVpFooter
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:240
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::TechniqueType
TechniqueType
Definition: OgreTerrainPSSMMaterialGenerator.h:152
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::getMaxLayers
uint8 getMaxLayers(const Terrain *terrain) const
Definition: OgreTerrainPSSMMaterialGenerator.cpp:211
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mCompositeMapEnabled
bool mCompositeMapEnabled
Definition: OgreTerrainPSSMMaterialGenerator.h:271
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateVertexProgram
virtual HighLevelGpuProgramPtr generateVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:445
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::generateVpHeader
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:252
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setReceiveDynamicShadowsDepth
void setReceiveDynamicShadowsDepth(bool enabled)
Whether to use depth shadows (default false).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:191
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setReceiveDynamicShadowsPSSM
void setReceiveDynamicShadowsPSSM(PSSMShadowCameraSetup *pssmSettings)
Whether to use PSSM support dynamic texture shadows, and if so the settings to use (default 0).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:181
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateFpDynamicShadowsHelpers
void generateFpDynamicShadowsHelpers(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1315
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setLayerSpecularMappingEnabled
void setLayerSpecularMappingEnabled(bool enabled)
Whether to support specular mapping per layer in the shader (default true).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:131
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::getVertexProgramName
virtual String getVertexProgramName(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:685
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::RENDER_COMPOSITE_MAP
@ RENDER_COMPOSITE_MAP
Definition: OgreTerrainPSSMMaterialGenerator.h:156
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setReceiveDynamicShadowsLowLod
void setReceiveDynamicShadowsLowLod(bool enabled)
Whether to use shadows on low LOD material rendering (when using composite map) (default false).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:201
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateVpDynamicShadows
void generateVpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1458
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::requestOptions
void requestOptions(Terrain *terrain)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:96
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateVertexProgramSource
virtual void generateVertexProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:485
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isLayerSpecularMappingEnabled
bool isLayerSpecularMappingEnabled() const
Whether to support specular mapping per layer in the shader (default true).
Definition: OgreTerrainPSSMMaterialGenerator.h:81
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::~ShaderHelper
virtual ~ShaderHelper()
Definition: OgreTerrainPSSMMaterialGenerator.h:169
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mReceiveDynamicShadows
bool mReceiveDynamicShadows
Definition: OgreTerrainPSSMMaterialGenerator.h:272
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mSM3Available
bool mSM3Available
Definition: OgreTerrainPSSMMaterialGenerator.h:276
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::generateForCompositeMap
MaterialPtr generateForCompositeMap(const Terrain *terrain)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:286
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::createFragmentProgram
virtual HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::updateFpParams
virtual void updateFpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const GpuProgramParametersSharedPtr &params)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:657
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateVpHeader
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:782
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateFpHeader
virtual void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mLayerParallaxMappingEnabled
bool mLayerParallaxMappingEnabled
Definition: OgreTerrainPSSMMaterialGenerator.h:267
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mLowLodShadows
bool mLowLodShadows
Definition: OgreTerrainPSSMMaterialGenerator.h:275
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mDepthShadows
bool mDepthShadows
Definition: OgreTerrainPSSMMaterialGenerator.h:274
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::generate
MaterialPtr generate(const Terrain *terrain)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:237
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::ShaderHelper
ShaderHelper()
Definition: OgreTerrainPSSMMaterialGenerator.h:165
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::generateFpLayer
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:238
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isGlobalColourMapEnabled
bool isGlobalColourMapEnabled() const
Whether to support a global colour map over the terrain in the shader, if it's present (default true)...
Definition: OgreTerrainPSSMMaterialGenerator.h:89
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::getFragmentProgramName
virtual String getFragmentProgramName(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:707
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::generateVpFooter
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:260
Ogre::TerrainPSSMMaterialGenerator::TerrainPSSMMaterialGenerator
TerrainPSSMMaterialGenerator()
Definition: OgreTerrainPSSMMaterialGenerator.cpp:43
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::generateFpFooter
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:262
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::generateVpLayer
virtual void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)=0
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::updateParams
virtual void updateParams(const SM2Profile *prof, const MaterialPtr &mat, const Terrain *terrain, bool compositeMap)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:603
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::createVertexProgram
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1638
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::generateVpHeader
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:232
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mSM4Available
bool mSM4Available
Definition: OgreTerrainPSSMMaterialGenerator.h:277
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setReceiveDynamicShadowsEnabled
void setReceiveDynamicShadowsEnabled(bool enabled)
Whether to support dynamic texture shadows received from other objects, on the terrain (default true)...
Definition: OgreTerrainPSSMMaterialGenerator.cpp:171
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::createFragmentProgram
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1673
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::getReceiveDynamicShadowsDepth
bool getReceiveDynamicShadowsDepth() const
Whether to use depth shadows (default false).
Definition: OgreTerrainPSSMMaterialGenerator.h:137
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperHLSL::createFragmentProgram
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1607
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::updateParamsForCompositeMap
void updateParamsForCompositeMap(const MaterialPtr &mat, const Terrain *terrain)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:437
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateFpHeader
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:938
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateFpLayer
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1145
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::generateFpLayer
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:258
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSL::generateFpFooter
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.h:242
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::SM2Profile
SM2Profile(TerrainMaterialGenerator *parent, const String &name, const String &desc)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:73
Ogre
Definition: ExtinguishableFireAffector.cpp:35
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelper::mShadowSamplerStartHi
size_t mShadowSamplerStartHi
Definition: OgreTerrainPSSMMaterialGenerator.h:195
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mLightmapEnabled
bool mLightmapEnabled
Definition: OgreTerrainPSSMMaterialGenerator.h:270
Ogre::TerrainPSSMMaterialGenerator
A TerrainMaterialGenerator which can cope with normal mapped, specular mapped terrain.
Definition: OgreTerrainPSSMMaterialGenerator.h:44
Ogre::TerrainPSSMMaterialGenerator::SM2Profile
Shader model 2 profile target.
Definition: OgreTerrainPSSMMaterialGenerator.h:52
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mPSSM
PSSMShadowCameraSetup * mPSSM
Definition: OgreTerrainPSSMMaterialGenerator.h:273
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateFpDynamicShadowsParams
void generateFpDynamicShadowsParams(uint *texCoord, uint *sampler, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1490
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperCg::generateVpDynamicShadowsParams
uint generateVpDynamicShadowsParams(uint texCoordStart, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1432
Ogre::TerrainPSSMMaterialGenerator::~TerrainPSSMMaterialGenerator
~TerrainPSSMMaterialGenerator()
Definition: OgreTerrainPSSMMaterialGenerator.cpp:67
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::setCompositeMapEnabled
void setCompositeMapEnabled(bool enabled)
Whether to use the composite map to provide a lower LOD technique in the distance (default true).
Definition: OgreTerrainPSSMMaterialGenerator.cpp:161
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::ShaderHelperGLSLES::createVertexProgram
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Definition: OgreTerrainPSSMMaterialGenerator.cpp:1696
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::mGlobalColourMapEnabled
bool mGlobalColourMapEnabled
Definition: OgreTerrainPSSMMaterialGenerator.h:269
Ogre::TerrainPSSMMaterialGenerator::SM2Profile::isLightmapEnabled
bool isLightmapEnabled() const
Whether to support a light map over the terrain in the shader, if it's present (default true).
Definition: OgreTerrainPSSMMaterialGenerator.h:98