Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pass

渲染 pass,储存实际描述绘制过程的各项资源。

Hierarchy

Index

Constructors

constructor

Properties

Protected _blocks

_blocks: Float32Array[] = []

Protected _buffers

_buffers: GFXBuffer[] = []

Protected _defines

_defines: MacroRecord

Protected _descriptorSet

_descriptorSet: GFXDescriptorSet = null!

Protected _device

_device: GFXDevice

Protected _dynamics

_dynamics: IPassDynamics

Protected _hShaderDefault

_hShaderDefault: ShaderHandle = NULL_HANDLE

Protected _handle

_handle: PassHandle = NULL_HANDLE

Protected _passIndex

_passIndex: number = 0

Protected _programName

_programName: string = ""

Protected _properties

_properties: Record<string, IPropertyInfo>

Protected _propertyHandleMap

_propertyHandleMap: Record<string, number>

Protected _propertyIndex

_propertyIndex: number = 0

Protected _root

_root: Root

Protected _rootBlock

_rootBlock: ArrayBuffer | null = null

Protected _rootBuffer

_rootBuffer: GFXBuffer | null = null

Protected _rootBufferDirty

_rootBufferDirty: boolean = false

Protected _shaderInfo

_shaderInfo: IProgramInfo = null!

Static PropertyType

PropertyType: typeof PropertyType = PropertyType

Uniform 的绑定类型(UBO 或贴图等)

Static getBindingFromHandle

getBindingFromHandle: typeof getBindingFromHandle = getBindingFromHandle

根据 handle 获取 binding。

Static Protected getOffsetFromHandle

getOffsetFromHandle: typeof getOffsetFromHandle = getOffsetFromHandle

Static getPropertyTypeFromHandle

getPropertyTypeFromHandle: typeof getPropertyTypeFromHandle = getPropertyTypeFromHandle

根据 handle 获取 uniform 的绑定类型(UBO 或贴图等)。

Static getTypeFromHandle

getTypeFromHandle: typeof getTypeFromHandle = getTypeFromHandle

根据 handle 获取 UBO member 的具体类型。

Accessors

batchingScheme

blendState

blocks

  • get blocks(): Float32Array[]

defines

  • get defines(): {}

depthStencilState

descriptorSet

device

dynamicStates

dynamics

handle

  • get handle(): IHandle<PASS>

hash

  • get hash(): number

passIndex

  • get passIndex(): number

phase

  • get phase(): number

primitive

priority

  • get priority(): number

program

  • get program(): string

properties

  • get properties(): {}

propertyIndex

  • get propertyIndex(): number

rasterizerState

root

setLayouts

shaderInfo

stage

Methods

Protected doInit

Protected syncBatchingScheme

  • _syncBatchingScheme(): void

Private beginChangeStatesSilently

  • beginChangeStatesSilently(): void

bindSampler

  • bindSampler(binding: number, value: GFXSampler, index?: undefined | number): void

bindTexture

  • bindTexture(binding: number, value: GFXTexture, index?: undefined | number): void

destroy

  • destroy(): void

Private endChangeStatesSilently

  • endChangeStatesSilently(): void

getBinding

  • getBinding(name: string): number

getHandle

  • getHandle(name: string, offset?: number, targetType?: GFXType): number
  • 获取指定 UBO 成员,或其更具体分量的读写句柄。默认以成员自身的类型为目标读写类型(即读写时必须传入与成员类型相同的变量)。

    example
    import { Vec3, GFXType } from 'cc';
    // say 'pbrParams' is a uniform vec4
    const hParams = pass.getHandle('pbrParams'); // get the default handle
    pass.setUniform(hAlbedo, new Vec3(1, 0, 0)); // wrong! pbrParams.w is NaN now
    // say 'albedoScale' is a uniform vec4, and we only want to modify the w component in the form of a single float
    const hThreshold = pass.getHandle('albedoScale', 3, GFXType.FLOAT);
    pass.setUniform(hThreshold, 0.5); // now, albedoScale.w = 0.5

    Parameters

    • name: string

      Name of the target UBO member.

    • Default value offset: number = 0

      Channel offset into the member.

    • Default value targetType: GFXType = GFXType.UNKNOWN

      Target type of the handle, i.e. the type of data when read/write to it.

    Returns number

getShaderVariant

  • getShaderVariant(patches?: IMacroPatch[] | null): ShaderHandle

getUniform

initialize

overridePipelineStates

resetTexture

  • resetTexture(name: string, index?: undefined | number): void

resetTextures

  • resetTextures(): void

resetUBOs

  • resetUBOs(): void

resetUniform

  • resetUniform(name: string): void

setDynamicState

setUniform

setUniformArray

tryCompile

  • tryCompile(): null | false | true

update

  • update(): void

Static fillPipelineInfo

  • en

    Fill a pass represented by the given pass handle with the given override info

    Parameters

    • hPass: PassHandle

      The pass handle point to the pass

    • info: PassOverrides

      The pass override info

    Returns void

Static getPassHash

  • getPassHash(hPass: PassHandle, hShader: ShaderHandle): number
  • 根据 Pass 的哈希信息获取哈希值。

    Parameters

    • hPass: PassHandle

      Handle of the pass info used to compute hash value.

    • hShader: ShaderHandle

    Returns number

Generated using TypeDoc