17 #ifndef IGNITION_RENDERING_OGRE_OGREMATERIAL_HH_ 18 #define IGNITION_RENDERING_OGRE_OGREMATERIAL_HH_ 30 inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
33 "depth_vertex_shader.glsl";
35 "depth_fragment_shader.glsl";
45 public:
virtual void Destroy()
override;
47 public:
virtual bool LightingEnabled()
const override;
49 public:
virtual void SetLightingEnabled(
const bool _enabled)
override;
52 public:
virtual bool DepthCheckEnabled()
const override;
55 public:
virtual void SetDepthCheckEnabled(
bool _enabled)
override;
58 public:
virtual bool DepthWriteEnabled()
const override;
61 public:
virtual void SetDepthWriteEnabled(
bool _enabled)
override;
63 public:
virtual math::Color Ambient()
const override;
65 public:
virtual void SetAmbient(
const math::Color &_color)
override;
67 public:
virtual math::Color Diffuse()
const override;
69 public:
virtual void SetDiffuse(
const math::Color &_color)
override;
71 public:
virtual math::Color Specular()
const override;
73 public:
virtual void SetSpecular(
const math::Color &_color)
override;
75 public:
virtual math::Color Emissive()
const override;
77 public:
virtual void SetEmissive(
const math::Color &_color)
override;
79 public:
virtual double Shininess()
const override;
81 public:
virtual void SetShininess(
const double _shininess)
override;
83 public:
virtual double Transparency()
const override;
85 public:
virtual void SetTransparency(
const double _transparency)
89 public:
virtual void SetAlphaFromTexture(
bool _enabled,
90 double _alpha = 0.5,
bool _twoSided =
true)
override;
92 public:
virtual double Reflectivity()
const override;
94 public:
virtual void SetReflectivity(
const double _reflectivity)
97 public:
virtual bool CastShadows()
const override;
99 public:
virtual void SetCastShadows(
const bool _castShadows)
override;
101 public:
virtual bool ReceiveShadows()
const override;
103 public:
virtual void SetReceiveShadows(
const bool _receiveShadows)
106 public:
virtual bool ReflectionEnabled()
const override;
108 public:
virtual void SetReflectionEnabled(
const bool _enabled)
override;
110 public:
virtual bool HasTexture()
const override;
112 public:
virtual std::string Texture()
const override;
114 public:
virtual void SetTexture(
const std::string &_name)
override;
116 public:
virtual void ClearTexture()
override;
118 public:
virtual bool HasNormalMap()
const override;
120 public:
virtual std::string NormalMap()
const override;
122 public:
virtual void SetNormalMap(
const std::string &_name)
override;
124 public:
virtual void ClearNormalMap()
override;
128 public:
virtual void SetShaderType(
enum ShaderType _type)
override;
130 public:
virtual Ogre::MaterialPtr
Material()
const;
134 public:
virtual void SetDepthMaterial(
const double far,
135 const double near)
override;
139 public:
virtual void SetVertexShader(
const std::string &_path)
override;
143 public:
virtual std::string VertexShader()
const override;
151 public:
virtual void SetFragmentShader(
const std::string &_path)
156 public:
virtual std::string FragmentShader()
const override;
164 public:
virtual void PreRender()
override;
166 protected:
virtual void LoadOneImage(
const std::string &_name,
167 Ogre::Image &_image);
171 protected:
virtual void SetTextureImpl(
const std::string &_texture);
173 protected:
virtual Ogre::TexturePtr Texture(
const std::string &_name);
175 protected:
virtual Ogre::TexturePtr CreateTexture(
178 protected:
virtual void UpdateTransparency();
180 protected:
virtual void UpdateColorOperation();
183 protected:
void UpdateShaderParams();
189 Ogre::GpuProgramParametersSharedPtr _ogreParams);
191 protected:
virtual void Init()
override;
195 protected: Ogre::Technique *ogreTechnique =
nullptr;
197 protected: Ogre::Pass *ogrePass =
nullptr;
199 protected: Ogre::TextureUnitState *ogreTexState =
nullptr;
203 #if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7 const std::string depth_fragment_shader_file
Definition: OgreMaterial.hh:34
const std::string depth_vertex_shader_file
Definition: OgreMaterial.hh:32
std::string vertexShaderPath
Path to vertex shader program.
Definition: OgreMaterial.hh:213
std::string fragmentShaderPath
Path to fragment shader program.
Definition: OgreMaterial.hh:216
ShaderParamsPtr vertexShaderParams
Parameters to be bound to the vertex shader.
Definition: OgreMaterial.hh:219
ShaderParamsPtr fragmentShaderParams
Parameters to be bound to the fragment shader.
Definition: OgreMaterial.hh:222
Ogre::String ogreGroup
Definition: OgreMaterial.hh:201
std::string normalMapName
Definition: OgreMaterial.hh:208
Definition: OgreMaterial.hh:37
Definition: OgreScene.hh:39
std::string textureName
Definition: OgreMaterial.hh:206
ShaderType
Available types of shaders. Note that not all rendering-engines will be able to use each type...
Definition: ShaderType.hh:34
Definition: BaseMaterial.hh:38
Per pixel lighting shader.
Definition: ShaderType.hh:40
Ogre::MaterialPtr ogreMaterial
Definition: OgreMaterial.hh:193
Represents a surface material of a Geometry.
Definition: Material.hh:47