Protected_Protected_Protected_Protected_The WebGL renderbuffer object for depth testing in off-screen rendering.
Protected_Protected_The WebGL framebuffer object used for off-screen rendering.
The WebGL2 rendering context.
Protected_A flag indicating if the behaviour has been initialized.
Protected_Protected_Protected_Protected_Protected_Protected_The elapsed time since the renderer was initialized.
Protected_Protected_The uniform location for the world inverse transpose matrix.
Protected_The uniform location for the world matrix.
Indicates whether the behaviour is currently active.
An inactive behaviour will not have its update method called.
The blending mode.
The face culling mode.
The depth testing mode.
The WebGL primitive type used for drawing the mesh.
Determines if blending is enabled.
Determines if face culling is enabled.
Determines if depth testing is enabled.
The face winding order.
The mesh data to be rendered.
The parent entity to which this behaviour is attached.
The render layer.
OptionalshaderThe shader program used for rendering.
Determines if writing to the depth buffer is enabled.
Gets the transform component of the parent entity. This provides easy access to the position, rotation, and scale of the entity.
ProtectedbindClears the current render target and returns rendering to the main canvas. This function unbinds the Framebuffer Object and restores the original viewport.
Creates a clone of the behaviour. This method should be overridden by subclasses to implement deep cloning of the behaviour.
Calculates the view, projection, and model-view-projection matrices for a light source. These matrices are used in shadow mapping to render the scene from the light's perspective.
The transform of the main camera.
The light source entity.
OptionalfrustumSize: number = 60.0The size of the orthographic frustum used for the light's projection.
Optionalnear: number = 0.1The near clipping plane of the light's frustum.
Optionalfar: number = 200.0The far clipping plane of the light's frustum.
An object containing the calculated matrices.
ProtectedcreateProtecteddeserializeCleans up resources used by the behaviour. This method is called when the behaviour is about to be destroyed.
Draws the mesh to the canvas.
Draws a line between two specified coordinates using the current shader. This method temporarily uses a vertex buffer to upload the line's data and draws it using GL_LINES.
Draws a single point at the specified coordinates using the current shader. This method temporarily uses a vertex buffer to upload the point's data and draws it using GL_POINTS.
Ends the current rendering pass and switches back to the default framebuffer (the canvas).
Deserializes the renderer's state from a JSON object. This is used for loading a scene or entity state.
The JSON object to deserialize from.
ProtectedgetProtectedgetProtectedgetInitializes the renderer, including its WebGL settings and shader.
True if initialization is successful, otherwise false.
ProtectedinitializeProtectedInitializes the shader and creates the necessary WebGL buffers.
ProtectedloadProtectedloadProtectedloadProtectedserializeProtectedsetProtectedSets the camera matrices (projection, view, and model-view-projection) in the shader.
Sets this object's gl instance.
The WebGL2 rendering context.
ProtectedsetProtectedSets the default WebGL state for rendering.
ProtectedsetProtectedsetProtectedSets the world and world inverse transpose matrices in the shader for lighting calculations.
ProtectedsetSets the current render target to a specific texture. This function creates or reuses a Framebuffer Object (FBO) and attaches the provided texture. All subsequent drawing calls will be rendered to this texture.
The texture to which the scene will be rendered.
The width of the render target.
The height of the render target.
ProtectedsetProtectedSets all common shader uniforms, including matrices, time, and screen resolution.
Starts a new rendering pass to a specific off-screen texture. This function sets up the render target and clears its contents.
The texture to which the scene will be rendered.
The width of the render target.
The height of the render target.
OptionalclearColor: [number, number, number, number] = ...The color to clear the framebuffer with. Defaults to a transparent black.
Serializes the renderer's state to a JSON object. This is used for saving the scene or entity state.
The JSON object representation of the renderer.
Updates the renderer's internal state.
The time elapsed since the last update in milliseconds.
Updates the behaviour specifically for editor mode. This method is called on every frame when the engine is in editor mode.
The time elapsed since the last frame in seconds.
StaticinstanciateA static factory method to create an instance of the RendererBehaviour.
The WebGL2 rendering context.
A new instance of RendererBehaviour.
A renderer for mesh-based objects that supports normal maps, lighting, and shadow mapping. This class extends the base RendererBehaviour to provide more advanced rendering features.