Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MaterialFactory

Manage materialGenerators for materials. Materials can be instanciated with this instance. Every gl reference can contain 1 of MaterialFactory at most.

Hierarchy

Index

Constructors

constructor

Properties

gl

gl: WebGLRenderingContext

macro

shaderHeader

shaderHeader: string = MaterialFactory.defaultShaderHeader

Static defaultShaderHeader

defaultShaderHeader: string = ShaderHeader

Static materialGeneratorResolver

materialGeneratorResolver: NameResolver<function> = new NameResolver<(factory: MaterialFactory) => Material>()

Static registryName

registryName: string = "MaterialFactory"

Methods

instanciate

  • instanciate(typeName: string): Promise<Material>

Static Protected ___get

  • ___get<T>(gl: WebGLRenderingContext, ctor: object): T

Static Protected ___getAll

  • ___getAll<T>(ctor: object): T[]

Static addMaterialType

  • addMaterialType(typeName: string, materialGenerator: function): void

Static addSORTMaterial

  • addSORTMaterial(typeName: string, source: string): Promise<function>
  • Add source of .sort material as specified typename.

    Parameters

    • typeName: string
    • source: string

    Returns Promise<function>

    [description]

Static addSORTMaterialFromURL

  • addSORTMaterialFromURL(typeName: string, url: string): Promise<function>
  • Add source of .sort material from external url as specified typeName.

    Parameters

    • typeName: string
    • url: string

    Returns Promise<function>

    [description]

Static get

Static getMaterialStatus

  • getMaterialStatus(typeName: string): number

Generated using TypeDoc