28#ifndef __CompositorInstance_H__
29#define __CompositorInstance_H__
118 target(inTarget), currentQueueGroupID(0), visibilityMask(0xFFFFFFFF),
120 onlyInitial(false), hasBeenRendered(false), findVisibleObjects(false),
121 materialScheme(
MaterialManager::DEFAULT_SCHEME_NAME), shadowsEnabled(true)
271 const String&
getScheme()
const {
return mTechnique ? mTechnique->getSchemeName() : StringUtil::BLANK; }
380 bool *hwGammaWrite,
uint *fsaa,
String* fsaaHint);
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
A viewpoint from which the scene will be rendered.
Object representing one render to a RenderTarget or Viewport in the Ogre Composition framework.
Base composition technique, can be subclassed in plugins.
Chain of compositor effects applying to one viewport.
Provides an interface to "listen in" to to render system operations executed by this CompositorInstan...
virtual void notifyMaterialRender(uint32 pass_id, MaterialPtr &mat)
Notification before a render target operation involving a material (like rendering a quad),...
virtual void notifyMaterialSetup(uint32 pass_id, MaterialPtr &mat)
Notification of when a render target operation involving a material (like rendering a quad) is compil...
virtual void notifyResourcesCreated(bool forResizeOnly)
Notification after resources have been created (or recreated).
Specific render system operation.
virtual void execute(SceneManager *sm, RenderSystem *rs)=0
Set state to SceneManager and RenderSystem.
virtual ~RenderSystemOperation()
Operation setup for a RenderTarget (collected).
bool findVisibleObjects
Whether this op needs to find visible scene objects or not.
bool hasBeenRendered
"Has been rendered" flag; used in combination with onlyInitial to determine whether to skip this targ...
TargetOperation(RenderTarget *inTarget)
RenderQueueBitSet renderQueues
Which renderqueues to render from scene.
std::bitset< RENDER_QUEUE_COUNT > RenderQueueBitSet
A set of render queues to either include or exclude certain render queues.
RenderSystemOpPairs renderSystemOperations
RenderSystem operations to queue into the scene manager, by uint8.
uint32 visibilityMask
Scene visibility mask If this is 0, the scene is not rendered at all.
bool shadowsEnabled
Whether shadows will be enabled.
String materialScheme
Which material scheme this op will use.
RenderTarget * target
Target.
int currentQueueGroupID
Current group ID.
An instance of a Compositor object for one Viewport.
void createResources(bool forResizeOnly)
Create local rendertextures and other resources.
RenderTarget * getRenderTarget(const String &name)
Get the render target for a given render texture name.
void setScheme(const String &schemeName, bool reuseTextures=true)
Pick a technique to use to render this compositor based on a scheme.
map< String, TexturePtr >::type LocalTextureMap
Map from name->local texture.
void setEnabled(bool value)
Set enabled flag.
void deriveTextureRenderTargetOptions(const String &texname, bool *hwGammaWrite, uint *fsaa, String *fsaaHint)
Search for options like AA and hardware gamma which we may want to inherit from the main render targe...
void _fireNotifyMaterialRender(uint32 pass_id, MaterialPtr &mat)
Notify listeners of a material render.
CompositorInstance(CompositionTechnique *technique, CompositorChain *chain)
CompositionTechnique * mTechnique
Composition technique used by this instance.
const String & getTextureInstanceName(const String &name, size_t mrtIndex)
Get the instance name for a local texture.
map< CompositionTechnique::TextureDefinition *, TexturePtr >::type ReserveTextureMap
RenderTarget * getTargetForTex(const String &name)
Get RenderTarget for a named local texture.
void setTechnique(CompositionTechnique *tech, bool reuseTextures=true)
Change the technique we're using to render this compositor.
CompositorChain * getChain()
Get Chain that this instance is part of.
bool mAlive
Is this instance allocating resources?
virtual void _compileOutputOperation(TargetOperation &finalState)
Compile the final (output) operation.
void _fireNotifyMaterialSetup(uint32 pass_id, MaterialPtr &mat)
Notify listeners of a material compilation.
TexturePtr getTextureInstance(const String &name, size_t mrtIndex)
Get the instance of a local texture.
MaterialPtr createLocalMaterial(const String &srcName)
Create a local dummy material with one technique but no passes.
virtual void collectPasses(TargetOperation &finalState, CompositionTargetPass *target)
Collect rendering passes.
void freeResources(bool forResizeOnly, bool clearReserveTextures)
Destroy local rendertextures and other resources.
map< String, MultiRenderTarget * >::type LocalMRTMap
Store a list of MRTs we've created.
bool getAlive() const
Get alive flag.
map< int, MaterialPtr >::type QuadMaterialMap
ReserveTextureMap mReserveTextures
Textures that are not currently in use, but that we want to keep for now, for example if we switch te...
CompositionTechnique * getTechnique()
Get CompositionTechnique used by this instance.
void queueRenderSystemOp(TargetOperation &finalState, RenderSystemOperation *op)
Queue a render system operation.
vector< Listener * >::type Listeners
Vector of listeners.
virtual void _compileTargetOperations(CompiledState &compiledState)
Recursively collect target states (except for final Pass).
std::pair< int, RenderSystemOperation * > RenderSystemOpPair
String getMRTTexLocalName(const String &baseName, size_t attachment)
Util method for assigning a local texture name to a MRT attachment.
CompositorChain * mChain
Composition chain of which this instance is part.
bool getEnabled() const
Get enabled flag.
virtual ~CompositorInstance()
void setAlive(bool value)
Set alive/active flag.
Compositor * getCompositor()
Get Compositor of which this is an instance.
void notifyCameraChanged(Camera *camera)
Notify this instance that the primary viewport's camera has changed.
CompositorInstance * mPreviousInstance
Previous instance (set by chain).
void addListener(Listener *l)
Add a listener.
void notifyResized()
Notify this instance that the primary surface has been resized.
Compositor * mCompositor
Compositor of which this is an instance.
vector< RenderSystemOpPair >::type RenderSystemOpPairs
bool mEnabled
Is this instance enabled?
const String & getSourceForTex(const String &name, size_t mrtIndex=0)
Get source texture name for a named local texture.
const String & getScheme() const
Returns the name of the scheme this compositor is using.
void _fireNotifyResourcesCreated(bool forResizeOnly)
Notify listeners of a material render.
void removeListener(Listener *l)
Remove a listener.
LocalTextureMap mLocalTextures
vector< TargetOperation >::type CompiledState
Class representing a Compositor object.
Class for managing Material settings for Ogre.
Defines the functionality of a 3D API.
A 'canvas' which can receive the results of a rendering operation.
Manages the organisation and rendering of a 'scene' i.e.
const size_t RENDER_QUEUE_COUNT
@ RENDER_QUEUE_MAX
Final possible render queue, don't exceed this.
std::map< K, V, P, A > type