MaterialBase forms an abstract base class for any material. A material consists of several passes, each of which constitutes at least one render call. Several passes could be used for special effects (render lighting for many lights in several passes, render an outline in a separate pass) or to provide additional render-to-texture passes (rendering diffuse light to texture for texture-space subsurface scattering, or rendering a depth map for specialized self-shadowing).

Away3D provides default materials trough SinglePassMaterialBase and MultiPassMaterialBase, which use modular methods to build the shader code. MaterialBase can be extended to build specific and high-performant custom shaders, or entire new material frameworks.

Constructor

new()

Creates a new MaterialBase object.

Variables

read onlyassetType:String

blendMode:BlendMode

depthCompareMode:Context3DCompareMode

extra:Dynamic

An object to contain any extra data.

mipmap:Bool

repeat:Bool

read onlyrequiresBlending:Bool

smooth:Bool

read onlyuniqueId:Int

Methods

dispose():Void

Cleans up resources owned by the material, including passes. Textures are not owned by the material since they could be used by other materials and will not be disposed.

Inherited Variables

Defined by NamedAssetBase

read onlyassetFullPath:Array<Dynamic>

read onlyassetNamespace:String

id:String

name:String

read onlyoriginalName:String

Inherited Methods

Defined by NamedAssetBase

assetPathEquals(name:String, ns:String):Bool

@:value({ overrideOriginal : true, ns : null })resetAssetPath(name:String, ?ns:String, overrideOriginal:Bool = true):Void