Preparing search index...

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

        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}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    allocateMips: boolean

    Generate mipmap levels for the render target.

    antialiasingMode: AntialiasingMode

    Antialiasing technique applied to the render target.

    cacheFile: Path

    Path to the cached asset file.

    clearColor: vec4

    Color to clear the render target with each frame.

    clearColorOption: ClearColorOption

    Determines when and how the render target is cleared.

    depthBuffer: DepthBufferStrategy

    Depth buffer strategy used for rendering.

    Import metadata for the asset.

    id: Uuid

    The unique id of the entity.

    inputTexture: Texture

    Source texture to render into the target.

    meta: Meta

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

    msaaStrategy: MSAAStrategy

    Multisample antialiasing configuration.

    name: string

    The name of the asset.

    resolution: Editor.Size

    Pixel dimensions of the render target.

    type: string

    The entity's type.

    useScreenResolution: boolean

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

    Methods

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

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

      Parameters

      Returns boolean