fluidvis
Public Member Functions | Static Public Member Functions | List of all members
sx::Pass Class Reference
Inheritance diagram for sx::Pass:
sx::SXResource sx::EffectObject

Public Member Functions

EX Pass (const string &id)
 
EX ~Pass ()
 
EX void load ()
 
EX bool isLoaded () const
 
EX void setVisible (bool visible)
 
EX bool isVisible () const
 
EX void setShader (Shader *shader)
 
EX ShadergetShader ()
 
EX void addRenderObject (RenderObject &object)
 
EX void removeRenderObject (const string &id)
 
EX void removeRenderObjects ()
 
EX void useBackgroundQuad (bool use)
 
EX void addTempRenderObjects (const vector< RenderObject * > &temp)
 
EX vector< RenderObject * > & getTempRenderObjects ()
 
EX void addUniform (Uniform &uniform)
 
EX void removeUniform (const string &name)
 
EX void removeUniforms ()
 
EX void setWireframe (bool wireframe)
 
EX bool isWireframe () const
 
EX void setClearColorBuffer (bool clear)
 
EX bool isClearingColorBuffer () const
 
EX void setClearDepthBuffer (bool clear)
 
EX bool isClearingDepthBuffer () const
 
EX void setFragmentBlendFactor (BlendFactor factor)
 
EX BlendFactor getFragmentBlendFactor () const
 
EX void setTargetBlendFactor (BlendFactor factor)
 
EX BlendFactor getTargetBlendFactor () const
 
EX void setDepthTest (DepthTest test)
 
EX DepthTest getDepthTest ()
 
EX void setWriteDepthBuffer (bool write)
 
EX bool isWritingDepthBuffer ()
 
EX void setOutput (RenderTarget &target, vector< Texture * > targets)
 
EX void setOutput (RenderTarget &target, vector< Volume * > targets)
 
EX void setOutput (BufferedMesh *target)
 
EX void setLayerCoordinate (UniformFloat *layerCoordinate)
 
EX void setStartLayer (UniformFloat *startLayer)
 
EX void setEndLayer (UniformFloat *endLayer)
 
EX void render ()
 
EX void execute (vector< string > &input)
 
- Public Member Functions inherited from sx::SXResource
virtual EX ~SXResource ()
 
EX const string & getID () const
 

Static Public Member Functions

static EX void applyWireframe (bool wireframe)
 

Additional Inherited Members

- Protected Attributes inherited from sx::SXResource
string id
 

Constructor & Destructor Documentation

EX sx::Pass::Pass ( const string &  id)

constructor

EX sx::Pass::~Pass ( )

deconstructor

Member Function Documentation

EX void sx::Pass::addRenderObject ( RenderObject object)

Adds a RenderObject object to the Pass. Object will be rendered every time the render method of the pass is invoced.

EX void sx::Pass::addTempRenderObjects ( const vector< RenderObject * > &  temp)

Adds RenderObjects, which will be only rendered the next time method render in Pass is invoced. Those RenderObjects will be rendered in the order given by temp.

EX void sx::Pass::addUniform ( Uniform uniform)

Adds a uniform variable to the Pass. The uniform's name must be unique in the Pass, otherwise an exception is thrown.

Parameters
uniforma uniform variable
Exceptions
ifthe name of the uniform variable isn't unique in the set of uniforms, an exception Exception of type EX_AMBIGUOUS is thrown
static EX void sx::Pass::applyWireframe ( bool  wireframe)
static

If wireframe is true, the RenderObjects rendered after the call of this function are rendered in wireframe. Otherwise the inside of the polygons is filled with fragments.

EX void sx::Pass::execute ( vector< string > &  input)
virtual

invokes method render

Implements sx::EffectObject.

EX DepthTest sx::Pass::getDepthTest ( )

getter

EX BlendFactor sx::Pass::getFragmentBlendFactor ( ) const

getter

EX Shader* sx::Pass::getShader ( )

getter

EX BlendFactor sx::Pass::getTargetBlendFactor ( ) const

getter

EX vector<RenderObject *>& sx::Pass::getTempRenderObjects ( )

Returns a reference to an empty vector. The RenderObjects inserted into this reference will be rendered the next time method render in Pass is invoced. Those RenderObjects will be rendered in the order they are inserted into the vector.

EX bool sx::Pass::isClearingColorBuffer ( ) const

getter

EX bool sx::Pass::isClearingDepthBuffer ( ) const

getter

EX bool sx::Pass::isLoaded ( ) const
virtual

as this is always loaded, the return value is always true

Implements sx::SXResource.

