UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

57 lines (56 loc) 2.11 kB
import type { ShaderModule as LumaShaderModule } from '../webgl/types'; export declare const rasterUniforms: { name: string; vs: string; fs: string; uniformTypes: { bounds: string; coordinateConversion: string; desaturate: string; opacity: string; tintColor: string; transparentColor: string; }; }; /** * Register custom DECKGL_CREATE_COLOR and DECKGL_MUTATE_COLOR shader hooks * with the default ShaderAssembler. These hooks are used by the raster layer's * custom shader modules (rgbaImage, combineBands, colormap, etc.). * * In luma.gl 8.x these were registered via ProgramManager; in luma.gl 9.x * we register them with the ShaderAssembler singleton. * * NOTE: We must check the assembler's hook list every time rather than using * a module-level boolean guard, because deck.gl's getShaderAssembler() clears * _hookFunctions when a new Deck instance is created (e.g. during image export). */ export declare function ensureRasterHooksRegistered(): void; /** * Convert kepler.gl's custom raster shader modules into luma.gl 9 compatible * format. Ensures fs2 (WebGL2) shaders are used and texture2D -> texture. */ interface LumaModuleOutput { name: string; fs: string; vs?: string; defines?: Record<string, string>; getUniforms?: (opts: object) => Record<string, unknown> | null; uniforms?: Record<string, unknown>; uniformTypes?: Record<string, string>; inject?: Record<string, string>; dependencies?: unknown[]; deprecations?: unknown[]; } export declare function prepareLumaModules(modules: LumaShaderModule[]): LumaModuleOutput[]; /** * Build the vertex shader for the raster layer. * References raster.coordinateConversion from the UBO. */ export declare function buildRasterVertexShader(): string; /** * Build the fragment shader for the raster layer. * Uses DECKGL_CREATE_COLOR and DECKGL_MUTATE_COLOR hooks which are now * registered with the ShaderAssembler and populated by module injections. */ export declare function buildRasterFragmentShader(): string; export {};