Options
Menu

Class MethodPass

CompiledPass forms an abstract base class for the default compiled pass materials provided by Away3D, using material methods to define their appearance.

Hierarchy

  • PassBase

Implements

  • IPass
  • ILightingPass

Index

Constructors

constructor

  • Creates a new CompiledPass object.

    Parameters

    • mode: number
    • material: GL_MethodMaterial

      The material to which this pass belongs.

    • materialPool: MaterialPool

    Returns MethodPass

Properties

_ambientChunk

_ambientChunk: IShaderChunk

_ambientMethod

_ambientMethod: ShadingMethodBase

_chunks

_chunks: Array<IShaderChunk>

_colorTransformChunk

_colorTransformChunk: IShaderChunk

_colorTransformMethod

_colorTransformMethod: EffectColorTransformMethod

_diffuseChunk

_diffuseChunk: ILightingChunk

_diffuseMethod

_diffuseMethod: ShadingMethodBase

_elementsClass

_elementsClass: IElementsClassGL

_material

_material: GL_MaterialBase

_methods

_methods: Array<ShadingMethodBase>

_normalChunk

_normalChunk: IShaderChunk

_normalMethod

_normalMethod: ShadingMethodBase

_numEffectDependencies

_numEffectDependencies: number

_shader

_shader: ShaderBase

_shadowChunk

_shadowChunk: IShaderChunk

_shadowMethod

_shadowMethod: ShadingMethodBase

_specularChunk

_specularChunk: ILightingChunk

_specularMethod

_specularMethod: ShadingMethodBase

_stage

_stage: Stage

animationSet

animationSet: AnimationSetBase

directionalLightsOffset

directionalLightsOffset: number

forceSeparateMVP

forceSeparateMVP: 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.

images

images: Array<GL_ImageBase>

lightProbesOffset

lightProbesOffset: number

numDirectionalLights

numDirectionalLights: number

numLightProbes

numLightProbes: number

numPointLights

numPointLights: number

pointLightsOffset

pointLightsOffset: number

preserveAlpha

preserveAlpha: boolean

Indicates whether the output alpha value should remain unchanged compared to the material's original alpha.

samplers

samplers: Array<GL_SamplerBase>

shader

shader: ShaderBase

style

style: Style

Accessors

ambientMethod

  • The method that provides the ambient lighting contribution. Defaults to AmbientBasicMethod.

    Returns ShadingMethodBase

  • The method that provides the ambient lighting contribution. Defaults to AmbientBasicMethod.

    Parameters

    Returns void

colorTransform

  • get (): ColorTransform
  • set (value: ColorTransform): void
  • The ColorTransform object to transform the colour of the material with. Defaults to null.

    Returns ColorTransform

  • The ColorTransform object to transform the colour of the material with. Defaults to null.

    Parameters

    • value: ColorTransform

    Returns void

colorTransformMethod

  • The EffectColorTransformMethod object to transform the colour of the material with. Defaults to null.

    Returns EffectColorTransformMethod

  • The EffectColorTransformMethod object to transform the colour of the material with. Defaults to null.

    Parameters

    Returns void

diffuseLightSources

  • get (): number
  • Define which light source types to use for diffuse reflections. This allows choosing between regular lights and/or light probes for diffuse reflections.

    see

    away3d.materials.LightSources

    Returns number

diffuseMethod

  • The method that provides the diffuse lighting contribution. Defaults to DiffuseBasicMethod.

    Returns ShadingMethodBase

  • The method that provides the diffuse lighting contribution. Defaults to DiffuseBasicMethod.

    Parameters

    Returns void

enableLightFallOff

  • get (): boolean
  • Whether or not to use fallOff and radius properties for lights. This can be used to improve performance and compatibility for constrained mode.

    Returns boolean

includeCasters

  • get (): boolean
  • set (value: boolean): void
  • Indicates whether or not shadow casting lights need to be included.

    Returns boolean

  • Indicates whether or not shadow casting lights need to be included.

    Parameters

    • value: boolean

    Returns void

lightPicker

  • get (): LightPickerBase
  • set (value: LightPickerBase): void
  • Returns LightPickerBase

  • Parameters

    • value: LightPickerBase

    Returns void

