Creates an instance of SkyboxRenderer.
The WebGL2 rendering context.
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.
ProtectedcreateCalculates 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 skybox renderer. This method sets the initial transform of the skybox to be large enough to encompass the entire scene.
ProtectedinitializeProtectedInitializes the shader and creates the necessary WebGL buffers.
ProtectedloadProtectedloadProtectedloadProtectedserializeSets the camera matrices for the skybox, ensuring the skybox remains centered on the camera. This is achieved by using a view matrix that has had its translation component removed.
Sets this object's gl instance.
The WebGL2 rendering context.
ProtectedsetProtectedSets the specific WebGL settings for rendering the skybox. This method ensures that the skybox is rendered correctly by culling the front faces and using the LEQUAL depth function.
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.
Sets all shader variables required for rendering the skybox. This method sets the GL settings, camera matrices, and loads the shader data.
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.
StaticinstanciateCreates a new instance of the SkyboxRenderer.
The WebGL2 rendering context.
A specialized renderer for drawing a skybox. This class extends
MeshRendererBehaviourand is responsible for rendering a large cube with a cubemap texture, creating the illusion of a sky and distant background.