Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DisplacementMapEffect

Hierarchy

Index

Constructors

constructor

Properties

componentX

componentX: number

componentY

componentY: number

Protected indexBuffer

indexBuffer: IndexBuffer3D

The internally used index buffer used on rendering.

Protected indexBufferSize

indexBufferSize: number

The current size of the index buffer (in number of indices).

mapRepeat

mapRepeat: boolean

mapTexture

mapTexture: Texture

mvpMatrix3D

mvpMatrix3D: Matrix3D

The MVP (modelview-projection) matrix transforms vertices into clipspace.

onRestore

onRestore: function

The that you provide here will be called after a context loss. Call both "upload..." methods from within the callback to restore any vertex or index buffers. The callback will be executed with the effect as its sole parameter.

Type declaration

    • (Effect: any): void
    • Parameters

      • Effect: any

      Returns void

Protected program

program: Program

Returns the current program, either by creating a new one (via createProgram) or by getting it from the Painter. Do not override this method! Instead, implement createProgram.

programBaseName

programBaseName: string

Returns the base name for the program. @default the fully qualified class name

programName

programName: string

Returns the full name of the program, which is used to register it at the current Painter.

The default implementation efficiently combines the program's base and variant names (e.g. LightEffect#42). It shouldn't be necessary to override this method.

programVariantName

programVariantName: number

Override this method if the effect requires a different program depending on the current settings. Ideally, you do this by creating a bit mask encoding all the options. This method is called often, so do not allocate any temporary objects when overriding.

@default 0

scaleX

scaleX: number

scaleY

scaleY: number

texture

texture: Texture

The texture to be mapped onto the vertices.

textureRepeat

textureRepeat: boolean

Indicates if pixels at the edges will be repeated or clamped. Only works for power-of-two textures. @default false

textureSmoothing

textureSmoothing: string

The smoothing filter that is used for the texture. @default bilinear

Protected vertexBuffer

vertexBuffer: VertexBuffer3D

The internally used vertex buffer used on rendering.

Protected vertexBufferSize

vertexBufferSize: number

The current size of the vertex buffer (in blocks of 32 bits).

vertexFormat

vertexFormat: VertexDataFormat

The data format that this effect requires from the VertexData that it renders: "position:number2"

Static STD_VERTEX_SHADER

STD_VERTEX_SHADER: string

The AGAL code for the standard vertex shader that most filters will use. It simply transforms the vertex coordinates to clip-space and passes the texture coordinates to the fragment program (as 'v0').

Static VERTEX_FORMAT

VERTEX_FORMAT: VertexDataFormat

Methods

dispose

  • dispose(): void

Protected get_componentX

  • get_componentX(): number

Protected get_componentY

  • get_componentY(): number

Protected get_indexBuffer

  • get_indexBuffer(): IndexBuffer3D

Protected get_indexBufferSize

  • get_indexBufferSize(): number

Protected get_mapRepeat

  • get_mapRepeat(): boolean

Protected get_mapTexture

Protected get_mvpMatrix3D

  • get_mvpMatrix3D(): Matrix3D

Protected get_onRestore

  • get_onRestore(): function

Protected get_program

Protected get_programBaseName

  • get_programBaseName(): string

Protected get_programName

  • get_programName(): string

Protected get_programVariantName

  • get_programVariantName(): number

Protected get_scaleX

  • get_scaleX(): number

Protected get_scaleY

  • get_scaleY(): number

Protected get_texture

Protected get_textureRepeat

  • get_textureRepeat(): boolean

Protected get_textureSmoothing

  • get_textureSmoothing(): string

Protected get_vertexBuffer

  • get_vertexBuffer(): VertexBuffer3D

Protected get_vertexBufferSize

  • get_vertexBufferSize(): number

Protected get_vertexFormat

purgeBuffers

  • purgeBuffers(vertexBuffer?: boolean, indexBuffer?: boolean): void

render

  • render(firstIndex?: number, numTriangles?: number): void
  • Draws the triangles described by the index- and vertex-buffers, or a range of them. This calls beforeDraw, context.drawTriangles, and afterDraw, in this order.

    Parameters

    • Optional firstIndex: number
    • Optional numTriangles: number

    Returns void

Protected set_componentX

  • set_componentX(value: number): number

Protected set_componentY

  • set_componentY(value: number): number

Protected set_mapRepeat

  • set_mapRepeat(value: boolean): boolean

Protected set_mapTexture

Protected set_mvpMatrix3D

  • set_mvpMatrix3D(value: Matrix3D): Matrix3D

Protected set_onRestore

  • set_onRestore(value: function): function

Protected set_programBaseName

  • set_programBaseName(value: string): string

Protected set_scaleX

  • set_scaleX(value: number): number

Protected set_scaleY

  • set_scaleY(value: number): number

Protected set_texture

Protected set_textureRepeat

  • set_textureRepeat(value: boolean): boolean

Protected set_textureSmoothing

  • set_textureSmoothing(value: string): string

uploadIndexData

  • uploadIndexData(indexData: IndexData, bufferUsage?: string): void
  • Uploads the given index data to the internal index buffer. If the buffer is too small, a new one is created automatically.

    @param indexData The IndexData instance to upload. @param bufferUsage The expected buffer usage. Use one of the constants defined in Context3DBufferUsage. Only used when the method call causes the creation of a new index buffer.

    Parameters

    • indexData: IndexData
    • Optional bufferUsage: string

    Returns void

uploadVertexData

  • uploadVertexData(vertexData: VertexData, bufferUsage?: string): void
  • Uploads the given vertex data to the internal vertex buffer. If the buffer is too small, a new one is created automatically.

    @param vertexData The VertexData instance to upload. @param bufferUsage The expected buffer usage. Use one of the constants defined in Context3DBufferUsage. Only used when the method call causes the creation of a new vertex buffer.

    Parameters

    • vertexData: VertexData
    • Optional bufferUsage: string

    Returns void

Generated using TypeDoc