Editor.Assets.RenderTarget
ClassA 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
Properties
Methods
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
readonlycacheFile:Path
Path to the cached asset file.
Inherited from
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
readonlyfileMeta:AssetImportMetadata
Import metadata for the asset.
Inherited from
id
readonlyid:Uuid
The unique id of the entity.
Inherited from
inputTexture
inputTexture:
Texture
Source texture to render into the target.
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
Inherited from
msaaStrategy
msaaStrategy:
MSAAStrategy
Multisample antialiasing configuration.
name
readonlyname:string
The name of the asset.
Inherited from
resolution
resolution:
Size
Pixel dimensions of the render target.
resolutionScale
resolutionScale:
number
type
readonlytype:string
The entity's type.
Inherited from
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()
staticgetMeta():Meta
Returns metadata about this type.
Returns
Overrides
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
Inherited from
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean