Creates a new RenderPass instance. Automatically assigns a unique render pass UID.
Optional Internal__Color attachment targets for rendering
If this value is greater than 1, buffer-less rendering is performed with the specified number of vertices. In this case, registered entities are ignored and not rendered.
A dummy primitive used for buffer-less rendering
Internal_Whether the sort render result has changed
Internal_Last index of blend without Z-write primitives in the render queue
Internal_Last index of blend with Z-write primitives in the render queue
Internal_Last camera controller components update count for change detection
Internal_Last index of opaque primitives in the render queue
Internal_Array of last primitive UIDs for optimization
Internal_Last scene graph components update count for change detection
Internal_Last transform components update count for change detection
Internal_Last index of translucent primitives in the render queue
The primitive mode used for buffer-less rendering
Internal_Whether something was rendered in the previous frame
Collection of tags associated with this object
Whether to render blend without Z-write primitives contained in this render pass
Whether to render blend with Z-write primitives contained in this render pass
Whether to render opaque primitives contained in this render pass
Whether to render translucent primitives contained in this render pass
OptionalcameraThe camera component used for rendering this pass
The color value used to clear the color buffer (RGBA format)
The depth value used to clear the depth buffer (typically 1.0 for far plane)
The stencil value used to clear the stencil buffer
Depth write mask for primitives drawing. When false, depth values are not written to the depth buffer, but depth clear is still performed.
Whether to enable depth testing during rendering
Whether this render pass outputs for VR display
Whether VR rendering is enabled for this render pass
Whether to clear the color buffer before rendering
Whether to clear the depth buffer before rendering
Whether to clear the stencil buffer before rendering
Whether to render Effekseer effects in this render pass
Static Internal__Static counter for generating unique mesh UIDs
StaticcurrentCurrent maximum object count for UID generation
Static ReadonlyInvalidInvalid object UID constant
InternalGets the optimized mesh components collection for rendering. This collection is filtered based on the rendering flags for different primitive types.
An array of mesh components that should be rendered
Gets the list of all entities in this render pass.
An array of scene graph entities
Gets the default material assigned to this render pass.
The default material, or undefined if none is set
Gets all mesh components from entities in this render pass. This includes all mesh components regardless of rendering flags.
An array of all mesh components
Gets the unique object identifier
The object's UID
Gets the unique identifier for this render pass.
The render pass UID
Gets all top-level scene graph components in this render pass. These are the root components of the scene graph hierarchies.
An array of top-level scene graph components
Gets the unique name of this object
The unique name string
InternalCopies the main framebuffer content to both resolve framebuffers using WebGL. This method handles the blit operations for multisampling resolve.
InternalCopies tag data from another RnObject instance to this object
The source RnObject to copy tags from
InternalCopies texture data from the first resolve framebuffer to the second using WebGPU. This method handles texture copying operations for WebGPU-based rendering.
Adds entities to be rendered in this render pass. The entities and their hierarchies are flattened and collected for rendering. Duplicate entities are automatically eliminated.
An array of scene graph entities to add
Removes all entities from this render pass and clears related collections. This effectively empties the render pass of all renderable content.
Creates a deep clone of this render pass. All properties and collections are copied, creating an independent instance.
A new RenderPass instance that is a copy of this one
InternalExecutes the post-render function if one has been set. This method is called internally by the rendering system.
InternalExecutes the pre-render function if one has been set. This method is called internally by the rendering system.
Determines the appropriate material to use for rendering a primitive. The priority order is:
The primitive to get the material for
The material that should be used for rendering the primitive
Gets the current framebuffer assigned to this render pass.
The framebuffer, or undefined if rendering to the default framebuffer
Gets the current render target color attachments.
Array of render buffer target enums, or undefined if using defaults
Gets the current resolve framebuffer.
The resolve framebuffer, or undefined if not set
Gets the current secondary resolve framebuffer.
The secondary resolve framebuffer, or undefined if not set
Retrieves a complete tag object (name and value) for the specified tag name
The name of the tag to retrieve
A Tag object containing the name and value
Retrieves the value associated with a specific tag name
The name of the tag whose value to retrieve
The tag value, or undefined if the tag doesn't exist
Gets the current viewport settings.
A Vector4 containing (x, y, width, height) of the viewport, or undefined if not set
Checks whether this object has a tag with the specified name
The name of the tag to check for
True if the tag exists (value is not null/undefined), false otherwise
Checks if this render pass is in buffer-less rendering mode.
True if buffer-less rendering is enabled (vertex count > 0)
Checks if this object has a tag with the specified name and value
The tag name to match
The tag value to match
True if the object has a matching tag, false otherwise
Checks if this object has all the specified tags with exactly matching values
Object containing tag names as keys and expected values
True if all specified tags exist with matching values, false otherwise
Checks if the object's combined tag string contains all the provided search strings. This allows for flexible searching within tag names and values.
Array of strings that must all be present in the combined tag string
True if all strings are found in the combined tag string, false otherwise
Removes the current framebuffer assignment. After calling this, the render pass will render to the default framebuffer.
Removes a tag from this object
The name of the tag to remove
Configures this render pass for full-screen buffer-less rendering. This is a convenience method that sets up triangle-based full-screen rendering with 3 vertices, commonly used for post-processing effects.
The material to use for full-screen rendering
Configures this render pass for buffer-less rendering mode. In buffer-less rendering, vertices are generated procedurally without vertex buffers. This is useful for full-screen effects or procedural geometry. When enabled, registered entities are ignored and not rendered.
The primitive mode to use for rendering
Number of vertices to generate and render
The material to use for rendering
Sets the target framebuffer for this render pass. If multiple render passes share a framebuffer, they will render to the same target. Setting a framebuffer automatically configures the viewport to match the framebuffer size.
Optionalframebuffer: FrameBufferThe framebuffer to render to, or undefined to render to the default framebuffer
Sets a default material for all primitives in this render pass. This material will be used for any primitive that doesn't have a specific material override set via setMaterialForPrimitive().
The default material to use for all primitives
Associates a specific material with a primitive for this render pass. When rendering the specified primitive, the render pass will use this material instead of the primitive's default material.
Sets a function to be called after each render operation. This can be used for custom cleanup logic after rendering completes.
The function to call after rendering
Sets a function to be called before each render operation. This can be used for custom setup logic before rendering begins.
The function to call before rendering
Sets the color attachment targets for rendering. This specifies which color attachments of the framebuffer should be rendered to.
Optionalindeces: RenderBufferTargetEnum[]Array of render buffer target enums, or undefined to use default targets
Sets the resolve framebuffer for multisampling. The resolve framebuffer is used as the destination when resolving multisampled content.
Optionalframebuffer: FrameBufferThe resolve framebuffer, or undefined to disable resolving
Sets the secondary resolve framebuffer. This can be used for additional resolve operations or multi-target resolving.
Optionalframebuffer: FrameBufferThe secondary resolve framebuffer, or undefined to disable
Sets whether to render blend without Z-write primitives in this render pass.
True to render blend without Z-write primitives, false to skip them
Sets whether to render blend with Z-write primitives in this render pass.
True to render blend with Z-write primitives, false to skip them
Sets whether to render opaque primitives in this render pass.
True to render opaque primitives, false to skip them
Sets whether to render translucent primitives in this render pass.
True to render translucent primitives, false to skip them
Sets the viewport for this render pass. The viewport defines the rectangular area of the framebuffer that will be rendered to.
A Vector4 containing (x, y, width, height) of the viewport
Attempts to set a tag on this object. If the tag already exists, it will be replaced.
The tag object containing the name and value to set
True if the tag was successfully set, false if the tag name contains invalid characters
Attempts to set a unique name for this object
The desired unique name
If true, appends UID to make name unique when conflicts occur; if false, fails on conflict
True if the name was successfully set, false if there was a conflict and toAddNameIfConflict was false
Unregisters this object from all tracking collections. Should be called when the object is being destroyed.
Validates that a tag string contains only allowed characters (alphanumeric and underscore)
The string to validate
True if the string contains only valid characters, false if it contains invalid characters
Static_InternalResets all static object tracking data. Used primarily for testing.
StaticgetRetrieves an RnObject instance by its unique identifier
The unique identifier of the object to retrieve
The RnObject instance or undefined if not found or garbage collected
StaticgetRetrieves an RnObject instance by its unique name
The unique name of the object to retrieve
The RnObject instance or undefined if not found or garbage collected
StaticsearchSearches for the first object that has a specific tag with the given value
The tag name to search for
The tag value to match
WeakRef to the first matching object, or undefined if not found
A render pass represents a collection of rendering resources and settings used in the rendering pipeline. It manages entities, materials, framebuffers, and various rendering states to control how objects are rendered.
Example