Options
Menu

Class LightingShader

ShaderBase keeps track of the number of dependencies for "named registers" used across a pass. Named registers are that are not necessarily limited to a single method. They are created by the compiler and passed on to methods. The compiler uses the results to reserve usages through RegisterPool, which can be removed each time a method has been compiled into the shader.

see

RegisterPool.addUsage

Hierarchy

  • ShaderBase

Implements

  • IAbstractionPool

Index

Constructors

Properties

Methods

Constructors

constructor

  • Creates a new MethodCompilerVO object.

    Parameters

    • elementsClass: IElementsClassGL
    • lightingPass: ILightingPass
    • stage: Stage

    Returns LightingShader

Properties

_lightingPass

_lightingPass: ILightingPass

_pInverseSceneMatrix

_pInverseSceneMatrix: Float32Array

_stage

_stage: Stage

activeElements

activeElements: GL_ElementsBase

alphaThreshold

alphaThreshold: number

ambientB

ambientB: number

ambientG

ambientG: number

ambientR

ambientR: number

animationRegisterData

animationRegisterData: AnimationRegisterData

cameraPositionIndex

cameraPositionIndex: number

The index of the vertex constant containing the camera position.

colorBufferIndex

colorBufferIndex: number

The index for the color attribute stream.

colorDependencies

colorDependencies: number

The amount of dependencies on the vertex color.

colorTransformIndex

colorTransformIndex: number

The index for the color transform fragment constant.

commonsDataIndex

commonsDataIndex: number

The index for the common data register.

curvesIndex

curvesIndex: number

The index for the curve vertex attribute stream.

depthCompareMode

depthCompareMode: ContextGLCompareMode

The depth compare mode used to render the renderables using this material.

see

away.stagegl.ContextGLCompareMode

fragmentConstantData

fragmentConstantData: Float32Array

globalPosDependencies

globalPosDependencies: number

The amount of dependencies on the global position. This can be 0 while hasGlobalPosDependencies is true when the global position is used as a temporary value (fe to calculate the view direction)

imageIndices

imageIndices: Array<number>

jointIndexIndex

jointIndexIndex: number

jointWeightIndex

jointWeightIndex: number

lightFragmentConstantIndex

lightFragmentConstantIndex: number

The first index for the fragment constants containing the light data.

lightProbeDiffuseIndices

lightProbeDiffuseIndices: Array<number>

Indices for the light probe diffuse textures.

lightProbeSpecularIndices

lightProbeSpecularIndices: Array<number>

Indices for the light probe specular textures.

lightVertexConstantIndex

lightVertexConstantIndex: number

The starting index if the vertex constant to which light data needs to be uploaded.

normalDependencies

normalDependencies: number

The amount of dependencies on the normal vector.

normalIndex

normalIndex: number

The index for the vertex normal attribute stream.

numDirectionalLights

numDirectionalLights: number

numLightProbes

numLightProbes: number

numLights

numLights: number

numPointLights

numPointLights: number

numUsedFragmentConstants

numUsedFragmentConstants: number

numUsedStreams

numUsedStreams: number

The amount of used vertex streams in the vertex code. Used by the animation code generation to know from which index on streams are available.

numUsedTextures

numUsedTextures: number

numUsedVertexConstants

numUsedVertexConstants: number

outputsColors

outputsColors: boolean

outputsNormals

outputsNormals: boolean

Indicates whether or not normals are output.

outputsTangentNormals

outputsTangentNormals: boolean

Indicates whether or not normal calculations are output in tangent space.

pass

pass: IPass

probeWeightsIndex

probeWeightsIndex: number

The index of the fragment constant containing the weights for the light probes.

profile

profile: ContextGLProfile

programData

programData: ProgramData

projectionDependencies

projectionDependencies: number

The amount of dependencies on the projected position.

sceneMatrix

sceneMatrix: Matrix3D

sceneMatrixIndex

sceneMatrixIndex: number

The index of the vertex constant containing the scene matrix.

sceneNormalMatrix

sceneNormalMatrix: Matrix3D

sceneNormalMatrixIndex

sceneNormalMatrixIndex: number

The index of the vertex constant containing the uniform scene matrix (the inverse transpose).

scenePositionIndex

scenePositionIndex: number

secondaryUVDependencies

secondaryUVDependencies: number

The amount of dependencies on the secondary UV coordinates.

secondaryUVIndex

secondaryUVIndex: number

The index for the secondary UV vertex attribute stream.

skyboxScaleIndex

skyboxScaleIndex: number

tangentDependencies

tangentDependencies: number

The amount of tangent vector dependencies (fragment shader).

tangentIndex

tangentIndex: number

The index for the vertex tangent attribute stream.

useAlphaPremultiplied

useAlphaPremultiplied: boolean

useBothSides

useBothSides: boolean

useImageRect

useImageRect: boolean

usesAnimation

usesAnimation: boolean

usesBlending

usesBlending: boolean

usesColorTransform

usesColorTransform: boolean

usesCommonData

usesCommonData: boolean

usesCurves

usesCurves: boolean

usesFragmentAnimation

usesFragmentAnimation: boolean

Indicates whether the pass requires any fragment animation code.

usesGlobalPosFragment

