# RenderHandle

> Talos 0.7 · Since 0.6

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

Reached in a behaviour as `ctx.render`.

## Signature

```ts
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

| Member | Signature | Description |
|---|---|---|
| `setShaderParam` | `setShaderParam(entity: EntityHandle, name: string, value: number \| boolean): void` | 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. |
| `setMaterialParam` | `setMaterialParam(material: string, name: string, value: ShaderParamValue): 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. |
