Skip to content

RawRenderPassParams<U>

ts
type RawRenderPassParams<U> = {
  gl?: WebGL2RenderingContext;
  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 rawRenderPass.

Type Parameters

U

U extends UniformValues = Record<string, never>

Properties

PropertyTypeDescription
gl?WebGL2RenderingContextOptional WebGL2 context used to initialize the pass immediately. Passes without a context are initialized by calling pass.initialize(gl) or using the compositor. Calling initialize() multiple times with the same context is a no-op.
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 concrete uniform values. Functions and promises are resolved by higher-level APIs such as renderPass() before rendering.
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.