new Material() → {Material}
Material's hold a Shader and texture information. Materials may be
shared between multiple DisplayObjects.
- Source:
Returns:
- Type
- Material
Members
-
mainTexture :Texture
-
The Texture uploaded as the Shader's main texture. This is used for most texture mapping.
Type:
- Texture
- Source:
-
secTexture :Texture
-
The secondary texture to upload. This is unused most of the time unless a custom shader requires it.
Type:
- Texture
- Source:
-
shader :Shader
-
The Shader instance for this Material. This object compiles the glsl and acts as an interface for uploading uniforms and attribtes.
Type:
- Shader
- Source:
Methods
-
getId() → {number}
-
Returns an id unique across all Materials.
- Source:
Returns:
- Type
- number
-
prepareTextures(ctx)
-
Prepares Textures for upload.
Parameters:
Name Type Description ctxWebGLContext The context to prepare textures for. - Source:
-
pushTextures(ctx)
-
Uploads Textures to the GPU.
Parameters:
Name Type Description ctxWebGLContext The context to push textures to. - Source: