Show / Hide Table of Contents

Class WritableTexture

Use writable textures if you want to render into a texture. Does NOT offer access to the pixel data.

Inheritance
System.Object
WritableTexture
Implements
IWritableTexture
IExposedTexture
ITextureBase
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Fusee.Engine.Core
Assembly: Fusee.Engine.Core.dll
Syntax
public class WritableTexture : IWritableTexture, IExposedTexture, ITextureBase, IDisposable

Constructors

WritableTexture(RenderTargetTextureTypes, ImagePixelFormat, Int32, Int32, Boolean, TextureFilterMode, TextureWrapMode, TextureCompareMode, Compare)

Creates a new instance of type "WritableTexture".

Declaration
public WritableTexture(RenderTargetTextureTypes texType, ImagePixelFormat colorFormat, int width, int height, bool generateMipMaps = true, TextureFilterMode filterMode = TextureFilterMode.NearestMipmapLinear, TextureWrapMode wrapMode = TextureWrapMode.Repeat, TextureCompareMode compareMode = TextureCompareMode.None, Compare compareFunc = Compare.Less)
Parameters
Type Name Description
RenderTargetTextureTypes texType

Defines the type of the render texture.

ImagePixelFormat colorFormat

The color format of the texture, ImagePixelFormat

System.Int32 width

Width in px.

System.Int32 height

Height in px.

System.Boolean generateMipMaps

Defines if mipmaps are created.

TextureFilterMode filterMode

Defines the filter mode TextureFilterMode.

TextureWrapMode wrapMode

Defines the wrapping mode TextureWrapMode.

TextureCompareMode compareMode

The textures compare mode. If uncertain, leaf on NONE, this is only important for depth (shadow) textures (TextureCompareMode).

Compare compareFunc

The textures compare function. If uncertain, leaf on LEESS, this is only important for depth (shadow) textures and if the CompareMode isn't NONE (Compare)

Fields

AsImage

Is treated as "image2D" in the shader.

Declaration
public bool AsImage
Field Value
Type Description
System.Boolean

Properties

CompareFunc

Specifies the texture's comparison function, see Compare.

Declaration
public Compare CompareFunc { get; }
Property Value
Type Description
Compare

CompareMode

Specifies the texture's comparison mode, see TextureCompareMode.

Declaration
public TextureCompareMode CompareMode { get; }
Property Value
Type Description
TextureCompareMode

DoGenerateMipMaps

Specifies if mipmaps are created for this texture.

Declaration
public bool DoGenerateMipMaps { get; }
Property Value
Type Description
System.Boolean

FilterMode

Specifies the texture's filter mode, see TextureWrapMode.

Declaration
public TextureFilterMode FilterMode { get; }
Property Value
Type Description
TextureFilterMode

Height

Height in pixels.

Declaration
public int Height { get; }
Property Value
Type Description
System.Int32

PixelFormat

PixelFormat provides additional information about pixel encoding.

Declaration
public ImagePixelFormat PixelFormat { get; }
Property Value
Type Description
ImagePixelFormat

SessionUniqueIdentifier

SessionUniqueIdentifier is used to verify a Textures's uniqueness in the current session.

Declaration
public Suid SessionUniqueIdentifier { get; }
Property Value
Type Description
Suid

TextureHandle

Opaque handle to the texture object on the gpu.

Declaration
public ITextureHandle TextureHandle { get; }
Property Value
Type Description
ITextureHandle

TextureType

Type of the render texture, RenderTargetTextureTypes.

Declaration
public RenderTargetTextureTypes TextureType { get; }
Property Value
Type Description
RenderTargetTextureTypes

Width

Width in pixels.

Declaration
public int Width { get; }
Property Value
Type Description
System.Int32

WrapMode

Specifies the texture's wrap mode, see TextureWrapMode.

Declaration
public TextureWrapMode WrapMode { get; }
Property Value
Type Description
TextureWrapMode

Methods

CreateAlbedoTex(Int32, Int32, ImagePixelFormat)

Create a texture that is intended to save albedo (rgb channels) information.

Declaration
public static WritableTexture CreateAlbedoTex(int width, int height, ImagePixelFormat pxFormat)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

Returns
Type Description
WritableTexture

CreateDepthTex(Int32, Int32, ImagePixelFormat, TextureCompareMode, Compare)

Create a texture that is intended to save depth information.

Declaration
public static WritableTexture CreateDepthTex(int width, int height, ImagePixelFormat pxFormat, TextureCompareMode compareMode = TextureCompareMode.None, Compare compareFunc = Compare.Less)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

TextureCompareMode compareMode

The textures compare mode. If uncertain, leaf on NONE, this is only important for depth (shadow) textures (TextureCompareMode).

Compare compareFunc

The textures compare function. If uncertain, leaf on LEESS, this is only important for depth (shadow) textures and if the CompareMode isn't NONE (Compare)

Returns
Type Description
WritableTexture

CreateEmissionTex(Int32, Int32, ImagePixelFormat)

Create a texture that is intended to save emissive color.

Declaration
public static WritableTexture CreateEmissionTex(int width, int height, ImagePixelFormat pxFormat)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

Returns
Type Description
WritableTexture

CreateForComputeShader(Int32, Int32)

Create a texture that is intended to save SSAO information.

Declaration
public static WritableTexture CreateForComputeShader(int width, int height)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

Returns
Type Description
WritableTexture

CreateNormalTex(Int32, Int32, ImagePixelFormat)

Create a texture that is intended to save normal information.

Declaration
public static WritableTexture CreateNormalTex(int width, int height, ImagePixelFormat pxFormat)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

Returns
Type Description
WritableTexture

CreatePosTex(Int32, Int32, ImagePixelFormat)

Create a texture that is intended to save position information.

Declaration
public static WritableTexture CreatePosTex(int width, int height, ImagePixelFormat pxFormat)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

Returns
Type Description
WritableTexture

CreateSpecularTex(Int32, Int32, ImagePixelFormat)

Create a texture that is intended to save specular information, depending on whether standard or physically based calculation is used.

Declaration
public static WritableTexture CreateSpecularTex(int width, int height, ImagePixelFormat pxFormat)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

Returns
Type Description
WritableTexture

CreateSSAOTex(Int32, Int32, ImagePixelFormat)

Create a texture that is intended to save SSAO information.

Declaration
public static WritableTexture CreateSSAOTex(int width, int height, ImagePixelFormat pxFormat)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

Returns
Type Description
WritableTexture

CreateSubsurfaceTex(Int32, Int32, ImagePixelFormat)

Create a texture that is intended to save subsurface color and strength.

Declaration
public static WritableTexture CreateSubsurfaceTex(int width, int height, ImagePixelFormat pxFormat)
Parameters
Type Name Description
System.Int32 width

Width in px.

System.Int32 height

Height in px.

ImagePixelFormat pxFormat

The color format of this texture.

Returns
Type Description
WritableTexture

Dispose()

Fire dispose texture event

Declaration
public void Dispose()

Dispose(Boolean)

Fire dispose texture event

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

Finalize()

Destructor calls Dispose() in order to fire TextureChanged event.

Declaration
protected void Finalize()

Events

TextureChanged

TextureChanged event notifies observing TextureManager about property changes and the Texture's disposal.

Declaration
public event EventHandler<TextureEventArgs> TextureChanged
Event Type
Type Description
System.EventHandler<TextureEventArgs>

Implements

IWritableTexture
IExposedTexture
ITextureBase
System.IDisposable
In This Article
  • Constructors
    • WritableTexture(RenderTargetTextureTypes, ImagePixelFormat, Int32, Int32, Boolean, TextureFilterMode, TextureWrapMode, TextureCompareMode, Compare)
  • Fields
    • AsImage
  • Properties
    • CompareFunc
    • CompareMode
    • DoGenerateMipMaps
    • FilterMode
    • Height
    • PixelFormat
    • SessionUniqueIdentifier
    • TextureHandle
    • TextureType
    • Width
    • WrapMode
  • Methods
    • CreateAlbedoTex(Int32, Int32, ImagePixelFormat)
    • CreateDepthTex(Int32, Int32, ImagePixelFormat, TextureCompareMode, Compare)
    • CreateEmissionTex(Int32, Int32, ImagePixelFormat)
    • CreateForComputeShader(Int32, Int32)
    • CreateNormalTex(Int32, Int32, ImagePixelFormat)
    • CreatePosTex(Int32, Int32, ImagePixelFormat)
    • CreateSpecularTex(Int32, Int32, ImagePixelFormat)
    • CreateSSAOTex(Int32, Int32, ImagePixelFormat)
    • CreateSubsurfaceTex(Int32, Int32, ImagePixelFormat)
    • Dispose()
    • Dispose(Boolean)
    • Finalize()
  • Events
    • TextureChanged
  • Implements
Generated by DocFX
GitHub Repo
Back to top