TextureMaterial is a single-pass material that uses a texture to define the surface's diffuse reflection colour (albedo).

Constructor

@:value({ anisotropy : ANISOTROPIC2X, mipmap : true, repeat : false, smooth : true, texture : null })new(?texture:Texture2DBase, smooth:Bool = true, repeat:Bool = false, mipmap:Bool = true, anisotropy:Anisotropy = ANISOTROPIC2X)

Creates a new TextureMaterial.

Parameters:

texture

The texture used for the material's albedo color.

smooth

Indicates whether the texture should be filtered when sampled. Defaults to true.

repeat

Indicates whether the texture should be tiled when sampled. Defaults to true.

mipmap

Indicates whether or not any used textures should use mipmapping. Defaults to true.

anisotropy

Indicates the number of samples to use if Anisotropic mipmap filtering is applied

Variables

Inherited Variables

Inherited Methods

Defined by SinglePassMaterialBase

addMethod(method:EffectMethodBase):Void

Appends an "effect" shading method to the shader. Effect methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the methods added prior.

addMethodAt(method:EffectMethodBase, index:Int):Void

Adds an effect method at the specified index amongst the methods already added to the material. Effect methods are those that do not influence the lighting but modulate the shaded colour, used for fog, outlines, etc. The method will be applied to the result of the methods with a lower index.

getMethodAt(index:Int):EffectMethodBase

Returns the method added at the given index.

Parameters:

index

The index of the method to retrieve.

Returns:

The method at the given index.

hasMethod(method:EffectMethodBase):Bool

Queries whether a given effect method was added to the material.

Parameters:

method

The method to be queried.

Returns:

true if the method was added to the material, false otherwise.

removeMethod(method:EffectMethodBase):Void

Removes an effect method from the material.

Parameters:

method

The method to be removed.

Defined by MaterialBase

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.

Defined by NamedAssetBase

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

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