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)
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.
void setScheme(const String &schemeName, bool reuseTextures=true)
Pick a technique to use to render this compositor based on a scheme.
const String & getTextureInstanceName(const String &name, size_t mrtIndex)
Get the instance name for a local texture.
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 * getTechnique()
Get CompositionTechnique used by this instance.
CompositionTechnique * mTechnique
Composition technique used by this instance.
void setTechnique(CompositionTechnique *tech, bool reuseTextures=true)
Change the technique we're using to render this compositor.
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.
const String & getSourceForTex(const String &name, size_t mrtIndex=0)
Get source texture name for a named local texture.
MaterialPtr createLocalMaterial(const String &srcName)
Create a local dummy material with one technique but no passes.
Compositor * getCompositor()
Get Compositor of which this is an instance.
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.
RenderTarget * getRenderTarget(const String &name)
Get the render target for a given render texture name.
bool getAlive() const
Get alive flag.
const String & getScheme() const
Returns the name of the scheme this compositor is using.
ReserveTextureMap mReserveTextures
Textures that are not currently in use, but that we want to keep for now, for example if we switch te...
void queueRenderSystemOp(TargetOperation &finalState, RenderSystemOperation *op)
Queue a render system operation.
vector< Listener * >::type Listeners
Vector of listeners.
RenderTarget * getTargetForTex(const String &name)
Get RenderTarget for a named local texture.
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.
map< int, MaterialPtr >::type QuadMaterialMap
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.
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.
map< CompositionTechnique::TextureDefinition *, TexturePtr >::type ReserveTextureMap
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?
CompositorChain * getChain()
Get Chain that this instance is part of.
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.
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
const size_t RENDER_QUEUE_COUNT
@ RENDER_QUEUE_MAX
Final possible render queue, don't exceed this.
std::map< K, V, P, A > type