UWAL / Skybox
Classes
Skybox
Use a cube texture to be rendered as a scene background.
See
Skybox / Materials and SkyBox for reference.
Properties
Camera
Camera: Camera3D;Camera instance to view the skybox. Usually, it should be the same as Scene.MainCamera.
UpdateViewProjectionMatrix
UpdateViewProjectionMatrix: boolean = false;Whether to update the ViewProjectionMatrix before inverting it.
See
Camera3D.GetInverseViewProjectionMatrix for reference.
Constructors
Constructor
new Skybox(
Renderer,
Camera,
label?
): Skybox;Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
Renderer | RenderStage | undefined | Renderer instance to create the pipeline. |
Camera | Camera3D | undefined | Camera instance to view the skybox. |
label? | string | "Skybox" | Skybox name. |
Returns
Methods
CreatePipeline()
CreatePipeline(pipelineDescriptor?): Promise<PipelineInstance>;Create an internal render pipeline to draw the skybox.
Parameters
| Parameter | Type | Description |
|---|---|---|
pipelineDescriptor? | RenderPipelineDescriptor | Optional pipeline descriptor. |
Returns
Promise<PipelineInstance>
SetCubeTextureView()
SetCubeTextureView(texture, sampler): GPUTextureView;Set a cube texture and a sampler to use for the skybox.
Parameters
| Parameter | Type | Description |
|---|---|---|
texture | GPUTexture | Cube texture to use for the skybox. |
sampler | GPUSampler | Sampler to use for the cube texture. |
Returns
GPUTextureView
Throws
ERROR.INVERSE_VIEW_PROJECTION_MATRIX_NOT_FOUND if called before CreatePipeline.
Render()
Render(submit?): void;Get the camera's view-projection matrix, update its buffer, and draw the skybox using an internal pipeline.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
submit? | boolean | false | Whether to destroy the render pass and submit the command buffer. |
Returns
void
Throws
ERROR.INVERSE_VIEW_PROJECTION_MATRIX_NOT_FOUND if called before CreatePipeline.
Destroy()
Destroy(): void;Destroy and remove the render pipeline, the inverse view-projection buffer, and reset the internal state.
Returns
void