Creates a new MaterialBase object.
Creates a new MaterialBase object.
A value that can be used by materials that only work with a given type of renderer. The renderer can test the classification to choose which render path to use. For example, a deferred material could set this value so that the deferred renderer knows not to take the forward rendering path.
adapter is used to provide MovieClip to scripts taken from different platforms setter typically managed by factory. getter defaults to AwayJS class
An object to contain any extra data.
A unique id for the asset, used to identify assets in an associative array
The original name used for this asset in the resource (e.g. file) in which
it was found. This may not be the same as name
, which may
have changed due to of a name conflict.
The alpha of the surface.
The alpha of the surface.
Indicates whether or not the material has transparency. If binary transparency is sufficient, for example when using textures of foliage, consider using alphaThreshold instead.
Indicates whether or not the material has transparency. If binary transparency is sufficient, for example when using textures of foliage, consider using alphaThreshold instead.
Indicates whether visible textures (or other pixels) used by this material have already been premultiplied. Toggle this if you are seeing black halos around your blended alpha edges.
Indicates whether visible textures (or other pixels) used by this material have already been premultiplied. Toggle this if you are seeing black halos around your blended alpha edges.
The minimum alpha value for which pixels should be drawn. This is used for transparency that is either invisible or entirely opaque, often used with textures for foliage, etc. Recommended values are 0 to disable alpha, or 0.5 to create smooth edges. Default value is 0 (disabled).
The minimum alpha value for which pixels should be drawn. This is used for transparency that is either invisible or entirely opaque, often used with textures for foliage, etc. Recommended values are 0 to disable alpha, or 0.5 to create smooth edges. Default value is 0 (disabled).
Specifies whether or not the UV coordinates should be animated using a transformation matrix.
Specifies whether or not the UV coordinates should be animated using a transformation matrix.
The blend mode to use when drawing this renderable. The following blend modes are supported:
The blend mode to use when drawing this renderable. The following blend modes are supported:
Defines whether or not the material should cull triangles facing away from the camera.
Defines whether or not the material should cull triangles facing away from the camera.
The ColorTransform object to transform the colour of the material with. Defaults to null.
The ColorTransform object to transform the colour of the material with. Defaults to null.
Indicates whether material should use curves. Defaults to false.
Indicates whether material should use curves. Defaults to false.
A list of the IEntities that use this material
Indicates whether or not any used textures should use an atlas. Defaults to false.
Indicates whether or not any used textures should use an atlas. Defaults to false.
Specifies whether or not the UV coordinates should be animated using a transformation matrix.
Specifies whether or not the UV coordinates should be animated using a transformation matrix.
Add an event listener
Dispatch an event
check if an object has an event listener assigned to it
Mark an IEntity as owner of this material. Assures we're not using the same material across renderables with different animations, since the Programs depend on animation. This method needs to be called when a material is assigned.
The IEntity that had this material assigned
Removes an IEntity as owner.
Marks the shader programs for all passes as invalid, so they will be recompiled before the next use.
Remove an event listener
Generated using TypeDoc
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 TriangleMaterial, 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.