omega-game-engine
    Preparing search index...

    A specialized renderer for drawing a skybox. This class extends MeshRendererBehaviour and is responsible for rendering a large cube with a cubemap texture, creating the illusion of a sky and distant background.

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index

    Constructors

    Properties

    _aoMapUniformLocation: null | WebGLUniformLocation = null
    _bitangentAttributeLocation: number = -1
    _className: string = 'MeshRendererBehaviour'
    _depthRenderbuffer: null | WebGLRenderbuffer = null

    The WebGL renderbuffer object for depth testing in off-screen rendering.

    _emissiveMapUniformLocation: null | WebGLUniformLocation = null
    _framebuffer: null | WebGLFramebuffer = null

    The WebGL framebuffer object used for off-screen rendering.

    _gl: WebGL2RenderingContext

    The WebGL2 rendering context.

    _initialized: boolean = false

    A flag indicating if the behaviour has been initialized.

    _normalMapUniformLocation: null | WebGLUniformLocation = null
    _roughnessMapUniformLocation: null | WebGLUniformLocation = null
    _serializationIgnoreKeys: string[]
    _specularMapUniformLocation: null | WebGLUniformLocation = null
    _tangentAttributeLocation: number = -1
    _time: number = 0

    The elapsed time since the renderer was initialized.

    _uuid: string
    _worldInverseTransposeMatrixUniformLocation: null | WebGLUniformLocation = null

    The uniform location for the world inverse transpose matrix.

    _worldMatrixUniformLocation: null | WebGLUniformLocation = null

    The uniform location for the world matrix.

    active: boolean = true

    Indicates whether the behaviour is currently active. An inactive behaviour will not have its update method called.

    blendMode: BlendingMode = ...

    The blending mode.

    castShadows: boolean = true
    cullFace: CullFace = CullFace.BACK

    The face culling mode.

    dephMode: DephFunction = DephFunction.Less

    The depth testing mode.

    drawPrimitiveType: GLPrimitiveType = GLPrimitiveType.LINES

    The WebGL primitive type used for drawing the mesh.

    enableBlend: boolean = true

    Determines if blending is enabled.

    enableCullFace: boolean = true

    Determines if face culling is enabled.

    enableDephTest: boolean = true

    Determines if depth testing is enabled.

    faceWinding: FaceWinding = FaceWinding.CounterClockwise

    The face winding order.

    mesh: Mesh

    The mesh data to be rendered.

    name: string = ''
    parent: SceneEntity

    The parent entity to which this behaviour is attached.

    receiveShadows: boolean = true
    renderLayer: RenderLayer = RenderLayer.OPAQUE

    The render layer.

    shader?: Shader

    The shader program used for rendering.

    writeToDephBuffer: boolean = true

    Determines if writing to the depth buffer is enabled.

    Accessors

    • get transform(): Transform

      Gets the transform component of the parent entity. This provides easy access to the position, rotation, and scale of the entity.

      Returns Transform

    Methods

    • 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.

      Parameters

      • cameraTransform: Transform

        The transform of the main camera.

      • light: Light

        The light source entity.

      • OptionalfrustumSize: number = 60.0

        The size of the orthographic frustum used for the light's projection.

      • Optionalnear: number = 0.1

        The near clipping plane of the light's frustum.

      • Optionalfar: number = 200.0

        The far clipping plane of the light's frustum.

      Returns { lightMvpMatrix: mat4; lightProjectionMatrix: mat4; lightViewMatrix: mat4 }

      An object containing the calculated matrices.

    • 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.

      Parameters

      • point: Vector3

        The 3D coordinates of the point to draw`.

      • OptionalpointSize: number = 10.0

        The size of the point to draw.

      • Optionalshader: Shader = ...

        The shader to use for drawing.

      Returns void

    • Sets 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.

      Parameters

      • texture: WebGLTexture

        The texture to which the scene will be rendered.

      • width: number

        The width of the render target.

      • height: number

        The height of the render target.

      Returns void

    • Starts a new rendering pass to a specific off-screen texture. This function sets up the render target and clears its contents.

      Parameters

      • texture: WebGLTexture

        The texture to which the scene will be rendered.

      • width: number

        The width of the render target.

      • height: number

        The height of the render target.

      • OptionalclearColor: [number, number, number, number] = ...

        The color to clear the framebuffer with. Defaults to a transparent black.

      Returns void

    • Updates the behaviour specifically for editor mode. This method is called on every frame when the engine is in editor mode.

      Parameters

      • elapsed: number

        The time elapsed since the last frame in seconds.

      Returns void