17 #ifndef GZ_RENDERING_OGRE2_OGRE2RENDERTARGET_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2RENDERTARGET_HH_
23 #include <gz/math/Color.hh>
31 #pragma warning(push, 0)
33 #include <Compositor/OgreCompositorShadowNode.h>
49 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
52 class Ogre2RenderTargetPrivate;
65 public:
virtual unsigned int AntiAliasing()
const;
69 public:
virtual void SetAntiAliasing(
unsigned int _aa);
73 public:
virtual void Copy(
Image &_image)
const override;
77 public:
virtual Ogre::Camera *
Camera()
const;
81 public:
virtual void SetCamera(Ogre::Camera *_camera);
84 public:
virtual math::Color BackgroundColor()
const override;
88 public:
virtual void SetBackgroundColor(
math::Color _color);
92 public:
virtual void SetBackgroundMaterial(
MaterialPtr _material);
96 public:
virtual MaterialPtr BackgroundMaterial()
const;
99 public:
virtual void PreRender()
override;
102 public:
virtual void PostRender()
override;
105 public:
virtual void Render();
108 public:
virtual void Destroy()
override = 0;
116 public:
void SetShadowsNodeDefDirty();
121 protected: uint8_t TargetFSAA()
const;
126 protected: Ogre::TextureGpu *RenderTargetImpl()
const;
130 public:
virtual Ogre::TextureGpu *
RenderTarget()
const = 0;
134 public:
virtual bool IsRenderWindow()
const;
137 public:
unsigned int GLIdImpl()
const;
140 public:
void MetalIdImpl(
void *_textureIdPtr)
const;
143 protected:
void DestroyTargetImpl();
146 protected:
void BuildTargetImpl();
151 public:
virtual uint32_t VisibilityMask()
const;
156 public:
virtual void SetVisibilityMask(uint32_t _mask);
159 public:
static void UpdateRenderPassChain(
160 Ogre::CompositorWorkspace *_workspace,
165 Ogre::TextureGpu *(*_ogreTextures)[2],
166 bool _isRenderWindow);
169 protected:
virtual void UpdateBackgroundColor();
172 protected:
virtual void UpdateBackgroundMaterial();
175 protected:
virtual void UpdateRenderPassChain();
178 protected:
virtual void RebuildImpl()
override;
181 protected:
virtual void RebuildTarget() = 0;
184 protected:
virtual void RebuildCompositor();
187 protected:
virtual void BuildCompositor();
190 protected:
virtual void DestroyCompositor();
196 protected:
void RebuildMaterial();
199 protected: Ogre::Camera *ogreCamera =
nullptr;
203 protected: Ogre::CompositorWorkspace *ogreCompositorWorkspace =
nullptr;
221 protected:
bool colorDirty =
true;
225 protected:
bool backgroundMaterialDirty =
false;
228 protected:
unsigned int antiAliasing = 4;
248 public:
virtual void Destroy()
override;
251 public:
virtual void PreRender()
override;
254 public:
virtual void PostRender()
override;
257 public:
virtual unsigned int GLId()
const override;
260 public:
virtual void MetalId(
void *_textureIdPtr)
const override;
265 public:
virtual Ogre::TextureGpu *
RenderTarget()
const override;
268 protected:
virtual void RebuildTarget()
override;
271 protected:
virtual void DestroyTarget();
274 protected:
virtual void BuildTarget();
291 public:
virtual void Destroy()
override;
294 public:
virtual bool IsRenderWindow()
const override;
297 public:
virtual Ogre::TextureGpu *
RenderTarget()
const override;
300 protected:
virtual void RebuildTarget()
override;
303 protected:
virtual void BuildTarget();
306 protected: Ogre::TextureGpu *ogreRenderWindow =
nullptr;