C# Class FlatRedBall.Graphics.PostProcessing.PostProcessingEffectBase

Base class for post-processing effects
Mostra file Open project: vchelaru/FlatRedBall Class Usage Examples

Public Properties

Property Type Description
mTexture Microsoft.Xna.Framework.Graphics.Texture2D

Protected Properties

Property Type Description
mEffect Microsoft.Xna.Framework.Graphics.Effect
mEnabled bool
mRenderTargetFormat SurfaceFormat
mScreenRectangle Microsoft.Xna.Framework.Rectangle

Public Methods

Method Description
Draw ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &screenTexture, Rectangle &baseRectangle, Color clearColor ) : void

Draws the effect using the drawn screen texture Base method draws screen texture with current effect to current screen rectangle

DrawIfEnabled ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &screenTexture, Rectangle &baseRectangle, Color clearColor ) : void

Draws this effect if it is enabled (helper method)

InitializeEffect ( ) : void

Loads the effect and initializes values in the shader Base method sets the screen rectangle to full-screen

PostProcessingEffectBase ( ) : System

Creates a basic post-processing effect

PostProcessingEffectBase ( Effect effect ) : System

Uses the specified effect as a default post-processing effect

PostProcessingEffectBase ( String effectPath ) : System

Loads the specified effect as a default post-processing effect

PostProcessingEffectBase ( String effectPath, String contentManagerName ) : System

Loads the specified effect as a default post-processing effect

ToString ( ) : string

Reports this effect's name as a string

Update ( ) : void

Update the post processing effect

Protected Methods

Method Description
DrawToTexture ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &destinationTexture, Color clearColor, Microsoft.Xna.Framework.Graphics.Texture2D &screenTexture, Rectangle &sourceRectangle ) : void
SetEffectParameters ( Camera camera ) : void

Sets the effect's parameters before drawing (override and implement this in your own effects)

Private Methods

Method Description
DrawToCameraRenderTarget ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &texture, Color clearColor, Rectangle &sourceRectangle ) : void

This function MUST be overridden for any effects that make passes with multiple techniques.

DrawToCurrentTarget ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &texture, Color clearColor, Rectangle &sourceRectangle ) : void
UpdateToScreenSize ( ) : void

Method Details

Draw() public method

Draws the effect using the drawn screen texture Base method draws screen texture with current effect to current screen rectangle
public Draw ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &screenTexture, Rectangle &baseRectangle, Color clearColor ) : void
camera Camera The camera to use when drawing.
screenTexture Microsoft.Xna.Framework.Graphics.Texture2D The screen texture.
baseRectangle Microsoft.Xna.Framework.Rectangle The rectangle to draw to.
clearColor Color The background color.
return void

DrawIfEnabled() public method

Draws this effect if it is enabled (helper method)
public DrawIfEnabled ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &screenTexture, Rectangle &baseRectangle, Color clearColor ) : void
camera Camera The camera to use when drawing
screenTexture Microsoft.Xna.Framework.Graphics.Texture2D The screen texture
baseRectangle Microsoft.Xna.Framework.Rectangle The rectangle to draw to
clearColor Color The color to use as transparent
return void

DrawToTexture() protected method

protected DrawToTexture ( Camera camera, Microsoft.Xna.Framework.Graphics.Texture2D &destinationTexture, Color clearColor, Microsoft.Xna.Framework.Graphics.Texture2D &screenTexture, Rectangle &sourceRectangle ) : void
camera Camera
destinationTexture Microsoft.Xna.Framework.Graphics.Texture2D
clearColor Color
screenTexture Microsoft.Xna.Framework.Graphics.Texture2D
sourceRectangle Microsoft.Xna.Framework.Rectangle
return void

InitializeEffect() public method

Loads the effect and initializes values in the shader Base method sets the screen rectangle to full-screen
public InitializeEffect ( ) : void
return void

PostProcessingEffectBase() public method

Creates a basic post-processing effect
public PostProcessingEffectBase ( ) : System
return System

PostProcessingEffectBase() public method

Uses the specified effect as a default post-processing effect
public PostProcessingEffectBase ( Effect effect ) : System
effect Microsoft.Xna.Framework.Graphics.Effect
return System

PostProcessingEffectBase() public method

Loads the specified effect as a default post-processing effect
public PostProcessingEffectBase ( String effectPath ) : System
effectPath String
return System

PostProcessingEffectBase() public method

Loads the specified effect as a default post-processing effect
public PostProcessingEffectBase ( String effectPath, String contentManagerName ) : System
effectPath String
contentManagerName String
return System

SetEffectParameters() protected method

Sets the effect's parameters before drawing (override and implement this in your own effects)
protected SetEffectParameters ( Camera camera ) : void
camera Camera
return void

ToString() public method

Reports this effect's name as a string
public ToString ( ) : string
return string

Update() public method

Update the post processing effect
public Update ( ) : void
return void

Property Details

mEffect protected_oe property

The effect for this post processing effect
protected Effect,Microsoft.Xna.Framework.Graphics mEffect
return Microsoft.Xna.Framework.Graphics.Effect

mEnabled protected_oe property

Whether or not this effect is enabled
protected bool mEnabled
return bool

mRenderTargetFormat protected_oe property

The surface format for the render target for this effect (default is SurfaceFormat.Color)
protected SurfaceFormat mRenderTargetFormat
return SurfaceFormat

mScreenRectangle protected_oe property

The screen rectangle
protected Rectangle,Microsoft.Xna.Framework mScreenRectangle
return Microsoft.Xna.Framework.Rectangle

mTexture public_oe property

The texture that was rendered by the render target
public Texture2D,Microsoft.Xna.Framework.Graphics mTexture
return Microsoft.Xna.Framework.Graphics.Texture2D