29#ifndef __Ogre_TerrainMaterialGeneratorA_H__
30#define __Ogre_TerrainMaterialGeneratorA_H__
#define _OgreTerrainExport
Parallel Split Shadow Map (PSSM) shadow camera setup.
StringStream StrStreamType
Utility class to help with generating shaders for Cg / HLSL.
uint generateVpDynamicShadowsParams(uint texCoordStart, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateFpDynamicShadowsHelpers(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
void generateFpDynamicShadowsParams(uint *texCoord, uint *sampler, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
void generateFpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
Utility class to help with generating shaders for GLSL ES.
void generateFpDynamicShadowsHelpers(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
void generateVpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
uint generateVpDynamicShadowsParams(uint texCoordStart, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpDynamicShadowsParams(uint *texCoord, uint *sampler, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
Utility class to help with generating shaders for GLSL.
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateFpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpDynamicShadowsHelpers(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
uint generateVpDynamicShadowsParams(uint texCoordStart, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpDynamicShadowsParams(uint *texCoord, uint *sampler, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Interface definition for helper class to generate shaders.
virtual void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)=0
virtual void generateFragmentProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
virtual void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
virtual HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)=0
virtual HighLevelGpuProgramPtr generateFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
virtual void defaultFpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const HighLevelGpuProgramPtr &prog)
virtual void updateVpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const GpuProgramParametersSharedPtr ¶ms)
size_t mShadowSamplerStartHi
virtual String getFragmentProgramName(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
virtual HighLevelGpuProgramPtr generateVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
virtual void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
virtual String getVertexProgramName(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
virtual HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)=0
virtual void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
virtual void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
virtual void updateFpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const GpuProgramParametersSharedPtr ¶ms)
virtual void updateParams(const SM2Profile *prof, const MaterialPtr &mat, const Terrain *terrain, bool compositeMap)
virtual void defaultVpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const HighLevelGpuProgramPtr &prog)
virtual void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)=0
static String getChannel(uint idx)
virtual void generateVertexProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
size_t mShadowSamplerStartLo
void updateParamsForCompositeMap(const MaterialPtr &mat, const Terrain *terrain)
Update params for a terrain.
bool _isSM4Available() const
PSSMShadowCameraSetup * mPSSM
bool isLightmapEnabled() const
Whether to support a light map over the terrain in the shader, if it's present (default true).
MaterialPtr generateForCompositeMap(const Terrain *terrain)
Generate / reuse a material for the terrain.
void setLayerSpecularMappingEnabled(bool enabled)
Whether to support specular mapping per layer in the shader (default true).
void setLayerParallaxMappingEnabled(bool enabled)
Whether to support parallax mapping per layer in the shader (default true).
void setReceiveDynamicShadowsEnabled(bool enabled)
Whether to support dynamic texture shadows received from other objects, on the terrain (default true)...
uint8 getMaxLayers(const Terrain *terrain) const
Get the number of layers supported.
bool isShadowingEnabled(TechniqueType tt, const Terrain *terrain) const
bool mCompositeMapEnabled
void setReceiveDynamicShadowsDepth(bool enabled)
Whether to use depth shadows (default false).
void setLayerNormalMappingEnabled(bool enabled)
Whether to support normal mapping per layer in the shader (default true).
bool mLayerParallaxMappingEnabled
String _getShaderLanguage() const
void updateParams(const MaterialPtr &mat, const Terrain *terrain)
Update params for a terrain.
void setGlobalColourMapEnabled(bool enabled)
Whether to support a global colour map over the terrain in the shader, if it's present (default true)...
bool mGlobalColourMapEnabled
SM2Profile(TerrainMaterialGenerator *parent, const String &name, const String &desc)
void setLightmapEnabled(bool enabled)
Whether to support a light map over the terrain in the shader, if it's present (default true).
bool isVertexCompressionSupported() const
Compressed vertex format supported?
void setCompositeMapEnabled(bool enabled)
Whether to use the composite map to provide a lower LOD technique in the distance (default true).
void addTechnique(const MaterialPtr &mat, const Terrain *terrain, TechniqueType tt)
bool mLayerNormalMappingEnabled
PSSMShadowCameraSetup * getReceiveDynamicShadowsPSSM() const
Whether to use PSSM support dynamic texture shadows, and if so the settings to use (default 0).
MaterialPtr generate(const Terrain *terrain)
Generate / reuse a material for the terrain.
bool getReceiveDynamicShadowsLowLod() const
Whether to use shadows on low LOD material rendering (when using composite map) (default false).
bool _isSM3Available() const
Internal.
void setReceiveDynamicShadowsLowLod(bool enabled)
Whether to use shadows on low LOD material rendering (when using composite map) (default false).
bool mLayerSpecularMappingEnabled
bool isGlobalColourMapEnabled() const
Whether to support a global colour map over the terrain in the shader, if it's present (default true)...
bool isCompositeMapEnabled() const
Whether to use the composite map to provide a lower LOD technique in the distance (default true).
ShaderHelper * mShaderGen
bool getReceiveDynamicShadowsDepth() const
Whether to use depth shadows (default false).
bool isLayerNormalMappingEnabled() const
Whether to support normal mapping per layer in the shader (default true).
bool mReceiveDynamicShadows
bool isLayerParallaxMappingEnabled() const
Whether to support parallax mapping per layer in the shader (default true).
bool getReceiveDynamicShadowsEnabled() const
Whether to support dynamic texture shadows received from other objects, on the terrain (default true)...
bool isLayerSpecularMappingEnabled() const
Whether to support specular mapping per layer in the shader (default true).
void setReceiveDynamicShadowsPSSM(PSSMShadowCameraSetup *pssmSettings)
Whether to use PSSM support dynamic texture shadows, and if so the settings to use (default 0).
void requestOptions(Terrain *terrain)
Request the options needed from the terrain.
TerrainMaterialGeneratorA()
virtual ~TerrainMaterialGeneratorA()
Inner class which should also be subclassed to provide profile-specific material generation.
TerrainMaterialGenerator()
The main containing class for a chunk of terrain.
SharedPtr< GpuProgramParameters > GpuProgramParametersSharedPtr
Shared pointer used to hold references to GpuProgramParameters instances.
SharedPtr< Material > MaterialPtr
SharedPtr< HighLevelGpuProgram > HighLevelGpuProgramPtr
GeneralAllocatedObject TerrainAlloc