Docs for Version: 1.0a
Show:
Module: Light

Material class

Constructor

Material

(
  • settings
)

Parameters:

  • settings Object

    Options for the material

Methods

draw

()

Draw material

setBump

(
  • tex
)

Set bump texture

Parameters:

  • tex Texture

    Texture to set on bump channel

setCube

(
  • tex
)

Set cube environment texture

Parameters:

  • tex Texture

    Texture to set on environment channel

setDiffuse

(
  • channel
  • tex
  • name
)

Set diffuse texture

Parameters:

  • channel String

    texture channel ( "diffuse", "specular", "bump", "cube" )

  • tex Texture

    Texture to set on diffuse channel

  • name String

    required if texture is atlas

setDiffuse

(
  • tex
)

Set diffuse texture

Parameters:

  • tex Texture

    Texture to set on diffuse channel

setSpecular

(
  • tex
)

Set specular texture

Parameters:

  • tex Texture

    Texture to set on specular channel

uniforms

(
  • uniforms
)

Set Material shader uniforms

Parameters:

  • uniforms Dict

    Dictionary of uniforms of shader

Properties

settings

Object

Example:

 mat = new Material()
                                             mat.settings{{
                                                color: [1.0,0.0,0.0],
                                                specularWeight: 1.0,
                                                reflectionWeight: 1.0,
                                                alpha:1.0
                                                }}