Go to the documentation of this file.
17 #ifndef GZ_RENDERING_OGRE_OGREMATERIAL_HH_
18 #define GZ_RENDERING_OGRE_OGREMATERIAL_HH_
22 #include <gz/common/SuppressWarning.hh>
32 inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
35 "depth_vertex_shader.glsl";
37 "depth_fragment_shader.glsl";
47 public:
virtual void Destroy()
override;
49 public:
virtual bool LightingEnabled()
const override;
51 public:
virtual void SetLightingEnabled(
const bool _enabled)
override;
54 public:
virtual bool DepthCheckEnabled()
const override;
57 public:
virtual void SetDepthCheckEnabled(
bool _enabled)
override;
60 public:
virtual bool DepthWriteEnabled()
const override;
63 public:
virtual void SetDepthWriteEnabled(
bool _enabled)
override;
65 public:
virtual math::Color Ambient()
const override;
67 public:
virtual void SetAmbient(
const math::Color &_color)
override;
69 public:
virtual math::Color Diffuse()
const override;
71 public:
virtual void SetDiffuse(
const math::Color &_color)
override;
73 public:
virtual math::Color Specular()
const override;
75 public:
virtual void SetSpecular(
const math::Color &_color)
override;
77 public:
virtual math::Color Emissive()
const override;
79 public:
virtual void SetEmissive(
const math::Color &_color)
override;
81 public:
virtual double Shininess()
const override;
83 public:
virtual void SetShininess(
const double _shininess)
override;
85 public:
virtual double Transparency()
const override;
87 public:
virtual void SetTransparency(
const double _transparency)
91 public:
virtual void SetAlphaFromTexture(
bool _enabled,
92 double _alpha = 0.5,
bool _twoSided =
true)
override;
94 public:
virtual double Reflectivity()
const override;
96 public:
virtual void SetReflectivity(
const double _reflectivity)
99 public:
virtual bool CastShadows()
const override;
102 public:
virtual void SetCastShadows(
const bool _castShadows)
override;
104 public:
virtual bool ReceiveShadows()
const override;
106 public:
virtual void SetReceiveShadows(
const bool _receiveShadows)
110 public:
virtual float RenderOrder()
const override;
116 public:
virtual void SetRenderOrder(
const float _renderOrder)
override;
118 public:
virtual bool ReflectionEnabled()
const override;
120 public:
virtual void SetReflectionEnabled(
const bool _enabled)
override;
122 public:
virtual bool HasTexture()
const override;
124 public:
virtual std::string Texture()
const override;
127 public:
virtual void SetTexture(
const std::string &_texture)
override;
129 public:
virtual void ClearTexture()
override;
131 public:
virtual bool HasNormalMap()
const override;
133 public:
virtual std::string NormalMap()
const override;
136 public:
virtual void SetNormalMap(
const std::string &_normalMap)
override;
138 public:
virtual void ClearNormalMap()
override;
143 public:
virtual void SetShaderType(
enum ShaderType _type)
override;
145 public:
virtual Ogre::MaterialPtr
Material()
const;
149 public:
virtual void SetDepthMaterial(
const double far,
150 const double near)
override;
154 public:
virtual void SetVertexShader(
const std::string &_path)
override;
158 public:
virtual std::string VertexShader()
const override;
166 public:
virtual void SetFragmentShader(
const std::string &_path)
171 public:
virtual std::string FragmentShader()
const override;
179 public:
virtual void PreRender()
override;
181 protected:
virtual void LoadOneImage(
const std::string &_name,
182 Ogre::Image &_image);
186 protected:
virtual void SetTextureImpl(
const std::string &_texture);
188 protected:
virtual Ogre::TexturePtr Texture(
const std::string &_name);
190 protected:
virtual Ogre::TexturePtr CreateTexture(
193 protected:
virtual void UpdateTransparency();
195 protected:
virtual void UpdateColorOperation();
198 protected:
void UpdateShaderParams();
204 Ogre::GpuProgramParametersSharedPtr _ogreParams);
206 protected:
virtual void Init()
override;
211 protected: Ogre::Technique *ogreTechnique =
nullptr;
213 protected: Ogre::Pass *ogrePass =
nullptr;
215 protected: Ogre::TextureUnitState *ogreTexState =
nullptr;
219 #if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7
std::string vertexShaderPath
Path to vertex shader program.
Definition: gz/rendering/ogre/OgreMaterial.hh:229
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Definition: gz/rendering/ogre/OgreScene.hh:39
std::string normalMapName
Definition: gz/rendering/ogre/OgreMaterial.hh:224
const std::string depth_fragment_shader_file
Definition: gz/rendering/ogre/OgreMaterial.hh:36
Definition: gz/rendering/ogre/OgreMaterial.hh:39
Definition: gz/rendering/base/BaseMaterial.hh:38
std::string textureName
Definition: gz/rendering/ogre/OgreMaterial.hh:222
ShaderParamsPtr vertexShaderParams
Parameters to be bound to the vertex shader.
Definition: gz/rendering/ogre/OgreMaterial.hh:235
std::string fragmentShaderPath
Path to fragment shader program.
Definition: gz/rendering/ogre/OgreMaterial.hh:232
Ogre::String ogreGroup
Definition: gz/rendering/ogre/OgreMaterial.hh:217
Ogre::MaterialPtr ogreMaterial
Definition: gz/rendering/ogre/OgreMaterial.hh:209
@ ST_PIXEL
Per pixel lighting shader.
Definition: gz/rendering/ShaderType.hh:40
ShaderParamsPtr fragmentShaderParams
Parameters to be bound to the fragment shader.
Definition: gz/rendering/ogre/OgreMaterial.hh:238
ShaderType
Available types of shaders. Note that not all rendering-engines will be able to use each type....
Definition: gz/rendering/ShaderType.hh:34
Represents a surface material of a Geometry.
Definition: gz/rendering/Material.hh:47
const std::string depth_vertex_shader_file
Definition: gz/rendering/ogre/OgreMaterial.hh:34
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING