|
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
31 #include <Terrain/OgreTerrainPrerequisites.h>
32 #include <Terrain/OgreTerrainMaterialGenerator.h>
33 #include <OgreGpuProgramParams.h>
36 class PSSMShadowCameraSetup;
52 class SM2Profile :
public TerrainMaterialGenerator::Profile
55 SM2Profile(TerrainMaterialGenerator* parent,
const String& name,
const String& desc);
57 MaterialPtr
generate(
const Terrain* terrain);
60 void updateParams(
const MaterialPtr& mat,
const Terrain* terrain);
175 virtual void updateParams(
const SM2Profile* prof,
const MaterialPtr& mat,
const Terrain* terrain,
bool compositeMap);
bool mLayerNormalMappingEnabled
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Interface definition for helper class to generate shaders.
virtual void defaultVpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const HighLevelGpuProgramPtr &prog)
virtual HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)=0
static String getChannel(uint idx)
void setLayerNormalMappingEnabled(bool enabled)
Whether to support normal mapping per layer in the shader (default true).
virtual void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
virtual void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)=0
bool isLayerNormalMappingEnabled() const
Whether to support normal mapping per layer in the shader (default true).
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
bool isCompositeMapEnabled() const
Whether to use the composite map to provide a lower LOD technique in the distance (default true).
bool getReceiveDynamicShadowsLowLod() const
Whether to use shadows on low LOD material rendering (when using composite map) (default false).
size_t mShadowSamplerStartLo
virtual void updateVpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const GpuProgramParametersSharedPtr ¶ms)
bool getReceiveDynamicShadowsEnabled() const
Whether to support dynamic texture shadows received from other objects, on the terrain (default true)...
void setGlobalColourMapEnabled(bool enabled)
Whether to support a global colour map over the terrain in the shader, if it's present (default true)...
Utility class to help with generating shaders for GLSL ES.
bool isShadowingEnabled(TechniqueType tt, const Terrain *terrain) const
virtual void defaultFpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const HighLevelGpuProgramPtr &prog)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
ShaderHelper * mShaderGen
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)
bool mLayerSpecularMappingEnabled
void generateFpHeader(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
bool isLayerParallaxMappingEnabled() const
Whether to support parallax mapping per layer in the shader (default true).
bool _isSM3Available() const
Internal.
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void updateParams(const MaterialPtr &mat, const Terrain *terrain)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
virtual HighLevelGpuProgramPtr generateFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateFpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
bool _isSM4Available() const
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
Utility class to help with generating shaders for Cg / HLSL.
void setLightmapEnabled(bool enabled)
Whether to support a light map over the terrain in the shader, if it's present (default true).
virtual void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
PSSMShadowCameraSetup * getReceiveDynamicShadowsPSSM() const
Whether to use PSSM support dynamic texture shadows, and if so the settings to use (default 0).
bool isVertexCompressionSupported() const
void addTechnique(const MaterialPtr &mat, const Terrain *terrain, TechniqueType tt)
Utility class to help with generating shaders for GLSL.
void setLayerParallaxMappingEnabled(bool enabled)
Whether to support parallax mapping per layer in the shader (default true).
virtual void generateFragmentProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
uint8 getMaxLayers(const Terrain *terrain) const
bool mCompositeMapEnabled
virtual HighLevelGpuProgramPtr generateVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void setReceiveDynamicShadowsDepth(bool enabled)
Whether to use depth shadows (default false).
void setReceiveDynamicShadowsPSSM(PSSMShadowCameraSetup *pssmSettings)
Whether to use PSSM support dynamic texture shadows, and if so the settings to use (default 0).
void generateFpDynamicShadowsHelpers(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void setLayerSpecularMappingEnabled(bool enabled)
Whether to support specular mapping per layer in the shader (default true).
virtual String getVertexProgramName(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void setReceiveDynamicShadowsLowLod(bool enabled)
Whether to use shadows on low LOD material rendering (when using composite map) (default false).
void generateVpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void requestOptions(Terrain *terrain)
virtual void generateVertexProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
bool isLayerSpecularMappingEnabled() const
Whether to support specular mapping per layer in the shader (default true).
bool mReceiveDynamicShadows
MaterialPtr generateForCompositeMap(const Terrain *terrain)
virtual HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)=0
virtual void updateFpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const GpuProgramParametersSharedPtr ¶ms)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
virtual void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)=0
bool mLayerParallaxMappingEnabled
MaterialPtr generate(const Terrain *terrain)
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
bool isGlobalColourMapEnabled() const
Whether to support a global colour map over the terrain in the shader, if it's present (default true)...
virtual String getFragmentProgramName(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
TerrainPSSMMaterialGenerator()
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
virtual void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)=0
virtual void updateParams(const SM2Profile *prof, const MaterialPtr &mat, const Terrain *terrain, bool compositeMap)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
void setReceiveDynamicShadowsEnabled(bool enabled)
Whether to support dynamic texture shadows received from other objects, on the terrain (default true)...
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
bool getReceiveDynamicShadowsDepth() const
Whether to use depth shadows (default false).
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void updateParamsForCompositeMap(const MaterialPtr &mat, const Terrain *terrain)
void generateFpHeader(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 generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, StringUtil::StrStreamType &outStream)
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, StringUtil::StrStreamType &outStream)
SM2Profile(TerrainMaterialGenerator *parent, const String &name, const String &desc)
size_t mShadowSamplerStartHi
A TerrainMaterialGenerator which can cope with normal mapped, specular mapped terrain.
Shader model 2 profile target.
PSSMShadowCameraSetup * mPSSM
void generateFpDynamicShadowsParams(uint *texCoord, uint *sampler, 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)
~TerrainPSSMMaterialGenerator()
void setCompositeMapEnabled(bool enabled)
Whether to use the composite map to provide a lower LOD technique in the distance (default true).
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
bool mGlobalColourMapEnabled
bool isLightmapEnabled() const
Whether to support a light map over the terrain in the shader, if it's present (default true).