C# Класс hyades.graphics.PostProcessor

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
color_rt Microsoft.Xna.Framework.Graphics.RenderTarget2D
depth_rt Microsoft.Xna.Framework.Graphics.RenderTarget2D
result_rt Microsoft.Xna.Framework.Graphics.RenderTarget2D

Открытые методы

Метод Описание
Bloom ( RenderTarget2D source, RenderTarget2D result, float threshold, float bloom_intensity, float base_intensity, float bloom_saturation, float base_saturation ) : void

Applies a bloom effect to the specified render target, writes the result to the specified render target.

Blur ( RenderTarget2D source, RenderTarget2D result, float sigma ) : void

Applies a blur to the specified render target, writes the result to the specified render target.

DepthBlur ( RenderTarget2D source, RenderTarget2D result, RenderTarget2D depthTexture, float sigma ) : void

Applies a blur to the specified render target, using a depth texture to prevent pixels from blurring with pixels that are "in front"

DepthOfField ( RenderTarget2D source, RenderTarget2D result, RenderTarget2D depthTexture, Camera camera, DepthOfFieldType dofType, float focalDistance, float focalWidth, float time ) : void

Performs tone mapping on the specified render target

FlushCache ( ) : void

Disposes all intermediate textures in the cache

GetInstance ( GraphicsDevice device ) : PostProcessor
PostProcessor ( GraphicsDevice device ) : System

The class constructor

Приватные методы

Метод Описание
GenerateDownscaleTargetHW ( RenderTarget2D source, RenderTarget2D result ) : void

Downscales the source to 1/16th size, using hardware filtering

GenerateDownscaleTargetSW ( RenderTarget2D source, RenderTarget2D result ) : void

Downscales the source to 1/16th size, using software(shader) filtering

GetIntermediateTexture ( int width, int height, SurfaceFormat format ) : IntermediateTexture

Checks the cache to see if a suitable rendertarget has already been created and isn't in use. Otherwise, creates one according to the parameters

GetIntermediateTexture ( int width, int height, SurfaceFormat format, int msQuality ) : IntermediateTexture
PostProcess ( RenderTarget2D source, RenderTarget2D result, Effect effect ) : void

Performs a post-processing step using a single source texture

Swap ( RenderTarget2D &rt1, RenderTarget2D &rt2 ) : void

Swaps two RenderTarget's

Описание методов

Bloom() публичный Метод

Applies a bloom effect to the specified render target, writes the result to the specified render target.
public Bloom ( RenderTarget2D source, RenderTarget2D result, float threshold, float bloom_intensity, float base_intensity, float bloom_saturation, float base_saturation ) : void
source Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target to use as the source
result Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target to use as the result
threshold float
bloom_intensity float
base_intensity float
bloom_saturation float
base_saturation float
Результат void

Blur() публичный Метод

Applies a blur to the specified render target, writes the result to the specified render target.
public Blur ( RenderTarget2D source, RenderTarget2D result, float sigma ) : void
source Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target to use as the source
result Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target to use as the result
sigma float The standard deviation used for gaussian weights
Результат void

DepthBlur() публичный Метод

Applies a blur to the specified render target, using a depth texture to prevent pixels from blurring with pixels that are "in front"
public DepthBlur ( RenderTarget2D source, RenderTarget2D result, RenderTarget2D depthTexture, float sigma ) : void
source Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target to use as the source
result Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target to use as the result
depthTexture Microsoft.Xna.Framework.Graphics.RenderTarget2D The depth texture to use
sigma float The standard deviation used for gaussian weights
Результат void

DepthOfField() публичный Метод

Performs tone mapping on the specified render target
public DepthOfField ( RenderTarget2D source, RenderTarget2D result, RenderTarget2D depthTexture, Camera camera, DepthOfFieldType dofType, float focalDistance, float focalWidth, float time ) : void
source Microsoft.Xna.Framework.Graphics.RenderTarget2D The source render target
result Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target to which the result will be output
depthTexture Microsoft.Xna.Framework.Graphics.RenderTarget2D The render target containing scene depth
camera Camera The camera used to render the scene
dofType DepthOfFieldType The type of DOF effect to apply
focalDistance float The distance to the camera focal point
focalWidth float The width of the camera focal point
time float
Результат void

FlushCache() публичный Метод

Disposes all intermediate textures in the cache
public FlushCache ( ) : void
Результат void

GetInstance() публичный статический Метод

public static GetInstance ( GraphicsDevice device ) : PostProcessor
device GraphicsDevice
Результат PostProcessor

PostProcessor() публичный Метод

The class constructor
public PostProcessor ( GraphicsDevice device ) : System
device GraphicsDevice The GraphicsDevice to use for rendering
Результат System

Описание свойств

color_rt публичное свойство

public RenderTarget2D,Microsoft.Xna.Framework.Graphics color_rt
Результат Microsoft.Xna.Framework.Graphics.RenderTarget2D

depth_rt публичное свойство

public RenderTarget2D,Microsoft.Xna.Framework.Graphics depth_rt
Результат Microsoft.Xna.Framework.Graphics.RenderTarget2D

result_rt публичное свойство

public RenderTarget2D,Microsoft.Xna.Framework.Graphics result_rt
Результат Microsoft.Xna.Framework.Graphics.RenderTarget2D