ShaderCompiler is an abstract base class for shader compilers that use modular shader methods to assemble a material. Concrete subclasses are used by the default materials.

See also:

  • away3d.materials.methods.ShadingMethodBase

Constructor

new(profile:String)

Creates a new ShaderCompiler object.

Parameters:

profile

The compatibility profile of the renderer.

Variables

read onlyUVSource:String

read onlyUVTarget:String

read onlyanimatableAttributes:Vector<String>

read onlyanimationTargetRegisters:Vector<String>

read onlycameraPositionIndex:Int

read onlycommonsDataIndex:Int

read onlyfragmentCode:String

read onlyfragmentLightCode:String

read onlyfragmentPostLightCode:String

read onlylightProbeDiffuseIndices:Vector<UInt>

read onlylightProbeSpecularIndices:Vector<UInt>

read onlyneedUVAnimation:Bool

read onlynormalBufferIndex:Int

read onlynumUsedStreams:Int

read onlynumUsedTextures:Int

read onlynumUsedVaryings:Int

read onlyprobeWeightsIndex:Int

read onlysceneMatrixIndex:Int

read onlyshadedTarget:String

read onlytangentBufferIndex:Int

read onlyusesNormals:Bool

read onlyusingSpecularMethod:Bool

read onlyuvBufferIndex:Int

read onlyuvTransformIndex:Int

read onlyuvTransformIndex2:Int

read onlyvertexCode:String

Methods

compile():Void

Compiles the code after all setup on the compiler has finished.

dispose():Void

Disposes all resources used by the compiler.

setConstantDataBuffers(vertexConstantData:Vector<Float>, fragmentConstantData:Vector<Float>):Void

Sets the constant buffers allocated by the material. This allows setting constant data during compilation.

Parameters:

vertexConstantData

The vertex constant data buffer.

fragmentConstantData

The fragment constant data buffer.

setTextureSampling(smooth:Bool, repeat:Bool, mipmap:Bool, anisotropy:Anisotropy):Void

Sets the default texture sampling properties.

Parameters:

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.