UNPKG

s2maps-gpu

Version:

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

41 lines (40 loc) 1.59 kB
import Workflow from './workflow.js'; import type Context from '../context/context.js'; import type { GlyphFeature, GlyphFilterUniforms, GlyphFilterWorkflow as GlyphFilterWorkflowSpec } from './workflow.spec.js'; /** Glyph Filter Feature is a standalone glyph filter compute storage unit that can be processed by the GPU */ export default class GlyphFilterWorkflow extends Workflow implements GlyphFilterWorkflowSpec { #private; label: "glyphFilter"; quadTexture: WebGLTexture; resultTexture: WebGLTexture; quadFramebuffer: WebGLFramebuffer; resultFramebuffer: WebGLFramebuffer; indexOffset: number; mode: 1 | 2; uniforms: { [key in GlyphFilterUniforms]: WebGLUniformLocation; }; /** @param context - The WebGL(1|2) context */ constructor(context: Context); /** Delete the glyph filter workflow */ delete(): void; /** Resize the glyph filter workflow */ resize(): void; /** * Set the draw mode * @param mode - the draw mode */ setMode(mode: number): void; /** Bind the resultant computed texture to a uniform texture that can be accessed by the glyph shaders */ bindResultTexture(): void; /** Bind the quad framebuffer */ bindQuadFrameBuffer(): void; /** Bind the result framebuffer */ bindResultFramebuffer(): void; /** * Draw the glyph filter features to the compute texture * @param feature - feature to draw * @param _interactive - whether or not the feature is interactive */ draw(feature: GlyphFeature, _interactive?: boolean): void; }