Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Points material with physically accurate world-space sizing. Extends THREE.ShaderMaterial to provide specialized point rendering.

    Hierarchy

    • ShaderMaterial
      • PointMaterial

    Implements

    Index
    • Create a new PointMaterial with the specified configuration. Mirrors the constructor pattern in LineMaterial and GSplatMaterial: derive an initial THREE blending state from the Luxar blendingMode, hand it to super({...}), then call applyBlendingMode to apply the canonical state (defines, depthTest, custom blend factors). One code path drives both creation and runtime mode changes from the layers panel.

      Parameters

      Returns PointMaterial

    • Update the viewport-dependent uniforms for world-space point sizing. The projection terms (size scale, ortho test) are read in shader from the projection matrix, so _isOrtho is accepted and ignored.

      Parameters

      • resolution: Vector2
      • _isOrtho: boolean = false
      • OptionalnearCull: number
      • pixelRatio: number = 1

      Returns void

    • Update gamma correction Only invGamma is used in shader; gamma value stored in userData for clone()

      When gamma crosses the 1.0 threshold (with epsilon), toggle the LUXAR_GAMMA_ONE define so the fragment shader's pow() fast path is recompiled in/out (mirrors the Line material).

      Parameters

      • gamma: number

      Returns void

    • Toggle the LUXAR_NO_GOG define based on the live uniform values for intensity + offset. Called by both updateIntensity and updateOffset because the flag depends on both values jointly. Returns true if the define changed (caller may need a rebuild). Mirrors LineMaterial._refreshNoGOGDefine.

      Returns boolean

    • Update the volumetric absorption coefficient κ (composed node attr). Plain uniform write — inert unless the material is in volumetric mode. Mirrors GSplatMaterial.updateAbsorption.

      Parameters

      • absorption: number

      Returns void

    • Flag whether the committed colors carry a real per-point alpha column (RGBA). Set per-commit by commit-points-geometry.ts; gates only the volumetric w(a) optical-depth map. Mirrors GSplatMaterial.updateHasElementAlpha.

      Parameters

      • hasAlpha: boolean

      Returns void

    • Rebind the point data texture (pool acquire may hand the node a different geometry+texture pair on growth or best-fit reuse). Plain uniform update — no shader recompilation involved. Mirrors GSplatMaterial.updateSplatTexture; null falls back to the shared placeholder so the sampler is never unbound.

      Parameters

      • texture: DataTexture | null

      Returns void

    • Update the colormap texture and enable/disable colormap mode.

      Under the instanced-quad rendering path, vertexColors is always false — the shader reads the color (USE_COLORMAP off) or the scalar (USE_COLORMAP on) from the point texture's texels. Only the USE_COLORMAP define flips here, triggering a recompile.

      Parameters

      • texture: DataTexture | null

      Returns void

    • Apply a Luxar blending mode to this material in-place.

      Single source of truth for both creation-time wiring (called by MaterialManager.getPointMaterial) and runtime UI transitions (called by LayersPanel.applyBlendingStateToMaterial). Without this method, the LayersPanel generic path forgot to set blendSrc/blendDst, so a runtime switch additive→max stranded SrcAlpha factors and produced inconsistent visuals.

      Sets the LUXAR_MAX_RGB_CONTRIBUTION shader define for max mode so the fragment shader premultiplies RGB by falloff/opacity. This is required because MaxEquation+OneFactor doesn't multiply by alpha at composite time. Toggling this define triggers a shader recompilation; that's intentional and only happens on actual mode transitions (idempotent — see userData.blendingMode early exit).

      Parameters

      Returns void

    • Bind a colormap LUT texture (or null to disable colormap mode).

      When texture is non-null, the USE_COLORMAP define is added and the uniforms (uColormapTex, uScalarMin, uScalarScale) are allocated with neutral defaults if they don't exist yet. When texture is null, the define is removed and the uniform values are cleared so a subsequent clone() doesn't resurrect a stale colormap.

      No-op when called on a material whose shader path doesn't include USE_COLORMAP-guarded uniforms.

      Parameters

      • texture: DataTexture | null

      Returns void

    • Update the scalar range [min, max] the colormap maps over. Encoded as uScalarMin = min and uScalarScale = 1/max(1e-10, max-min) for the shader. No-op when colormap mode is not active (uniforms are absent until setColormapTexture has been called once).

      Parameters

      • min: number
      • max: number

      Returns void