mode

  • get (): number
  • set (value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

normalMethod

  • The method used to generate the per-pixel normals. Defaults to NormalBasicMethod.

    Returns ShadingMethodBase

  • The method used to generate the per-pixel normals. Defaults to NormalBasicMethod.

    Parameters

    Returns void

numEffectMethods

  • get (): number
  • The number of "effect" methods added to the material.

    Returns number

shadowMethod

  • The method used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null.

    Returns ShadingMethodBase

  • The method used to render shadows cast on this surface, or null if no shadows are to be rendered. Defaults to null.

    Parameters

    Returns void

specularLightSources

  • get (): number
  • Define which light source types to use for specular reflections. This allows choosing between regular lights and/or light probes for specular reflections.

    see

    away3d.materials.LightSources

    Returns number

specularMethod

  • The method that provides the specular lighting contribution. Defaults to SpecularBasicMethod.

    Returns ShadingMethodBase

  • The method that provides the specular lighting contribution. Defaults to SpecularBasicMethod.

    Parameters

    Returns void

Methods

_activate

  • _activate(projection: ProjectionBase): void
  • inheritdoc

    Parameters

    • projection: ProjectionBase

    Returns void

_deactivate

  • _deactivate(): void
  • inheritdoc

    Returns void

_getFragmentCode

  • _getFragmentCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • inheritdoc

    Parameters

    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getNormalFragmentCode

  • _getNormalFragmentCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getNormalVertexCode

  • _getNormalVertexCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getPerLightDiffuseFragmentCode

  • _getPerLightDiffuseFragmentCode(lightDirReg: ShaderRegisterElement, diffuseColorReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • lightDirReg: ShaderRegisterElement
    • diffuseColorReg: ShaderRegisterElement
    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getPerLightSpecularFragmentCode

  • _getPerLightSpecularFragmentCode(lightDirReg: ShaderRegisterElement, specularColorReg: ShaderRegisterElement, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • lightDirReg: ShaderRegisterElement
    • specularColorReg: ShaderRegisterElement
    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getPerProbeDiffuseFragmentCode

  • _getPerProbeDiffuseFragmentCode(texReg: ShaderRegisterElement, weightReg: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • texReg: ShaderRegisterElement
    • weightReg: string
    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getPerProbeSpecularFragmentCode

  • _getPerProbeSpecularFragmentCode(texReg: ShaderRegisterElement, weightReg: string, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • texReg: ShaderRegisterElement
    • weightReg: string
    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getPostAnimationFragmentCode

  • _getPostAnimationFragmentCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getPreLightingFragmentCode

  • _getPreLightingFragmentCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getPreLightingVertexCode

  • _getPreLightingVertexCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • Parameters

    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_getVertexCode

  • _getVertexCode(registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string
  • inheritdoc

    Parameters

    • registerCache: ShaderRegisterCache
    • sharedRegisters: ShaderRegisterData

    Returns string

_iUsesDiffuse

  • _iUsesDiffuse(shader: ShaderBase): boolean
  • Indicates whether the shader uses any specular component.

    Parameters

    • shader: ShaderBase

    Returns boolean

_iUsesShadows

  • _iUsesShadows(shader: ShaderBase): boolean
  • Indicates whether the shader uses any shadows.

    Parameters

    • shader: ShaderBase

    Returns boolean

_iUsesSpecular

  • _iUsesSpecular(shader: ShaderBase): boolean
  • Indicates whether the shader uses any specular component.

    Parameters

    • shader: ShaderBase

    Returns boolean

_includeDependencies

  • _includeDependencies(shader: LightingShader): void
  • Parameters

    • shader: LightingShader

    Returns void

_initConstantData

  • _initConstantData(shader: ShaderBase): void
  • Initializes the unchanging constant data for this material.

    Parameters

    • shader: ShaderBase

    Returns void

_setRenderState

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

    • renderable: GL_RenderableBase
    • projection: ProjectionBase

    Returns void

addEffectMethod

  • 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.

    Parameters

    Returns void

addEffectMethodAt

  • 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.

    Parameters

    Returns void

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add an event listener

    method

    addEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

dispatchEvent

  • dispatchEvent(event: EventBase): void
  • Dispatch an event

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

dispose

  • dispose(): void
  • inheritdoc

    Returns void

getEffectMethodAt

  • Returns the method added at the given index.

    Parameters

    • index: number

      The index of the method to retrieve.

    Returns ShadingMethodBase

    The method at the given index.

getImageIndex

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

    • texture: TextureBase
    • Optional index: number

    Returns number

hasEffectMethod

  • Queries whether a given effects method was added to the material.

    Parameters

    Returns boolean

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

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns boolean

invalidate

  • invalidate(): void
  • Marks the shader program as invalid, so it will be recompiled before the next render.

    Returns void

removeEffectMethod

  • Removes an effect method from the material.

    Parameters

    Returns void

removeEffectMethodAt

  • removeEffectMethodAt(index: number): void
  • remove an effect method at the specified index from the material.

    Parameters

    • index: number

    Returns void

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Remove an event listener

    method

    removeEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

Generated using TypeDoc