Skip to content

RenderPassParams<U>

ts
type RenderPassParams<U> = {
  target?: RenderTarget | null;
  fragment: string;
  vertex: string;
  attributes?: Record<string, Attribute>;
  uniforms?: U;
  blending?: "none" | "normal" | "additive";
  depthTest?: boolean;
  drawMode?:
    | "POINTS"
    | "LINES"
    | "LINE_STRIP"
    | "LINE_LOOP"
    | "TRIANGLES"
    | "TRIANGLE_STRIP"
    | "TRIANGLE_FAN";
  transformFeedbackVaryings?: string[];
  resolutionScale?: number;
};

Parameters for creating a RenderPass.

Type Parameters

U

U extends Uniforms = Record<string, never>

Properties

PropertyTypeDescription
target?| RenderTarget | nullOptional initial render target for the pass. If not provided, it will render directly to the canvas or can be set later.
fragmentstringFragment shader source code.
vertexstringVertex shader source code.
attributes?Record<string, Attribute>Mapping of attribute names to their data and configuration.
uniforms?UInitial uniform values. These will be wrapped in a reactive proxy to track changes.
blending?"none" | "normal" | "additive"Blending mode to use for this pass. Default "none"
depthTest?booleanWhether to enable depth testing. Default false
drawMode?| "POINTS" | "LINES" | "LINE_STRIP" | "LINE_LOOP" | "TRIANGLES" | "TRIANGLE_STRIP" | "TRIANGLE_FAN"WebGL draw mode. Default "POINTS" if gl_PointSize is found in the vertex shader, otherwise "TRIANGLES".
transformFeedbackVaryings?string[]Array of varying names for Transform Feedback.
resolutionScale?numberScaling factor applied to the resolution when the pass is resized. Default 1

Released under the MIT License.