Talos docs

RenderHandle

Since 0.6

Data-only writes to the parameters of shaders (*.shader.wgsl, docs/SHADERS.md).

Plain text

Reached in a behaviour as ctx.render.

Signature

export interface RenderHandle {
  /**
   * Writes one of the per-entity floats the entity's shader declares with `//! instance`, for this
   * entity only. It is data: no new material and no new batch, so it is cheap to call every tick. A
   * boolean is 0 or 1; the shader's own range clamps it. A name the shader does not declare is
   * logged once and ignored.
   */
  setShaderParam(entity: EntityHandle, name: string, value: number | boolean): void
  /**
   * Changes a param of the shader material a scene material asset (`*.material.json` with a
   * `shader`, named by its asset id) loaded as, for everything wearing it. A buffer write, no compile.
   */
  setMaterialParam(material: string, name: string, value: ShaderParamValue): void
}

Import: import type { RenderHandle } from "@argus/api"

Members

MemberSignatureDescription
setShaderParamsetShaderParam(entity: EntityHandle, name: string, value: number | boolean): voidWrites one of the per-entity floats the entity's shader declares with //! instance, for this entity only. It is data: no new material and no new batch, so it is cheap to call every tick. A boolean is 0 or 1; the shader's own range clamps it. A name the shader does not declare is logged once and ignored.
setMaterialParamsetMaterialParam(material: string, name: string, value: ShaderParamValue): voidChanges a param of the shader material a scene material asset (*.material.json with a shader, named by its asset id) loaded as, for everything wearing it. A buffer write, no compile.