UNPKG

s2maps-gpu

Version:

S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.

40 lines (39 loc) 1.44 kB
import Workflow from './workflow.js'; import type Camera from 'ui/camera/index.js'; import type Context from '../context/context.js'; import type { Projector } from 'ui/camera/projector/index.js'; import type { StyleDefinition } from 'style/style.spec.js'; import type { UrlMap } from 'util/index.js'; import type { SkyboxWorkflow as SkyboxWorkflowSpec, SkyboxWorkflowUniforms } from './workflow.spec.js'; /** Skybox Workflow renders a user styled skybox to the GPU */ export default class SkyboxWorkflow extends Workflow implements SkyboxWorkflowSpec { #private; label: "skybox"; cubeMap: WebGLTexture; facesReady: number; ready: boolean; fov: number; angle: number; matrix: Float32Array; uniforms: { [key in SkyboxWorkflowUniforms]: WebGLUniformLocation; }; /** @param context - The WebGL(1|2) context */ constructor(context: Context); /** * Update the skybox style * @param style - user defined style attributes * @param camera - The camera * @param urlMap - The url map to properly resolve urls */ updateStyle(style: StyleDefinition, camera: Camera, urlMap?: UrlMap): void; /** Flush the uniforms to the GPU (no-op) */ flush(): void; /** Use this workflow as the current shaders for the GPU */ use(): void; /** * Draw the skybox * @param projector - The projector */ draw(projector: Projector): void; }