B.Render.Target()

Represents rendering output target.

To create the object use device.makeTarget().

METHODS:

device()

Returns linked rendering device.

RETURNS:

width()

Returns width.

RETURNS:

{number}

height()

Returns height.

RETURNS:

{number}

size()

Returns width and height.

RETURNS:

multisamples()

Returns multisample coverage mask size.

RETURNS:

{number}

color(object)

Sets color target or multiple color targets.

To check maximum color targets count use device.caps().colorTargetCount.

target.color(mip);
target.color(texture); // equivalent to target.color(texture.mip(0))

// multiple color targets
target.color([mip0, mip1, texture]);

PARAMETERS:

RETURNS:

THROWS:

{B.Render.Error}

if object's size or format are inappropriate or the object is not specified.

color(index)

Gets color target or multiple color targets.

var mip = target.color();

// multiple color targets
var array = target.color();
var mip1 = target.color()[1];
var mip1 = target.color(1); // equivalent to above

PARAMETERS:

{number} [index]

RETURNS:

{null | B.Render.Mip | Array.<B.Render.Mip>}

depth(object)

Sets depth-stencil target.

PARAMETERS:

{null | B.Render.Depth} object

RETURNS:

THROWS:

{B.Render.Error}

if object's size or format are inappropriate

depth()

Gets depth-stencil target.

RETURNS:

{null | B.Render.Depth}

clone(scale)

Clones this target to a new target object (it also clones all linked resources).

PARAMETERS:

{number} [scale] = 1.0

size scale factor

RETURNS:

free()

Frees all internal data and detach the resource from linked rendering device.

METHODS: