17 #ifndef GZ_RENDERING_OGRE_OGREMATERIAL_HH_
18 #define GZ_RENDERING_OGRE_OGREMATERIAL_HH_
23 #include <gz/utils/SuppressWarning.hh>
25 #include <gz/common/Image.hh>
35 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
38 "depth_vertex_shader.glsl";
40 "depth_fragment_shader.glsl";
50 public:
virtual void Destroy()
override;
52 public:
virtual bool LightingEnabled()
const override;
54 public:
virtual void SetLightingEnabled(
const bool _enabled)
override;
57 public:
virtual bool DepthCheckEnabled()
const override;
60 public:
virtual void SetDepthCheckEnabled(
bool _enabled)
override;
63 public:
virtual bool DepthWriteEnabled()
const override;
66 public:
virtual void SetDepthWriteEnabled(
bool _enabled)
override;
68 public:
virtual math::Color Ambient()
const override;
70 public:
virtual void SetAmbient(
const math::Color &_color)
override;
72 public:
virtual math::Color Diffuse()
const override;
74 public:
virtual void SetDiffuse(
const math::Color &_color)
override;
76 public:
virtual math::Color Specular()
const override;
78 public:
virtual void SetSpecular(
const math::Color &_color)
override;
80 public:
virtual math::Color Emissive()
const override;
82 public:
virtual void SetEmissive(
const math::Color &_color)
override;
84 public:
virtual double Shininess()
const override;
86 public:
virtual void SetShininess(
const double _shininess)
override;
88 public:
virtual double Transparency()
const override;
90 public:
virtual void SetTransparency(
const double _transparency)
94 public:
virtual void SetAlphaFromTexture(
bool _enabled,
95 double _alpha = 0.5,
bool _twoSided =
true)
override;
97 public:
virtual double Reflectivity()
const override;
99 public:
virtual void SetReflectivity(
const double _reflectivity)
102 public:
virtual bool CastShadows()
const override;
105 public:
virtual void SetCastShadows(
const bool _castShadows)
override;
107 public:
virtual bool ReceiveShadows()
const override;
109 public:
virtual void SetReceiveShadows(
const bool _receiveShadows)
113 public:
virtual float RenderOrder()
const override;
119 public:
virtual void SetRenderOrder(
const float _renderOrder)
override;
121 public:
virtual bool ReflectionEnabled()
const override;
123 public:
virtual void SetReflectionEnabled(
const bool _enabled)
override;
125 public:
virtual bool HasTexture()
const override;
127 public:
virtual std::string Texture()
const override;
130 public:
virtual void SetTexture(
const std::string &_texture,
133 public:
virtual void ClearTexture()
override;
138 public:
virtual bool HasNormalMap()
const override;
140 public:
virtual std::string NormalMap()
const override;
146 public:
virtual void SetNormalMap(
const std::string &_normalMap,
149 public:
virtual void ClearNormalMap()
override;
154 public:
virtual void SetShaderType(
enum ShaderType _type)
override;
156 public:
virtual Ogre::MaterialPtr
Material()
const;
160 public:
virtual void SetDepthMaterial(
const double far,
161 const double near)
override;
165 public:
virtual void SetVertexShader(
const std::string &_path)
override;
169 public:
virtual std::string VertexShader()
const override;
177 public:
virtual void SetFragmentShader(
const std::string &_path)
182 public:
virtual std::string FragmentShader()
const override;
190 public:
virtual void PreRender()
override;
192 protected:
virtual void LoadOneImage(
const std::string &_name,
193 Ogre::Image &_image);
197 protected:
virtual void SetTextureImpl(
const std::string &_texture);
203 protected:
void SetTextureDataImpl(
const std::string &_texture,
206 protected:
virtual Ogre::TexturePtr Texture(
const std::string &_name);
208 protected:
virtual Ogre::TexturePtr CreateTexture(
211 protected:
virtual void UpdateTransparency();
213 protected:
virtual void UpdateColorOperation();
216 protected:
void UpdateShaderParams();
222 Ogre::GpuProgramParametersSharedPtr _ogreParams);
224 protected:
virtual void Init()
override;
226 GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
229 protected: Ogre::Technique *ogreTechnique =
nullptr;
231 protected: Ogre::Pass *ogrePass =
nullptr;
233 protected: Ogre::TextureUnitState *ogreTexState =
nullptr;
237 #if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7
263 GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING