Class SynthesizeHdrMaterialContent

Material content for synthesizing HDR textures with optional target region masking. This material is commonly used for glare effects and other post-processing operations.

Hierarchy (view full)

Constructors

  • Creates a new SynthesizeHdrMaterialContent instance for HDR texture synthesis.

    This material node supports texture synthesis operations commonly used for glare effects and other post-processing operations. It can synthesize up to 6 textures simultaneously.

    Synthesis Behavior:

    • Without targetRegionTexture: Synthesizes all input textures across all pixels, weighted by the corresponding synthesizeCoefficient values.
    • With targetRegionTexture: Applies weighted synthesis only to non-white pixels (where color != (1.0, 1.0, 1.0, 1.0)). White areas receive the product of synthesizeTextures[0] and synthesizeCoefficient[0].

    Parameters

    • materialName: string

      Unique identifier for this material instance

    • synthesizeTextures: AbstractTexture[]

      Array of textures to be synthesized (supports up to 6 textures)

    Returns SynthesizeHdrMaterialContent

    const synthesizeTextures = [texture1, texture2, texture3];
    const material = new SynthesizeHdrMaterialContent('GlareMaterial', synthesizeTextures);

Properties

__definitions: string = ''
__materialName: string
__semantics: ShaderSemanticsInfo[] = []
_tags: RnTags = {}

Collection of tags associated with this object

shaderType: EnumIO = ShaderType.VertexAndPixelShader
InvalidObjectUID: -1 = -1

Invalid object UID constant

SynthesizeCoefficient: ShaderSemanticsClass = ...
SynthesizeTexture0: ShaderSemanticsClass = ...
SynthesizeTexture1: ShaderSemanticsClass = ...
SynthesizeTexture2: ShaderSemanticsClass = ...
SynthesizeTexture3: ShaderSemanticsClass = ...
SynthesizeTexture4: ShaderSemanticsClass = ...
SynthesizeTexture5: ShaderSemanticsClass = ...
TargetRegionTexture: ShaderSemanticsClass = ...
__gl?: WebGLRenderingContext
__tmp_vector2: MutableVector2 = ...
__tmp_vector4: MutableVector4 = ...
currentMaxObjectCount: number = 0

Current maximum object count for UID generation

materialNodes: AbstractMaterialContent[] = []

Accessors

  • get objectUID(): number
  • Gets the unique object identifier

    Returns number

    The object's UID

  • get pixelShaderityObject(): undefined | ShaderityObject
  • Gets the pixel shader object associated with this material.

    Returns undefined | ShaderityObject

    The pixel shader object or undefined if not set

  • get synthesizeTextureNumber(): number
  • Gets the number of textures configured for synthesis.

    Returns number

    The count of textures that will be processed during synthesis

    const material = new SynthesizeHdrMaterialContent('test', [tex1, tex2]);
    console.log(material.synthesizeTextureNumber); // 2
  • get uniqueName(): string
  • Gets the unique name of this object

    Returns string

    The unique name string

  • get vertexShaderityObject(): undefined | ShaderityObject
  • Gets the vertex shader object associated with this material.

    Returns undefined | ShaderityObject

    The vertex shader object or undefined if not set

Methods

  • Internal

    Sets internal WebGL-specific parameters for the material during rendering.

    This method is called during the WebGL rendering pipeline to configure shader uniforms and state specific to this material. It handles matrix transformations and synthesis coefficient updates.

    Parameters

    • params: {
          args: RenderingArgWebGL;
          firstTime: boolean;
          material: Material;
          shaderProgram: WebGLProgram;
      }

      Configuration object containing material and rendering context

      • args: RenderingArgWebGL

        WebGL rendering arguments and context

        This method is part of the internal rendering pipeline

      • firstTime: boolean

        Whether this is the first time setting parameters

      • material: Material

        The material instance being rendered

      • shaderProgram: WebGLProgram

        WebGL shader program to configure

    Returns void

  • Performs shader reflection to extract semantics information from vertex and pixel shaders.

    Parameters

    • vertexShader: ShaderityObject

      The vertex shader object for WebGL

    • pixelShader: ShaderityObject

      The pixel shader object for WebGL

    • vertexShaderWebGpu: ShaderityObject

      The vertex shader object for WebGPU

    • pixelShaderWebGpu: ShaderityObject

      The pixel shader object for WebGPU

    • definitions: string[]

      Array of shader definitions

    Returns ShaderSemanticsInfo[]

    Array of shader semantics information

  • Checks whether this object has a tag with the specified name

    Parameters

    • tagName: string

      The name of the tag to check for

    Returns boolean

    True if the tag exists (value is not null/undefined), false otherwise

  • Checks if this object has a tag with the specified name and value

    Parameters

    • tagName: string

      The tag name to match

    • tagValue: string

      The tag value to match

    Returns boolean

    True if the object has a matching tag, false otherwise

  • Checks if this object has all the specified tags with exactly matching values

    Parameters

    • tags: RnTags

      Object containing tag names as keys and expected values

    Returns boolean

    True if all specified tags exist with matching values, false otherwise

  • Checks if the object's combined tag string contains all the provided search strings. This allows for flexible searching within tag names and values.

    Parameters

    • stringArray: string[]

      Array of strings that must all be present in the combined tag string

    Returns boolean

    True if all strings are found in the combined tag string, false otherwise

  • Attempts to set a tag on this object. If the tag already exists, it will be replaced.

    Parameters

    • tag: Tag

      The tag object containing the name and value to set

    Returns boolean

    True if the tag was successfully set, false if the tag name contains invalid characters

  • Attempts to set a unique name for this object

    Parameters

    • name: string

      The desired unique name

    • toAddNameIfConflict: boolean

      If true, appends UID to make name unique when conflicts occur; if false, fails on conflict

    Returns boolean

    True if the name was successfully set, false if there was a conflict and toAddNameIfConflict was false

  • Validates that a tag string contains only allowed characters (alphanumeric and underscore)

    Parameters

    • val: string

      The string to validate

    Returns boolean

    True if the string contains only valid characters, false if it contains invalid characters

  • Searches for the first object that has a specific tag with the given value

    Parameters

    • tag: string

      The tag name to search for

    • value: string

      The tag value to match

    Returns undefined | WeakRef<RnObject>

    WeakRef to the first matching object, or undefined if not found