 |
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 generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
virtual void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)=0
void setLayerNormalMappingEnabled(bool enabled)
Whether to support normal mapping per layer in the shader (default true).
bool isLayerNormalMappingEnabled() const
Whether to support normal mapping per layer in the shader (default true).
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &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
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)
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
bool mLayerSpecularMappingEnabled
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)
bool isLayerParallaxMappingEnabled() const
Whether to support parallax mapping per layer in the shader (default true).
bool _isSM3Available() const
Internal.
void updateParams(const MaterialPtr &mat, const Terrain *terrain)
virtual HighLevelGpuProgramPtr generateFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
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 generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)=0
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).
uint8 getMaxLayers(const Terrain *terrain) const
bool mCompositeMapEnabled
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
virtual HighLevelGpuProgramPtr generateVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void setReceiveDynamicShadowsDepth(bool enabled)
Whether to use depth shadows (default false).
void generateFpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
virtual void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)=0
void generateFpDynamicShadowsParams(uint *texCoord, uint *sampler, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)
void setReceiveDynamicShadowsPSSM(PSSMShadowCameraSetup *pssmSettings)
Whether to use PSSM support dynamic texture shadows, and if so the settings to use (default 0).
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 requestOptions(Terrain *terrain)
virtual void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)=0
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
void generateFpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)
virtual void updateFpParams(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, const GpuProgramParametersSharedPtr ¶ms)
void generateFpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
bool mLayerParallaxMappingEnabled
virtual void generateVertexProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
MaterialPtr generate(const Terrain *terrain)
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)
TerrainPSSMMaterialGenerator()
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
virtual void updateParams(const SM2Profile *prof, const MaterialPtr &mat, const Terrain *terrain, bool compositeMap)
HighLevelGpuProgramPtr createVertexProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
virtual void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)=0
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).
uint generateVpDynamicShadowsParams(uint texCoordStart, const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
HighLevelGpuProgramPtr createFragmentProgram(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt)
void updateParamsForCompositeMap(const MaterialPtr &mat, const Terrain *terrain)
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)
virtual void generateFragmentProgramSource(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateFpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateFpDynamicShadowsHelpers(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)
SM2Profile(TerrainMaterialGenerator *parent, const String &name, const String &desc)
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
void generateVpHeader(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
size_t mShadowSamplerStartHi
void generateVpDynamicShadows(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &outStream)
virtual void generateVpLayer(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, uint layer, Ogre::StringStream &outStream)=0
A TerrainMaterialGenerator which can cope with normal mapped, specular mapped terrain.
Shader model 2 profile target.
PSSMShadowCameraSetup * mPSSM
void generateVpFooter(const SM2Profile *prof, const Terrain *terrain, TechniqueType tt, Ogre::StringStream &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).