Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Material

The material class. This class has one or more material nodes.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

Properties

__alphaMode: AlphaModeEnum = AlphaMode.Opaque
__alphaToCoverage: boolean = false
__belongPrimitives: Map<number, Primitive> = ...
__blendEquationMode: number = GL_FUNC_ADD
__blendEquationModeAlpha: number = GL_FUNC_ADD
__blendFuncAlphaDstFactor: number = GL_ONE
__blendFuncAlphaSrcFactor: number = GL_ONE
__blendFuncDstFactor: number = GL_ONE_MINUS_SRC_ALPHA
__blendFuncSrcFactor: number = GL_SRC_ALPHA
__materialSid: number = -1
__materialTid: number
__materialTypeName: string
__materialUid: number = -1
__updatedShaderSources?: ShaderSources
_allFieldVariables: Map<number, ShaderVariable> = ...
_allFieldsInfo: Map<number, ShaderSemanticsInfo> = ...
_autoFieldVariablesOnly: Map<number, ShaderVariable> = ...
_materialContent: AbstractMaterialContent
_shaderProgramUid: number = CGAPIResourceRepository.InvalidCGAPIResourceUid
cullFace: boolean = true
cullFrontFaceCCW: boolean = true
InvalidObjectUID: -1 = -1
__shaderHashMap: Map<number, number> = ...
__shaderStringMap: Map<string, number> = ...
_soloDatumFields: Map<string, Map<number, ShaderVariable>> = ...
currentMaxObjectCount: number = 0

Accessors

  • get alphaToCoverage(): boolean
  • set alphaToCoverage(alphaToCoverage: boolean): void
  • NOTE: To apply the alphaToCoverage, the output alpha value must not be fixed to constant value. However, some shaders in the Rhodonite fixes the output alpha value to 1 by setAlphaIfNotInAlphaBlendMode. So we need to improve the shader to use the alphaToCoverage.

    Returns boolean

  • NOTE: To apply the alphaToCoverage, the output alpha value must not be fixed to constant value. However, some shaders in the Rhodonite fixes the output alpha value to 1 by setAlphaIfNotInAlphaBlendMode. So we need to improve the shader to use the alphaToCoverage.

    Parameters

    • alphaToCoverage: boolean

      apply alphaToCoverage to this material or not

    Returns void

  • get blendEquationMode(): number
  • get blendEquationModeAlpha(): number
  • get blendFuncAlphaDstFactor(): number
  • get blendFuncAlphaSrcFactor(): number
  • get blendFuncDstFactor(): number
  • get blendFuncSrcFactor(): number
  • get isLighting(): boolean
  • get isMorphing(): boolean
  • get isSkinning(): boolean
  • get materialSID(): number
  • get materialTID(): number
  • get materialTypeName(): string
  • get materialUID(): number
  • get objectUID(): number
  • get uniqueName(): string

Methods

  • __createProgramAsSingleOperation(vertexShaderMethodDefinitions_uniform: string, propertySetter: getShaderPropertyFunc, isWebGL2: boolean): number
  • __createProgramAsSingleOperationByUpdatedSources(updatedShaderSources: ShaderSources): number
  • __outputVertexAttributeBindingInfo(attributeNames: string[], attributeSemantics: VertexAttributeEnum[]): string
  • __setAutoParametersToGpu(args: RenderingArg, firstTime: boolean, shaderProgram: WebGLProgram): void
  • __setSoloDatumParametersToGpu(__namedParameters: { args: RenderingArg; firstTime: boolean; shaderProgram: WebGLProgram }): void
  • __setupGlobalShaderDefinition(): string
  • _addBelongPrimitive(primitive: Primitive): void
  • _createProgram(vertexShaderMethodDefinitions_uniform: string, propertySetter: getShaderPropertyFunc, isWebGL2: boolean): number
  • _getProperties(propertySetter: getShaderPropertyFunc, isWebGL2: boolean): { pixelPropertiesStr: string; vertexPropertiesStr: string }
  • _setParametersToGpu(__namedParameters: { args: RenderingArg; firstTime: boolean; material: Material; shaderProgram: WebGLProgram }): void
  • _setUniformLocationsOfMaterialNodes(isUniformOnlyMode: boolean): void
  • _setupAdditionalUniformLocations(shaderSemantics: ShaderSemanticsInfo[], isUniformOnlyMode: boolean): WebGLProgram
  • _setupBasicUniformsLocations(): void
  • createProgramByUpdatedSources(updatedShaderSources: ShaderSources): number
  • getTag(tagName: string): Tag
  • getTagValue(tagName: string): any
  • hasTag(tagName: string): boolean
  • isBlend(): boolean
  • isEmptyMaterial(): boolean
  • isShaderProgramReady(): boolean
  • matchTag(tagName: string, tagValue: string): boolean
  • matchTags(tags: RnTags): boolean
  • matchTagsAsFreeStrings(stringArray: string[]): boolean
  • removeTag(tagName: string): void
  • setBlendEquationMode(blendEquationMode: number, blendEquationModeAlpha?: number): void
  • Change the blendEquations This method works only if this alphaMode is the translucent

    Parameters

    • blendEquationMode: number

      the argument of gl.blendEquation of the first argument of gl.blendEquationSeparate such as gl.FUNC_ADD

    • Optional blendEquationModeAlpha: number

      the second argument of gl.blendEquationSeparate

    Returns void

  • setBlendFuncFactor(blendFuncSrcFactor: number, blendFuncDstFactor: number): void
  • Change the blendFuncFactors This method works only if this alphaMode is the translucent

    Parameters

    • blendFuncSrcFactor: number
    • blendFuncDstFactor: number

    Returns void

  • setBlendFuncSeparateFactor(blendFuncSrcFactor: number, blendFuncDstFactor: number, blendFuncAlphaSrcFactor: number, blendFuncAlphaDstFactor: number): void
  • Change the blendFuncSeparateFactors This method works only if this alphaMode is the translucent

    Parameters

    • blendFuncSrcFactor: number
    • blendFuncDstFactor: number
    • blendFuncAlphaSrcFactor: number
    • blendFuncAlphaDstFactor: number

    Returns void

  • setParameterByUniformName(uniformName: string, value: any): void
  • setTextureParameterByUniformName(uniformName: string, value: any): void
  • tryToSetTag(tag: Tag): boolean
  • tryToSetUniqueName(name: string, toAddNameIfConflict: boolean): boolean
  • Try to set a unique name of the entity.

    Parameters

    • name: string
    • toAddNameIfConflict: boolean

      If true, force to add name string to the current unique name string. If false, give up to change name.

    Returns boolean

  • validateTagString(val: string): boolean
  • _reset(): void
  • getRnObject(objectUid: number): RnObject
  • getRnObjectByName(uniqueName: string): undefined | RnObject
  • searchByTag(tag: string, value: string): undefined | RnObject

Generated using TypeDoc