Class RenderTarget
Use this if you want to render into buffer object, associated with one or more textures. If only a single texture is needed, the usage of a WritableTexture as a render target is preferred. Use the "Create__Tex"-Methods of this class to generate the textures you need. The order of the textures in the RenderTextures array is given by the RenderTargetTextureTypes enum.
Inherited Members
Namespace: Fusee.Engine.Imp.SharedAll
Assembly: Fusee.Engine.Imp.Graphics.Desktop.dll
Syntax
public class RenderTarget : IRenderTarget, IDisposable
Constructors
RenderTarget(TexRes)
Creates a new instance of type "RenderTarget".
Declaration
public RenderTarget(TexRes texRes)
Parameters
Type | Name | Description |
---|---|---|
TexRes | texRes | Resolution of the created Textures. |
Properties
DepthBufferHandle
Handle of the corresponding Depth Buffer (as render buffer). Used to dispose the object if it isn't needed anymore.
Declaration
public IBufferHandle DepthBufferHandle { get; set; }
Property Value
Type | Description |
---|---|
IBufferHandle |
Disposed
Declaration
public bool Disposed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
GBufferHandle
Handle of the corresponding G-Buffer. Used to dispose the object if it isn't needed anymore.
Declaration
public IBufferHandle GBufferHandle { get; set; }
Property Value
Type | Description |
---|---|
IBufferHandle |
IsDepthOnly
If the RenderTarget only contains a depth texture or a depth cube map, there will be no draw buffers.
Declaration
public bool IsDepthOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RenderTextures
Declaration
public IWritableTexture[] RenderTextures { get; }
Property Value
Type | Description |
---|---|
IWritableTexture[] |
TextureResolution
Sets the resolution of the render textures.
Declaration
public TexRes TextureResolution { get; }
Property Value
Type | Description |
---|---|
TexRes |
Methods
Dispose()
Public implementation of Dispose pattern callable by consumers.
Declaration
public void Dispose()
Dispose(Boolean)
The protected implementation of Dispose pattern callable by consumers.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Finalize()
Deconstruction of the render target.
Declaration
protected void Finalize()
SetAlbedoTex()
Generates a albedo and specular (alpha channel) texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetAlbedoTex()
SetDepthTex(TextureCompareMode, Compare)
Generates a depth texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetDepthTex(TextureCompareMode compareMode = TextureCompareMode.None, Compare compareFunc = Compare.Less)
Parameters
Type | Name | Description |
---|---|---|
TextureCompareMode | compareMode | |
Compare | compareFunc |
SetEmissiveTex()
Generates a emissive texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetEmissiveTex()
SetNormalTex()
Generates a normal texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetNormalTex()
SetPositionTex()
Generates a position texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetPositionTex()
SetSpecularTex()
Generates a specular texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetSpecularTex()
SetSSAOTex()
Generates a SSAO texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetSSAOTex()
SetSubsurfaceTex()
Generates a subsurface texture and sets it at the correct position in the RenderTextures Array.
Declaration
public virtual void SetSubsurfaceTex()
SetTexture(IWritableTexture, RenderTargetTextureTypes)
Sets a RenderTexture into the correct position in the RederTexture array.
Declaration
public virtual void SetTexture(IWritableTexture src, RenderTargetTextureTypes tex)
Parameters
Type | Name | Description |
---|---|---|
IWritableTexture | src | The source RenderTexture. |
RenderTargetTextureTypes | tex | The type of the texture. |
SetTextureFromRenderTarget(IRenderTarget, RenderTargetTextureTypes)
Sets a RenderTexture from another RenderTarget at the correct position in the RenderTexure array.
Declaration
public void SetTextureFromRenderTarget(IRenderTarget src, RenderTargetTextureTypes tex)
Parameters
Type | Name | Description |
---|---|---|
IRenderTarget | src | The source RenderTarget. |
RenderTargetTextureTypes | tex | The type of the texture. |
Events
DeleteBuffers
Event that deletes unmanaged buffer objects.
Declaration
public event EventHandler<EventArgs> DeleteBuffers
Event Type
Type | Description |
---|---|
System.EventHandler<System.EventArgs> |