Package | away3d.materials.compilation |
Class | public class ShaderCompiler |
Inheritance | ShaderCompiler Object |
Subclasses | LightingShaderCompiler, SuperShaderCompiler |
See also
Property | Defined By | ||
---|---|---|---|
alphaPremultiplied : Boolean
Indicates whether visible textures (or other pixels) used by this material have
already been premultiplied. | ShaderCompiler | ||
animatableAttributes : Vector.<String> [read-only]
The attributes that need to be animated by animators. | ShaderCompiler | ||
animateUVs : Boolean
Indicate whether UV coordinates need to be animated using the renderable's transformUV matrix. | ShaderCompiler | ||
animationTargetRegisters : Vector.<String> [read-only]
The target registers for animated properties, written to by the animators. | ShaderCompiler | ||
cameraPositionIndex : int [read-only]
The index of the vertex constant containing the camera position. | ShaderCompiler | ||
commonsDataIndex : int [read-only]
The index for the common data register. | ShaderCompiler | ||
diffuseLightSources : uint
Define which light source types to use for diffuse reflections. | ShaderCompiler | ||
enableLightFallOff : Boolean
Whether or not to use fallOff and radius properties for lights. | ShaderCompiler | ||
forceSeperateMVP : Boolean
Indicates whether the screen projection should be calculated by forcing a separate scene matrix and
view-projection matrix. | ShaderCompiler | ||
fragmentCode : String [read-only]
The generated fragment code. | ShaderCompiler | ||
fragmentLightCode : String [read-only]
The code containing the lighting calculations. | ShaderCompiler | ||
fragmentPostLightCode : String [read-only]
The code containing the post-lighting calculations. | ShaderCompiler | ||
lightFragmentConstantIndex : int [read-only]
The first index for the fragment constants containing the light data. | ShaderCompiler | ||
lightProbeDiffuseIndices : Vector.<uint> [read-only]
Indices for the light probe diffuse textures. | ShaderCompiler | ||
lightProbeSpecularIndices : Vector.<uint> [read-only]
Indices for the light probe specular textures. | ShaderCompiler | ||
methodSetup : ShaderMethodSetup
The shader method setup object containing the method configuration and their value objects for the material being compiled. | ShaderCompiler | ||
needUVAnimation : Boolean [read-only]
Indicates whether the compiled code needs UV animation. | ShaderCompiler | ||
normalBufferIndex : int [read-only]
The index for the vertex normal attribute stream. | ShaderCompiler | ||
numDirectionalLights : uint
The amount of directional lights that need to be supported. | ShaderCompiler | ||
numLightProbes : uint
The amount of light probes that need to be supported. | ShaderCompiler | ||
numPointLights : uint
The amount of point lights that need to be supported. | ShaderCompiler | ||
numUsedFragmentConstants : uint [read-only]
The amount of fragment constants used by the material. | ShaderCompiler | ||
numUsedStreams : uint [read-only]
The amount of vertex attribute streams used by the material. | ShaderCompiler | ||
numUsedTextures : uint [read-only]
The amount of textures used by the material. | ShaderCompiler | ||
numUsedVaryings : uint [read-only]
Number of used varyings. | ShaderCompiler | ||
numUsedVertexConstants : uint [read-only]
The amount of vertex constants used by the material. | ShaderCompiler | ||
preserveAlpha : Boolean
Indicates whether the output alpha value should remain unchanged compared to the material's original alpha. | ShaderCompiler | ||
probeWeightsIndex : int [read-only]
The index of the fragment constant containing the weights for the light probes. | ShaderCompiler | ||
sceneMatrixIndex : int [read-only]
The index of the vertex constant containing the scene matrix. | ShaderCompiler | ||
sceneNormalMatrixIndex : int [read-only]
The index of the vertex constant containing the uniform scene matrix (the inverse transpose). | ShaderCompiler | ||
secondaryUVBufferIndex : int [read-only]
The index for the secondary UV vertex attribute stream. | ShaderCompiler | ||
shadedTarget : String [read-only]
The register name containing the final shaded colour. | ShaderCompiler | ||
specularLightSources : uint
Define which light source types to use for specular reflections. | ShaderCompiler | ||
tangentBufferIndex : int [read-only]
The index for the vertex tangent attribute stream. | ShaderCompiler | ||
usesNormals : Boolean [read-only]
Indicates whether the compiled shader uses normals. | ShaderCompiler | ||
usingSpecularMethod : Boolean [read-only]
Indicates whether the specular method is used. | ShaderCompiler | ||
uvBufferIndex : int [read-only]
The index for the UV vertex attribute stream. | ShaderCompiler | ||
UVSource : String [read-only]
The souce register providing the UV coordinate to animate. | ShaderCompiler | ||
UVTarget : String [read-only]
The target register to place the animated UV coordinate. | ShaderCompiler | ||
uvTransformIndex : int [read-only]
The index for the UV transformation matrix vertex constant. | ShaderCompiler | ||
vertexCode : String [read-only]
The generated vertex code. | ShaderCompiler |
Property | Defined By | ||
---|---|---|---|
_alphaPremultiplied : Boolean | ShaderCompiler | ||
_animatableAttributes : Vector.<String> | ShaderCompiler | ||
_animateUVs : Boolean | ShaderCompiler | ||
_animationTargetRegisters : Vector.<String> | ShaderCompiler | ||
_cameraPositionIndex : int = -1 | ShaderCompiler | ||
_combinedLightSources : uint | ShaderCompiler | ||
_dependencyCounter : MethodDependencyCounter | ShaderCompiler | ||
_diffuseLightSources : uint | ShaderCompiler | ||
_enableLightFallOff : Boolean | ShaderCompiler | ||
_forceSeperateMVP : Boolean | ShaderCompiler | ||
_fragmentCode : String | ShaderCompiler | ||
_fragmentConstantData : Vector.<Number> | ShaderCompiler | ||
_fragmentLightCode : String | ShaderCompiler | ||
_fragmentPostLightCode : String | ShaderCompiler | ||
_lightFragmentConstantIndex : int = -1 | ShaderCompiler | ||
_lightProbeDiffuseIndices : Vector.<uint> | ShaderCompiler | ||
_lightProbeSpecularIndices : Vector.<uint> | ShaderCompiler | ||
_methodSetup : ShaderMethodSetup | ShaderCompiler | ||
_mipmap : Boolean | ShaderCompiler | ||
_needUVAnimation : Boolean | ShaderCompiler | ||
_normalBufferIndex : int = -1 | ShaderCompiler | ||
_numDirectionalLights : uint | ShaderCompiler | ||
_numLightProbes : uint | ShaderCompiler | ||
_numLights : int | ShaderCompiler | ||
_numPointLights : uint | ShaderCompiler | ||
_numProbeRegisters : Number | ShaderCompiler | ||
_preserveAlpha : Boolean = true | ShaderCompiler | ||
_probeWeightsIndex : int = -1 | ShaderCompiler | ||
_profile : String | ShaderCompiler | ||
_registerCache : ShaderRegisterCache | ShaderCompiler | ||
_repeat : Boolean | ShaderCompiler | ||
_sceneMatrixIndex : int = -1 | ShaderCompiler | ||
_sceneNormalMatrixIndex : int = -1 | ShaderCompiler | ||
_secondaryUVBufferIndex : int = -1 | ShaderCompiler | ||
_sharedRegisters : ShaderRegisterData | ShaderCompiler | ||
_smooth : Boolean | ShaderCompiler | ||
_specularLightSources : uint | ShaderCompiler | ||
_tangentBufferIndex : int = -1 | ShaderCompiler | ||
_usingSpecularMethod : Boolean | ShaderCompiler | ||
_uvBufferIndex : int = -1 | ShaderCompiler | ||
_UVSource : String | ShaderCompiler | ||
_UVTarget : String | ShaderCompiler | ||
_uvTransformIndex : int = -1 | ShaderCompiler | ||
_vertexCode : String | ShaderCompiler | ||
_vertexConstantData : Vector.<Number> | ShaderCompiler |
Method | Defined By | ||
---|---|---|---|
ShaderCompiler(profile:String)
Creates a new ShaderCompiler object. | ShaderCompiler | ||
compile():void
Compiles the code after all setup on the compiler has finished. | ShaderCompiler | ||
dispose():void
Disposes all resources used by the compiler. | ShaderCompiler | ||
setConstantDataBuffers(vertexConstantData:Vector.<Number>, fragmentConstantData:Vector.<Number>):void
Sets the constant buffers allocated by the material. | ShaderCompiler | ||
setTextureSampling(smooth:Boolean, repeat:Boolean, mipmap:Boolean):void
Sets the default texture sampling properties. | ShaderCompiler |
Method | Defined By | ||
---|---|---|---|
calculateDependencies():void
Figure out which named registers are required, and how often. | ShaderCompiler | ||
compileGlobalPositionCode():void
Compile the world-space position. | ShaderCompiler | ||
compileLightingCode():void
Compile the lighting code. | ShaderCompiler | ||
compileMethods():void
Compiles the code for the methods. | ShaderCompiler | ||
compileMethodsCode():void
Compile the code for the methods. | ShaderCompiler | ||
compileNormalCode():void
Calculate the normal. | ShaderCompiler | ||
compileViewDirCode():void
Calculate the view direction. | ShaderCompiler | ||
createNormalRegisters():void
Creates the registers to contain the normal data. | ShaderCompiler | ||
initLightData():void
Prepares the setup for the light code. | ShaderCompiler | ||
initRegisterIndices():void
Reset all the indices to "unused". | ShaderCompiler | ||
usesLights():Boolean
Indicates whether the compiled shader uses lights. | ShaderCompiler | ||
usesLightsForDiffuse():Boolean
Indicates whether lights are used for diffuse reflections. | ShaderCompiler | ||
usesLightsForSpecular():Boolean
Indicates whether lights are used for specular reflections. | ShaderCompiler | ||
usesProbes():Boolean
Indicates whether any light probes are used. | ShaderCompiler | ||
usesProbesForDiffuse():Boolean
Indicates whether light probes are being used for diffuse reflections. | ShaderCompiler | ||
usesProbesForSpecular():Boolean
Indicates whether light probes are being used for specular reflections. | ShaderCompiler |
_alphaPremultiplied | property |
protected var _alphaPremultiplied:Boolean
_animatableAttributes | property |
protected var _animatableAttributes:Vector.<String>
_animateUVs | property |
protected var _animateUVs:Boolean
_animationTargetRegisters | property |
protected var _animationTargetRegisters:Vector.<String>
_cameraPositionIndex | property |
protected var _cameraPositionIndex:int = -1
_combinedLightSources | property |
protected var _combinedLightSources:uint
_dependencyCounter | property |
protected var _dependencyCounter:MethodDependencyCounter
_diffuseLightSources | property |
protected var _diffuseLightSources:uint
_enableLightFallOff | property |
protected var _enableLightFallOff:Boolean
_forceSeperateMVP | property |
protected var _forceSeperateMVP:Boolean
_fragmentCode | property |
protected var _fragmentCode:String
_fragmentConstantData | property |
protected var _fragmentConstantData:Vector.<Number>
_fragmentLightCode | property |
protected var _fragmentLightCode:String
_fragmentPostLightCode | property |
protected var _fragmentPostLightCode:String
_lightFragmentConstantIndex | property |
protected var _lightFragmentConstantIndex:int = -1
_lightProbeDiffuseIndices | property |
protected var _lightProbeDiffuseIndices:Vector.<uint>
_lightProbeSpecularIndices | property |
protected var _lightProbeSpecularIndices:Vector.<uint>
_methodSetup | property |
protected var _methodSetup:ShaderMethodSetup
_mipmap | property |
protected var _mipmap:Boolean
_needUVAnimation | property |
protected var _needUVAnimation:Boolean
_normalBufferIndex | property |
protected var _normalBufferIndex:int = -1
_numDirectionalLights | property |
protected var _numDirectionalLights:uint
_numLightProbes | property |
protected var _numLightProbes:uint
_numLights | property |
protected var _numLights:int
_numPointLights | property |
protected var _numPointLights:uint
_numProbeRegisters | property |
protected var _numProbeRegisters:Number
_preserveAlpha | property |
protected var _preserveAlpha:Boolean = true
_probeWeightsIndex | property |
protected var _probeWeightsIndex:int = -1
_profile | property |
protected var _profile:String
_registerCache | property |
protected var _registerCache:ShaderRegisterCache
_repeat | property |
protected var _repeat:Boolean
_sceneMatrixIndex | property |
protected var _sceneMatrixIndex:int = -1
_sceneNormalMatrixIndex | property |
protected var _sceneNormalMatrixIndex:int = -1
_secondaryUVBufferIndex | property |
protected var _secondaryUVBufferIndex:int = -1
_sharedRegisters | property |
protected var _sharedRegisters:ShaderRegisterData
_smooth | property |
protected var _smooth:Boolean
_specularLightSources | property |
protected var _specularLightSources:uint
_tangentBufferIndex | property |
protected var _tangentBufferIndex:int = -1
_usingSpecularMethod | property |
protected var _usingSpecularMethod:Boolean
_uvBufferIndex | property |
protected var _uvBufferIndex:int = -1
_UVSource | property |
protected var _UVSource:String
_UVTarget | property |
protected var _UVTarget:String
_uvTransformIndex | property |
protected var _uvTransformIndex:int = -1
_vertexCode | property |
protected var _vertexCode:String
_vertexConstantData | property |
protected var _vertexConstantData:Vector.<Number>
alphaPremultiplied | property |
alphaPremultiplied:Boolean
Indicates whether visible textures (or other pixels) used by this material have already been premultiplied.
public function get alphaPremultiplied():Boolean
public function set alphaPremultiplied(value:Boolean):void
animatableAttributes | property |
animatableAttributes:Vector.<String>
[read-only] The attributes that need to be animated by animators.
public function get animatableAttributes():Vector.<String>
animateUVs | property |
animateUVs:Boolean
Indicate whether UV coordinates need to be animated using the renderable's transformUV matrix.
public function get animateUVs():Boolean
public function set animateUVs(value:Boolean):void
animationTargetRegisters | property |
animationTargetRegisters:Vector.<String>
[read-only] The target registers for animated properties, written to by the animators.
public function get animationTargetRegisters():Vector.<String>
cameraPositionIndex | property |
cameraPositionIndex:int
[read-only] The index of the vertex constant containing the camera position.
public function get cameraPositionIndex():int
commonsDataIndex | property |
commonsDataIndex:int
[read-only] The index for the common data register.
public function get commonsDataIndex():int
diffuseLightSources | property |
diffuseLightSources:uint
Define which light source types to use for diffuse reflections. This allows choosing between regular lights and/or light probes for diffuse reflections.
public function get diffuseLightSources():uint
public function set diffuseLightSources(value:uint):void
See also
enableLightFallOff | property |
enableLightFallOff:Boolean
Whether or not to use fallOff and radius properties for lights. This can be used to improve performance and compatibility for constrained mode.
public function get enableLightFallOff():Boolean
public function set enableLightFallOff(value:Boolean):void
forceSeperateMVP | property |
forceSeperateMVP:Boolean
Indicates whether the screen projection should be calculated by forcing a separate scene matrix and view-projection matrix. This is used to prevent rounding errors when using multiple passes with different projection code.
public function get forceSeperateMVP():Boolean
public function set forceSeperateMVP(value:Boolean):void
fragmentCode | property |
fragmentCode:String
[read-only] The generated fragment code.
public function get fragmentCode():String
fragmentLightCode | property |
fragmentLightCode:String
[read-only] The code containing the lighting calculations.
public function get fragmentLightCode():String
fragmentPostLightCode | property |
fragmentPostLightCode:String
[read-only] The code containing the post-lighting calculations.
public function get fragmentPostLightCode():String
lightFragmentConstantIndex | property |
lightFragmentConstantIndex:int
[read-only] The first index for the fragment constants containing the light data.
public function get lightFragmentConstantIndex():int
lightProbeDiffuseIndices | property |
lightProbeDiffuseIndices:Vector.<uint>
[read-only] Indices for the light probe diffuse textures.
public function get lightProbeDiffuseIndices():Vector.<uint>
lightProbeSpecularIndices | property |
lightProbeSpecularIndices:Vector.<uint>
[read-only] Indices for the light probe specular textures.
public function get lightProbeSpecularIndices():Vector.<uint>
methodSetup | property |
methodSetup:ShaderMethodSetup
The shader method setup object containing the method configuration and their value objects for the material being compiled.
public function get methodSetup():ShaderMethodSetup
public function set methodSetup(value:ShaderMethodSetup):void
needUVAnimation | property |
needUVAnimation:Boolean
[read-only] Indicates whether the compiled code needs UV animation.
public function get needUVAnimation():Boolean
normalBufferIndex | property |
normalBufferIndex:int
[read-only] The index for the vertex normal attribute stream.
public function get normalBufferIndex():int
numDirectionalLights | property |
numDirectionalLights:uint
The amount of directional lights that need to be supported.
public function get numDirectionalLights():uint
public function set numDirectionalLights(value:uint):void
numLightProbes | property |
numLightProbes:uint
The amount of light probes that need to be supported.
public function get numLightProbes():uint
public function set numLightProbes(value:uint):void
numPointLights | property |
numPointLights:uint
The amount of point lights that need to be supported.
public function get numPointLights():uint
public function set numPointLights(value:uint):void
numUsedFragmentConstants | property |
numUsedFragmentConstants:uint
[read-only] The amount of fragment constants used by the material. Any animation code to be added can append its vertex constant data after this.
public function get numUsedFragmentConstants():uint
numUsedStreams | property |
numUsedStreams:uint
[read-only] The amount of vertex attribute streams used by the material. Any animation code to be added can add its streams after this. Also used to automatically disable attribute slots on pass deactivation.
public function get numUsedStreams():uint
numUsedTextures | property |
numUsedTextures:uint
[read-only] The amount of textures used by the material. Used to automatically disable texture slots on pass deactivation.
public function get numUsedTextures():uint
numUsedVaryings | property |
numUsedVaryings:uint
[read-only] Number of used varyings. Any animation code to be added can add its used varyings after this.
public function get numUsedVaryings():uint
numUsedVertexConstants | property |
numUsedVertexConstants:uint
[read-only] The amount of vertex constants used by the material. Any animation code to be added can append its vertex constant data after this.
public function get numUsedVertexConstants():uint
preserveAlpha | property |
preserveAlpha:Boolean
Indicates whether the output alpha value should remain unchanged compared to the material's original alpha.
public function get preserveAlpha():Boolean
public function set preserveAlpha(value:Boolean):void
probeWeightsIndex | property |
probeWeightsIndex:int
[read-only] The index of the fragment constant containing the weights for the light probes.
public function get probeWeightsIndex():int
sceneMatrixIndex | property |
sceneMatrixIndex:int
[read-only] The index of the vertex constant containing the scene matrix.
public function get sceneMatrixIndex():int
sceneNormalMatrixIndex | property |
sceneNormalMatrixIndex:int
[read-only] The index of the vertex constant containing the uniform scene matrix (the inverse transpose).
public function get sceneNormalMatrixIndex():int
secondaryUVBufferIndex | property |
secondaryUVBufferIndex:int
[read-only] The index for the secondary UV vertex attribute stream.
public function get secondaryUVBufferIndex():int
shadedTarget | property |
shadedTarget:String
[read-only] The register name containing the final shaded colour.
public function get shadedTarget():String
specularLightSources | property |
specularLightSources:uint
Define which light source types to use for specular reflections. This allows choosing between regular lights and/or light probes for specular reflections.
public function get specularLightSources():uint
public function set specularLightSources(value:uint):void
See also
tangentBufferIndex | property |
tangentBufferIndex:int
[read-only] The index for the vertex tangent attribute stream.
public function get tangentBufferIndex():int
usesNormals | property |
usesNormals:Boolean
[read-only] Indicates whether the compiled shader uses normals.
public function get usesNormals():Boolean
usingSpecularMethod | property |
usingSpecularMethod:Boolean
[read-only] Indicates whether the specular method is used.
public function get usingSpecularMethod():Boolean
uvBufferIndex | property |
uvBufferIndex:int
[read-only] The index for the UV vertex attribute stream.
public function get uvBufferIndex():int
UVSource | property |
UVSource:String
[read-only] The souce register providing the UV coordinate to animate.
public function get UVSource():String
UVTarget | property |
UVTarget:String
[read-only] The target register to place the animated UV coordinate.
public function get UVTarget():String
uvTransformIndex | property |
uvTransformIndex:int
[read-only] The index for the UV transformation matrix vertex constant.
public function get uvTransformIndex():int
vertexCode | property |
vertexCode:String
[read-only] The generated vertex code.
public function get vertexCode():String
ShaderCompiler | () | Constructor |
public function ShaderCompiler(profile:String)
Creates a new ShaderCompiler object.
Parametersprofile:String — The compatibility profile of the renderer.
|
calculateDependencies | () | method |
protected function calculateDependencies():void
Figure out which named registers are required, and how often.
compile | () | method |
public function compile():void
Compiles the code after all setup on the compiler has finished.
compileGlobalPositionCode | () | method |
protected function compileGlobalPositionCode():void
Compile the world-space position.
compileLightingCode | () | method |
protected function compileLightingCode():void
Compile the lighting code.
compileMethods | () | method |
protected function compileMethods():void
Compiles the code for the methods.
compileMethodsCode | () | method |
protected function compileMethodsCode():void
Compile the code for the methods.
compileNormalCode | () | method |
protected function compileNormalCode():void
Calculate the normal.
compileViewDirCode | () | method |
protected function compileViewDirCode():void
Calculate the view direction.
createNormalRegisters | () | method |
protected function createNormalRegisters():void
Creates the registers to contain the normal data.
dispose | () | method |
public function dispose():void
Disposes all resources used by the compiler.
initLightData | () | method |
protected function initLightData():void
Prepares the setup for the light code.
initRegisterIndices | () | method |
protected function initRegisterIndices():void
Reset all the indices to "unused".
setConstantDataBuffers | () | method |
public function setConstantDataBuffers(vertexConstantData:Vector.<Number>, fragmentConstantData:Vector.<Number>):void
Sets the constant buffers allocated by the material. This allows setting constant data during compilation.
Parameters
vertexConstantData:Vector.<Number> — The vertex constant data buffer.
| |
fragmentConstantData:Vector.<Number> — The fragment constant data buffer.
|
setTextureSampling | () | method |
public function setTextureSampling(smooth:Boolean, repeat:Boolean, mipmap:Boolean):void
Sets the default texture sampling properties.
Parameters
smooth:Boolean — Indicates whether the texture should be filtered when sampled. Defaults to true.
| |
repeat:Boolean — Indicates whether the texture should be tiled when sampled. Defaults to true.
| |
mipmap:Boolean — Indicates whether or not any used textures should use mipmapping. Defaults to true.
|
usesLights | () | method |
protected function usesLights():Boolean
Indicates whether the compiled shader uses lights.
ReturnsBoolean |
usesLightsForDiffuse | () | method |
protected function usesLightsForDiffuse():Boolean
Indicates whether lights are used for diffuse reflections.
ReturnsBoolean |
usesLightsForSpecular | () | method |
protected function usesLightsForSpecular():Boolean
Indicates whether lights are used for specular reflections.
ReturnsBoolean |
usesProbes | () | method |
protected function usesProbes():Boolean
Indicates whether any light probes are used.
ReturnsBoolean |
usesProbesForDiffuse | () | method |
protected function usesProbesForDiffuse():Boolean
Indicates whether light probes are being used for diffuse reflections.
ReturnsBoolean |
usesProbesForSpecular | () | method |
protected function usesProbesForSpecular():Boolean
Indicates whether light probes are being used for specular reflections.
ReturnsBoolean |