FrameBuffer

clay. FrameBuffer

# new FrameBuffer()

Source:

Extends

Members

# __uid__ :number

Source:
Inherited From:
Type:
  • number

# depthBuffer :boolean

Source:

If use depth buffer

Type:
  • boolean

# viewport :Object

Source:
Type:
  • Object

Methods

# after(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('after' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# attach(texture, attachmentopt, targetopt)

Source:

Attach a texture(RTT) to the framebuffer

Parameters:
Name Type Attributes Default Description
texture clay.Texture
attachment number <optional>
gl.COLOR_ATTACHMENT0
target number <optional>
gl.TEXTURE_2D

# before(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('before' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# bind(renderer)

Source:

Bind the framebuffer to given renderer before rendering

Parameters:
Name Type Description
renderer clay.Renderer

# detach(attachmentopt, targetopt)

Source:

Detach a texture

Parameters:
Name Type Attributes Default Description
attachment number <optional>
gl.COLOR_ATTACHMENT0
target number <optional>
gl.TEXTURE_2D

# dispose(_gl)

Source:

Dispose

Parameters:
Name Type Description
_gl WebGLRenderingContext

# error(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('error')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# getTextureHeight()

Source:

Get attached texture height {number}

# getTextureWidth()

Source:

Get attached texture width {number}

# has(name, action) → {boolean}

Source:
Inherited From:
Mixes In:

If registered the event handler

Parameters:
Name Type Description
name string
action function
Returns:
Type
boolean

# off(action, contextopt)

Source:
Inherited From:
Mixes In:

Remove event listener

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# on(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event handler

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# once(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event, event will only be triggered once and then removed

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# success(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('success')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# trigger(name)

Source:
Inherited From:
Mixes In:

Trigger event

Parameters:
Name Type Description
name string

# unbind(renderer)

Source:

Unbind the frame buffer after rendering

Parameters:
Name Type Description
renderer clay.Renderer