Skip to main content

Editor.Assets.RenderTarget

Class

A native asset that provides the target for a camera to provide its output to.

A native asset that provides the target for a camera to provide its output to. Import with Editor.Model.AssetManager#createNativeAsset.

Index

Example

const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const assetManager = model.project.assetManager;

// Create a fully-configured RenderTarget
const rt = assetManager.createNativeAsset(
'RenderTarget', 'MainRT', new Editor.Model.SourcePath(new Editor.Path(''), Editor.Model.SourceRootDirectory.Assets)
) as Editor.Assets.RenderTarget;

// Set custom resolution (disable screen resolution first)
rt.useScreenResolution = false;
rt.resolution = new Editor.Size(1080, 1920);
console.log(`Resolution: ${rt.resolution}`);

// Configure antialiasing
rt.antialiasingMode = Editor.Assets.AntialiasingMode.MSAA;
rt.msaaStrategy = Editor.Assets.MSAAStrategy.Default;

// Set clear color
rt.clearColorOption = Editor.Assets.ClearColorOption.CustomColor;
rt.clearColor = new vec4(0.0, 0.0, 0.0, 1.0);

// Configure depth buffer
rt.depthBuffer = Editor.Assets.DepthBufferStrategy.ForceOn;

// Enable mipmap generation
rt.allocateMips = true;

console.log(`"${rt.name}": AA=${rt.antialiasingMode}, clear=${rt.clearColorOption}, depth=${rt.depthBuffer}, mips=${rt.allocateMips}`);

Extends

Properties

allocateMips

allocateMips: boolean

Generate mipmap levels for the render target.


antialiasingMode

antialiasingMode: AntialiasingMode

Antialiasing technique applied to the render target.


antialiasingQuality

antialiasingQuality: AntialiasingQuality


cacheFile

readonly cacheFile: Path

Path to the cached asset file.

Inherited from

Texture.cacheFile


clearColor

clearColor: vec4

Color to clear the render target with each frame.


clearColorOption

clearColorOption: ClearColorOption

Determines when and how the render target is cleared.


depthBuffer

depthBuffer: DepthBufferStrategy

Depth buffer strategy used for rendering.


fileMeta

readonly fileMeta: AssetImportMetadata

Import metadata for the asset.

Inherited from

Texture.fileMeta


id

readonly id: Uuid

The unique id of the entity.

Inherited from

Texture.id


inputTexture

inputTexture: Texture

Source texture to render into the target.


meta

readonly meta: Meta

Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

Inherited from

Texture.meta


msaaStrategy

msaaStrategy: MSAAStrategy

Multisample antialiasing configuration.


name

readonly name: string

The name of the asset.

Inherited from

Texture.name


resolution

resolution: Size

Pixel dimensions of the render target.


resolutionScale

resolutionScale: number


type

readonly type: string

The entity's type.

Inherited from

Texture.type


useScreenResolution

useScreenResolution: boolean

Whether to use the screen resolution instead of an explicit one.

Methods

getDirectlyReferencedEntities()

getDirectlyReferencedEntities(): Entity[]

A list of entities which this entity has a reference to.

Returns

Entity[]

Inherited from

Texture.getDirectlyReferencedEntities


getMeta()

static getMeta(): Meta

Returns metadata about this type.

Returns

Meta

Overrides

Texture.getMeta


getOwnedEntities()

getOwnedEntities(): Entity[]

A list of entities which has a reference to this entity.

Returns

Entity[]

Inherited from

Texture.getOwnedEntities


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

Texture.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Texture.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Texture.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Texture.isSame