usesGlobalPosFragment: boolean

Indicates whether there are any dependencies on the world-space position vector.

usesLightFallOff

usesLightFallOff: boolean

usesLights

usesLights: boolean

Indicates whether the shader uses any lights.

usesLightsForDiffuse

usesLightsForDiffuse: boolean

Indicates whether the lights uses any diffuse components.

usesLightsForSpecular

usesLightsForSpecular: boolean

Indicates whether the lights uses any specular components.

usesPositionFragment

usesPositionFragment: boolean

Indicates whether there are any dependencies on the local position vector.

usesProbes

usesProbes: boolean

Indicates whether the shader uses any light probes.

usesProbesForDiffuse

usesProbesForDiffuse: boolean

Indicates whether the probes uses any diffuse components.

usesProbesForSpecular

usesProbesForSpecular: boolean

Indicates whether the probes uses any specular components.

usesShadows

usesShadows: boolean

usesTangentSpace

usesTangentSpace: boolean

Indicates whether or not normal calculations are expected in tangent space. This is only the case if no world-space dependencies exist and normals are being output.

usesUVTransform

usesUVTransform: boolean

uvDependencies

uvDependencies: number

The amount of dependencies on the primary UV coordinates.

uvIndex

uvIndex: number

The index for the UV vertex attribute stream.

uvMatrixIndex

uvMatrixIndex: number

The index for the UV transformation matrix vertex constant.

vertexConstantData

vertexConstantData: Float32Array

viewDirDependencies

viewDirDependencies: number

The amount of dependencies on the view direction.

viewMatrix

viewMatrix: Matrix3D

viewMatrixIndex

viewMatrixIndex: number

The index of the vertex constant containing the view matrix.

writeDepth

writeDepth: boolean

Indicate whether the shader should write to the depth buffer or not. Ignored when blending is enabled.

Static _abstractionClassPool

_abstractionClassPool: Object

Methods

_activate

  • _activate(projection: ProjectionBase): void
  • inheritdoc

    Parameters

    • projection: ProjectionBase

    Returns void

_deactivate

  • _deactivate(): void
  • inheritdoc

    Returns void

_includeDependencies

  • _includeDependencies(): void
  • Returns void

_setRenderState

  • _setRenderState(renderable: GL_RenderableBase, projection: ProjectionBase): void
  • Parameters

    • renderable: GL_RenderableBase
    • projection: ProjectionBase

    Returns void

clearAbstraction

  • clearAbstraction(texture: TextureBase): void
  • Parameters

    • texture: TextureBase

    Returns void

createCompiler

  • createCompiler(elementsClass: IElementsClassGL, pass: ILightingPass): CompilerBase
  • Factory method to create a concrete compiler object for this object

    Parameters

    Returns CompilerBase

dispose

  • dispose(): void
  • Returns void

getAbstraction

  • getAbstraction(asset: AssetBase): AbstractionBase
  • Parameters

    • asset: AssetBase

    Returns AbstractionBase

getImageIndex

  • getImageIndex(texture: TextureBase, index?: number): number
  • Parameters

    • texture: TextureBase
    • Optional index: number

    Returns number

initConstantData

  • initConstantData(registerCache: ShaderRegisterCache): void
  • Initializes the unchanging constant data for this shader object.

    Parameters

    • registerCache: ShaderRegisterCache

    Returns void

invalidateProgram

  • invalidateProgram(): void
  • Returns void

pInitRegisterIndices

  • pInitRegisterIndices(): void
  • Returns void

reset

  • reset(): void
  • Clears dependency counts for all registers. Called when recompiling a pass.

    Returns void

setBlendMode

  • setBlendMode(value: string): void
  • The blend mode to use when drawing this renderable. The following blend modes are supported:

    • BlendMode.NORMAL: No blending, unless the material inherently needs it
    • BlendMode.LAYER: Force blending. This will draw the object the same as NORMAL, but without writing depth writes.
    • BlendMode.MULTIPLY
    • BlendMode.ADD
    • BlendMode.ALPHA

    Parameters

    • value: string

    Returns void

setFragmentConst

  • setFragmentConst(index: number, x?: number, y?: number, z?: number, w?: number): void
  • Parameters

    • index: number
    • Optional x: number
    • Optional y: number
    • Optional z: number
    • Optional w: number

    Returns void

setVertexConst

  • setVertexConst(index: number, x?: number, y?: number, z?: number, w?: number): void
  • Parameters

    • index: number
    • Optional x: number
    • Optional y: number
    • Optional z: number
    • Optional w: number

    Returns void

setVertexConstFromArray

  • setVertexConstFromArray(index: number, data: Float32Array): void
  • Parameters

    • index: number
    • data: Float32Array

    Returns void

setVertexConstFromMatrix

  • setVertexConstFromMatrix(index: number, matrix: Matrix3D): void
  • Parameters

    • index: number
    • matrix: Matrix3D

    Returns void

Static registerAbstraction

  • registerAbstraction(gl_assetClass: GL_IAssetClass, assetClass: IAssetClass): void
  • Parameters

    • gl_assetClass: GL_IAssetClass
    • assetClass: IAssetClass

    Returns void

Generated using TypeDoc