diff --git a/away3d/materials/compilation/ShaderRegisterData.hx b/away3d/materials/compilation/ShaderRegisterData.hx index c7c6808e..3198c911 100644 --- a/away3d/materials/compilation/ShaderRegisterData.hx +++ b/away3d/materials/compilation/ShaderRegisterData.hx @@ -1,32 +1,130 @@ package away3d.materials.compilation; /** - * ShaderRegisterData contains the "named" registers, generated by the compiler and to be passed on to the methods. + * A number of commonly-available registers, generated by the compiler and made + * available to the methods. */ class ShaderRegisterData { + /** + * Varying. Contains `animatedNormal`, converted to world space. Not assumed + * to be normalized. + */ public var normalVarying:ShaderRegisterElement; + + /** + * Single-pass only. Varying. Contains the tangent to the vertex, in local + * space. To use this, set `needsTangents`. + */ public var tangentVarying:ShaderRegisterElement; + + /** + * Single-pass only. Varying. Contains a vector orthogonal to both + * `animatedNormal` and `animatedTangent`, in world space. + * + * To use this, set `methodSetup.normalMethod.normalMap`. + */ public var bitangentVarying:ShaderRegisterElement; + + /** + * Varying. Contains the UV coordinates, with any animations applied. To use + * this, set `needsUV`. + */ public var uvVarying:ShaderRegisterElement; + + /** + * Varying. Contains the secondary UV coordinates, with any animations + * applied. To use this, set `needsSecondaryUV`. + */ public var secondaryUVVarying:ShaderRegisterElement; + + /** + * Varying. Contains the direction the camera to the vertex. Not normalized. + * To use this, set `needsView`. + */ public var viewDirVarying:ShaderRegisterElement; + + /** + * Fragment temp. Contains the final shaded color, to be written to + * `fragmentOutputRegister`. + */ public var shadedTarget:ShaderRegisterElement; + + /** + * Vertex temp. Contains the vertex position in world space. To use this, + * set either `needsGlobalVertexPos` or `needsGlobalFragmentPos`. + * + * Multi-pass: may be freed before methods run; do not rely on it. + */ public var globalPositionVertex:ShaderRegisterElement; + + /** + * Varying. Contains the vertex position in world space. To use this, set + * `needsGlobalFragmentPos`. + */ public var globalPositionVarying:ShaderRegisterElement; + + /** + * Vertex temp. Contains the vertex position in local space. + */ public var localPosition:ShaderRegisterElement; + + /** + * Vertex attribute. Contains the normal to the vertex, in local space. Not + * assumed to be normalized. + */ public var normalInput:ShaderRegisterElement; + + /** + * Vertex attribute. Contains the tangent to the vertex, in local space. Not + * assumed to be normalized. + */ public var tangentInput:ShaderRegisterElement; + + /** + * Vertex temp. Contains `normalInput.xyz`, normalized. + * + * Single-pass: uses world space. Multi-pass: uses local space. + */ public var animatedNormal:ShaderRegisterElement; + + /** + * Vertex temp. Contains `tangentInput.xyz`, normalized. + * + * Single-pass: uses world space. Multi-pass: uses local space. + */ public var animatedTangent:ShaderRegisterElement; + + /** + * Fragment constant. Contains (0.5, 0, 1/255, 1). + */ public var commons:ShaderRegisterElement; + + /** + * Varying. Contains the vertex position in screen space. To use this, set + * `needsProjection`. + */ public var projectionFragment:ShaderRegisterElement; + + /** + * Fragment temp. Contains `normalVarying.xyz`, normalized. + */ public var normalFragment:ShaderRegisterElement; + + /** + * Fragment temp. Contains the direction from the camera to the fragment. + * Normalized. To use this, set `needsView`. + */ public var viewDirFragment:ShaderRegisterElement; + + /** + * Multi-pass only. Vertex temp. Contains a vector orthogonal to both + * `animatedNormal` and `animatedTangent`, in local space. + */ public var bitangent:ShaderRegisterElement; public function new() { } -} \ No newline at end of file +}