EX bool sx::Pass::isVisible ( ) const

getter

EX bool sx::Pass::isWireframe ( ) const

getter

EX bool sx::Pass::isWritingDepthBuffer ( )

Returns wether rendering into the rendertarget has an effect on the depthbuffer or not.

Returns
true iff rendering into the rendertarget alters the depthbuffer
EX void sx::Pass::load ( )
virtual

as this is always loaded, this method has no effect on this

Implements sx::SXResource.

EX void sx::Pass::removeRenderObject ( const string &  id)

Removes the RenderObject with identifyer id. The RenderObject won't be rendered again. If no RenderObject with identifyer id was inserted into the Pass, the method doesn't do anything.

EX void sx::Pass::removeRenderObjects ( )

Removes all RenderObjects, which were inserted with addRenderObject. Those RenderObjects won't be rendered again.

EX void sx::Pass::removeUniform ( const string &  name)

Removes the uniform named name. If such a uniform variable doesn't exist, an exception is thrown.

Parameters
namename of the uniform variable
Exceptions
ifa uniform variable named name doesn't exist, an Exception of type EX_NODATA is thrown
EX void sx::Pass::removeUniforms ( )

removes all uniforms

EX void sx::Pass::render ( )

Renders all RenderObjects to the rendertarget, and the textures, if a rendertarget with textures is set. Renders all RenderObjects to the rendertarget, and the volumes, if a rendertarget with volumes is set. Stores the geometry generated with RenderObjects in geometryTarget, if geometryTarget is set. If no shader is attached to a RenderObject, the shader of the pass is used. If no rendertarget has been specified, the method doesn't do anything. If visible is false, the method doesn't do anything. Iff both shaders are null, or mesh is null, render doesn't do anything.

EX void sx::Pass::setClearColorBuffer ( bool  clear)

setter

EX void sx::Pass::setClearDepthBuffer ( bool  clear)

setter

EX void sx::Pass::setDepthTest ( DepthTest  test)

setter

EX void sx::Pass::setEndLayer ( UniformFloat endLayer)

setter

EX void sx::Pass::setFragmentBlendFactor ( BlendFactor  factor)

setter

EX void sx::Pass::setLayerCoordinate ( UniformFloat layerCoordinate)

setter

EX void sx::Pass::setOutput ( RenderTarget target,
vector< Texture * >  targets 
)

Assigns a RenderTarget to Pass. The output of pass is rendered to the textures in targets. If RenderTarget target is the display, the textures in targets remain unchanged. If no RenderTarget is set, method render doesn't do anything.

EX void sx::Pass::setOutput ( RenderTarget target,
vector< Volume * >  targets 
)

Assigns a RenderTarget to Pass. The output of pass is rendered to the textures in targets. If RenderTarget target is the display, the textures in targets remain unchanged. If no RenderTarget is set, method render doesn't do anything.

EX void sx::Pass::setOutput ( BufferedMesh target)

Assigns a geometry target to Pass. The geometry generated by method render() is stored in the BufferedMesh target. The method will only render geometry to those VertexBuffers, which have identifiers added to the shader of Pass with method addTransformFeedbackBuffer(). If target is 0, no geometry target is used.

EX void sx::Pass::setShader ( Shader shader)

setter

EX void sx::Pass::setStartLayer ( UniformFloat startLayer)

setter

EX void sx::Pass::setTargetBlendFactor ( BlendFactor  factor)

setter

EX void sx::Pass::setVisible ( bool  visible)

setter

EX void sx::Pass::setWireframe ( bool  wireframe)

setter

EX void sx::Pass::setWriteDepthBuffer ( bool  write)

Determines, if rendering into the rendertarget has an effect on the depthbuffer or not.

Parameters
writetrue iff rendering into the rendertarget should alter the depthbuffer
EX void sx::Pass::useBackgroundQuad ( bool  use)

Determines if a background quad is rendered. If use equals true, a call of render() will render the RenderObject backgroundQuad. If use equals false, the backgroundQuad will not be rendered by a call of render(). If another RenderObject with id "sx.engine.core.Pass.cpp.backgroundQuad" was added to the Pass with method addRenderObject, useBackgroundQuad has no effect. The backgroundQuad is made of two triangles with two buffers: vertices(attributeSize = 3): triangle nr1: -1 -1 0 1 -1 0 1 1 0 triangle nr2: -1 -1 0 1 1 0 -1 1 0 texcoords(attributeSize = 2): triangle nr1: 0 0 1 0 1 1 triangle nr2: 0 0 1 1 0 1


The documentation for this class was generated from the following file: