Collection of tags associated with this object
StaticcurrentCurrent maximum object count for UID generation
Static ReadonlyInvalidInvalid object UID constant
Gets the unique object identifier
The object's UID
Gets the unique name of this object
The unique name string
InternalCopies tag data from another RnObject instance to this object
The source RnObject to copy tags from
Executes a single frame render using the draw function provided to startRenderLoop.
Gets the initial expression used for buffer clearing and setup.
The initial expression, or undefined if not available
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 tone mapping expression used for HDR to LDR conversion.
The tone mapping expression, or undefined if not available
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 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
Refreshes the back buffer texture on all transparent materials. This is useful when materials are dynamically changed and need to have the back buffer texture re-applied for transmission rendering.
Call this method after changing materials on entities that use transmission to ensure the back buffer texture is properly set.
Removes a tag from this object
The name of the tag to remove
Sets the contribution factor for diffuse IBL lighting.
Contribution factor (0.0 to 1.0 or higher for over-exposure effects)
Sets the expressions to be rendered by the pipeline.
Array of expressions containing render passes and entities to render
Configuration options for expression setup
Whether to enable transmission rendering for transparent objects (default: true)
This method configures the expressions for both opaque and transparent rendering. When transmission is enabled, transparent objects are rendered in a separate pass to support advanced material effects like glass and water.
The method automatically clones expressions for transparent rendering and configures shadow expressions if shadow mapping is enabled.
Sets the rotation of the IBL environment in radians.
Rotation angle in radians
Sets the IBL (Image-Based Lighting) cube textures for realistic lighting.
Diffuse IBL cube texture for ambient lighting
Specular IBL cube texture for reflections
Optionalsheen: CubeTextureOptional sheen IBL cube texture for fabric-like materials
IBL textures provide realistic lighting by using pre-computed environment maps. The diffuse texture provides ambient lighting, while the specular texture provides reflections and specular highlights.
The sheen texture is optional and used for materials with fabric-like properties.
const diffuseCube = new Rn.CubeTexture();
diffuseCube.baseUriToLoad = './assets/ibl/diffuse/diffuse';
diffuseCube.hdriFormat = Rn.HdriFormat.RGBE_PNG;
const specularCube = new Rn.CubeTexture();
specularCube.baseUriToLoad = './assets/ibl/specular/specular';
specularCube.hdriFormat = Rn.HdriFormat.RGBE_PNG;
specularCube.mipmapLevelNumber = 10;
pipeline.setIBLTextures(diffuseCube, specularCube);
Requests a refresh of the shadow map expressions on the next frame. This is useful when materials with shadow support have been changed or added (e.g., applying a shader with ClassicShader node).
Sets the contribution factor for specular IBL reflections.
Contribution factor (0.0 to 1.0 or higher for over-exposure effects)
Sets the tone mapping algorithm used for HDR to LDR conversion.
The tone mapping algorithm to use
Tone mapping is essential for converting high dynamic range rendering results to low dynamic range output that can be displayed on standard monitors.
Available tone mapping algorithms:
// Use ACES tone mapping for cinematic look
pipeline.setToneMappingType(Rn.ToneMappingType.ACES_Hill);
// Use Reinhard for classic look
pipeline.setToneMappingType(Rn.ToneMappingType.Reinhard);
// Use Khronos PBR neutral for accurate colors
pipeline.setToneMappingType(Rn.ToneMappingType.KhronosPbrNeutral);
Initializes the rendering pipeline with the specified configuration.
The width of the rendering canvas in pixels
The height of the rendering canvas in pixels
Configuration options for the pipeline
OptionalisBloom?: booleanWhether to enable bloom post-processing effect (default: false)
OptionalisShadow?: booleanWhether to enable shadow mapping (default: false)
OptionalisSimple?: booleanWhether to use simplified rendering without post-processing (default: false)
OptionalshadowMapSize?: numberSize of the shadow map texture in pixels (default: 1024)
A Result indicating success or failure of the setup operation
This method must be called before using any other pipeline methods. It creates all necessary frame buffers, render targets, and expressions based on the provided configuration.
The method automatically detects WebXR capabilities and configures multi-view rendering when appropriate for VR applications.
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 forward rendering pipeline that provides advanced rendering features including shadows, bloom, tone mapping, and IBL.
Remarks
ForwardRenderPipeline is a comprehensive rendering solution that handles multi-pass rendering setups with features like MSAA, shadow mapping, bloom effects, and tone mapping. It supports both regular rendering and WebXR multi-view rendering for VR applications.
The pipeline automatically manages frame buffers, render targets, and expression chains to provide a complete rendering solution similar to Unity's Universal Render Pipeline (URP).
Example