@maptalks/reshader.gl
Advanced tools
+315
-85
@@ -0,13 +1,66 @@ | ||
| /// <reference types="@webgpu/types" /> | ||
| /// <reference types="gl-matrix/index.js" /> | ||
| /// <reference types="gl-matrix" /> | ||
| /*! | ||
| * @maptalks/reshader.gl v0.107.4 | ||
| * @maptalks/reshader.gl v0.108.0 | ||
| * LICENSE : UNLICENSED | ||
| * (c) 2016-2025 maptalks.com | ||
| */ | ||
| import * as REGL from '@maptalks/regl'; | ||
| import REGL__default, { Texture, Texture2DOptions, TextureImageData, Regl, Texture2D as Texture2D$1, Uniforms } from '@maptalks/regl'; | ||
| import REGL, { Texture, Texture2DOptions, TextureImageData, Regl, Texture2D as Texture2D$1, Uniforms } from '@maptalks/regl'; | ||
| import { vec3, mat4 } from 'gl-matrix'; | ||
| export { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 } from 'gl-matrix'; | ||
| declare class GraphicsFramebuffer { | ||
| device: GraphicsDevice; | ||
| options: any; | ||
| width: number; | ||
| height: number; | ||
| constructor(device: any, options: any); | ||
| get color(): GraphicsTexture[]; | ||
| resize(width: any, height: any): void; | ||
| _update(): void; | ||
| getRenderPassDescriptor(): GPURenderPassDescriptor; | ||
| setClearOptions(options: any): void; | ||
| _resetClearOptions(): void; | ||
| destroy(): void; | ||
| } | ||
| declare class GraphicsDevice { | ||
| wgpu: GPUDevice; | ||
| context: GPUCanvasContext; | ||
| adapter: GPUAdapter; | ||
| gltfManager?: any; | ||
| _supportedFormats: any; | ||
| constructor(device: GPUDevice, context: GPUCanvasContext, adapter: GPUAdapter); | ||
| hasExtension(extension: any): boolean; | ||
| getCommandEncoder(): GPUCommandEncoder; | ||
| endCommandEncoder(): void; | ||
| getDefaultFramebuffer(): GraphicsFramebuffer; | ||
| getRenderPassEncoder(fbo: GraphicsFramebuffer): GPURenderPassEncoder; | ||
| addCommandBuffer(commandBuffer: GPUCommandBuffer, front: boolean): void; | ||
| submit(): void; | ||
| buffer(options: any): any; | ||
| framebuffer(width: any, height: any): GraphicsFramebuffer; | ||
| texture(config: any): GraphicsTexture; | ||
| clear(options: any): void; | ||
| read(options: any): any; | ||
| destroy(): void; | ||
| } | ||
| declare class GraphicsTexture { | ||
| texture: GPUTexture; | ||
| device: GraphicsDevice; | ||
| config: any; | ||
| constructor(device: GraphicsDevice, config: any); | ||
| get width(): any; | ||
| get height(): any; | ||
| updateFilter(): void; | ||
| _clearBindGroups(): void; | ||
| resize(width: any, height: any): void; | ||
| update(config: any): void; | ||
| getView(): GPUTextureView; | ||
| addBindGroup(bindGroup: any): void; | ||
| destroy(): void; | ||
| } | ||
| type UrlModifierFunction = (url: string) => string; | ||
@@ -19,3 +72,3 @@ type TypedArray = Uint8Array | Uint16Array | Uint32Array | Int8Array | Int16Array | Float32Array; | ||
| 'positionSize'?: number; | ||
| 'primitive'?: REGL__default.PrimitiveType; | ||
| 'primitive'?: REGL.PrimitiveType; | ||
| 'positionAttribute'?: string; | ||
@@ -41,6 +94,7 @@ 'normalAttribute'?: string; | ||
| }[] & AttributeKey; | ||
| type ShaderUniformValue = number | boolean | string | NumberArray | null | AbstractTexture | Texture; | ||
| type ShaderUniformValue = number | boolean | string | NumberArray | null | ShaderUniformTexture; | ||
| type ShaderUniformTexture = AbstractTexture | Texture | GraphicsTexture; | ||
| type ShaderUniforms = { | ||
| meshConfig?: MeshOptions; | ||
| primitive?: REGL__default.PrimitiveType; | ||
| primitive?: REGL.PrimitiveType; | ||
| } & { | ||
@@ -61,7 +115,7 @@ [_: string]: ShaderUniformValue; | ||
| type AttributeBufferData = { | ||
| buffer?: REGL__default.Buffer; | ||
| buffer?: REGL.Buffer; | ||
| data?: NumberArray; | ||
| divisor?: number; | ||
| }; | ||
| type AttributeType = NumberArray | REGL__default.Buffer | AttributeBufferData; | ||
| type AttributeType = NumberArray | REGL.Buffer | AttributeBufferData; | ||
| type InstancedAttribute = Record<string, AttributeType>; | ||
@@ -85,2 +139,3 @@ type ImageObject = { | ||
| persistent?: boolean; | ||
| compare?: GPUCompareFunction; | ||
| } & Texture2DOptions; | ||
@@ -157,3 +212,3 @@ | ||
| dirty?: boolean; | ||
| constructor(config: any, resLoader: any); | ||
| constructor(config: any, resLoader?: any); | ||
| onLoad(data: any): void; | ||
@@ -164,4 +219,5 @@ isReady(): boolean; | ||
| createREGLTexture(regl: Regl): null | Texture2D$1; | ||
| getREGLTexture(regl: Regl): REGL__default.Texture2D; | ||
| getREGLTexture(regl: any): any; | ||
| getMemorySize(): number; | ||
| _update(): void; | ||
| dispose(): void; | ||
@@ -205,5 +261,9 @@ } | ||
| declare class Geometry { | ||
| static createElementBuffer(device: any, elements: any): any; | ||
| static createBuffer(device: any, data: any, name?: string): any; | ||
| static padGPUBufferAlignment(array: TypedArray, vertexCount: number): TypedArray; | ||
| data: Record<string, AttributeData>; | ||
| elements: any; | ||
| desc: GeometryDesc; | ||
| semantic: Record<string, string>; | ||
| count: number; | ||
@@ -218,5 +278,6 @@ properties: any; | ||
| get version(): number; | ||
| getBuffer(name: string): any; | ||
| getAttrData(activeAttributes: ActiveAttributes): any; | ||
| getREGLData(regl: any, activeAttributes: ActiveAttributes, disableVAO: boolean): AttributeData; | ||
| generateBuffers(regl: Regl): void; | ||
| generateBuffers(device: any): void; | ||
| getVertexCount(): number; | ||
@@ -229,4 +290,2 @@ getColor0Size(): number; | ||
| */ | ||
| addBuffer(key: string, data: ArrayBuffer | REGL__default.Buffer): this; | ||
| updateBuffer(key: string, data: ArrayBuffer | REGL__default.Buffer): this; | ||
| deleteData(name: string): this; | ||
@@ -240,6 +299,8 @@ /** | ||
| updateData(name: string, data: AttributeData): this; | ||
| _updateGPUBuffer(buffer: GPUBuffer, data: AttributeData): any; | ||
| updateSubData(name: string, data: AttributeData, offset: number): this; | ||
| getPrimitive(): REGL__default.PrimitiveType; | ||
| getPrimitive(): REGL.PrimitiveType; | ||
| getElements(): any; | ||
| setElements(elements: any, count: number): this; | ||
| isIndexedElements(): boolean; | ||
| deleteElements(): this; | ||
@@ -268,3 +329,5 @@ setDrawCount(count: number): this; | ||
| getMemorySize(): number; | ||
| getElementsType(elements: NumberArray): "uint8" | "uint16" | "uint32"; | ||
| getElementsType(elements: NumberArray): "uint8" | "uint32" | "uint16"; | ||
| getCommandKey(device: any): string; | ||
| getBufferDescriptor(vertexInfo: any): any[]; | ||
| } | ||
@@ -292,3 +355,3 @@ | ||
| unlit: boolean; | ||
| constructor(uniforms: ShaderUniforms, defaultUniforms: ShaderUniforms); | ||
| constructor(uniforms?: ShaderUniforms, defaultUniforms?: ShaderUniforms); | ||
| set version(v: number); | ||
@@ -299,4 +362,9 @@ get version(): number; | ||
| get doubleSided(): boolean; | ||
| getUniforms(device: any): ShaderUniforms; | ||
| getMemorySize(): number; | ||
| isReady(): boolean; | ||
| set(k: string, v: ShaderUniformValue): this; | ||
| hasUniform(k: string): any; | ||
| setUniform(k: string, v: ShaderUniformValue): this; | ||
| getUniform(k: string): ShaderUniformValue; | ||
| set(k: string, v: ShaderUniformValue, isDispose?: boolean): this; | ||
| setFunctionUniform(k: string, fn: () => ShaderUniformValue): this; | ||
@@ -310,5 +378,4 @@ hasFunctionUniform(k: string): boolean; | ||
| */ | ||
| appendDefines(defines: ShaderDefines, geometry: Geometry): ShaderDefines; | ||
| appendDefines(defines: ShaderDefines, _geometry: Geometry): ShaderDefines; | ||
| hasSkinAnimation(): boolean; | ||
| getUniforms(regl: Regl): ShaderUniforms; | ||
| isTexture(k: string): boolean; | ||
@@ -318,5 +385,3 @@ dispose(): void; | ||
| getUniformKeys(): string; | ||
| getMemorySize(): number; | ||
| } | ||
| //# sourceMappingURL=Material.d.ts.map | ||
@@ -356,2 +421,86 @@ declare class WireFrameMaterial extends Material { | ||
| type DynamicBufferAllocation = { | ||
| storage?: ArrayBuffer; | ||
| gpuBuffer?: GPUBuffer; | ||
| offset?: number; | ||
| size?: number; | ||
| }; | ||
| declare class DynamicBufferPool { | ||
| /** | ||
| * Allocation size of the underlying buffers. | ||
| * | ||
| */ | ||
| bufferSize: number; | ||
| /** | ||
| * Internally allocated gpu buffers. | ||
| * | ||
| */ | ||
| poolBuffers: DynamicBufferAllocation[]; | ||
| usedBuffers: DynamicBufferAllocation[]; | ||
| /** | ||
| * @type {DynamicBufferAllocation|null} | ||
| */ | ||
| activeBuffer: DynamicBufferAllocation; | ||
| device: GPUDevice; | ||
| bufferAlignment: number; | ||
| /** | ||
| * Create the system of dynamic buffers. | ||
| * | ||
| * @param device - The graphics device. | ||
| * @param bufferSize - The size of the underlying large buffers. | ||
| * @param bufferAlignment - Alignment of each allocation. | ||
| */ | ||
| constructor(device: GPUDevice, bufferSize: number, bufferAlignment: number); | ||
| /** | ||
| * Destroy the system of dynamic buffers. | ||
| */ | ||
| destroy(): void; | ||
| /** | ||
| * Allocate an aligned space of the given size from a dynamic buffer. | ||
| * | ||
| * @param {DynamicBufferAllocation} allocation - The allocation info to fill. | ||
| * @param {number} size - The size of the allocation. | ||
| */ | ||
| alloc(allocation: any, size: any): void; | ||
| createBuffer(device: GPUDevice, size: number): GPUBuffer; | ||
| scheduleSubmit(): void; | ||
| submit(): void; | ||
| } | ||
| declare class DynamicOffsets { | ||
| items: any[]; | ||
| offsets: number[]; | ||
| index: number; | ||
| constructor(); | ||
| reset(): void; | ||
| addItem(binding: any, offset: any): void; | ||
| addItems(items: any[]): void; | ||
| getItems(): any[]; | ||
| getDynamicOffsets(): number[]; | ||
| } | ||
| declare class DynamicBuffer { | ||
| bindgroupMapping: any; | ||
| dynamicOffsets: number[]; | ||
| pool: DynamicBufferPool; | ||
| allocation: DynamicBufferAllocation; | ||
| version: number; | ||
| constructor(bindgroupMapping: any, pool: DynamicBufferPool); | ||
| writeBuffer(uniformValues: Record<string, ShaderUniformValue>, dynamicOffsets: DynamicOffsets): void; | ||
| _fillValue(type: any, buffer: any, offset: any, size: any, value: any): void; | ||
| dispose(): void; | ||
| } | ||
| declare class BindGroupFormat { | ||
| bytes: number; | ||
| uuid: number; | ||
| name: string; | ||
| constructor(name: any, bindGroupMapping: any, minUniformBufferOffsetAlignment: any); | ||
| getShaderUniforms(): any; | ||
| getMeshUniforms(): any; | ||
| _parse(bindGroupMapping: any): void; | ||
| createBindGroup(device: GraphicsDevice, mesh: Mesh$1, shaderUniforms: ShaderUniforms, layout: GPUBindGroupLayout, shaderBuffer: DynamicBuffer, meshBuffer: DynamicBuffer): GPUBindGroup; | ||
| dispose(): void; | ||
| } | ||
| /** | ||
@@ -362,2 +511,3 @@ * Config: | ||
| declare class Mesh$1 { | ||
| uuid: number; | ||
| transparent: boolean; | ||
@@ -396,2 +546,3 @@ bloom: boolean; | ||
| hasFunctionUniform(k: string): boolean; | ||
| hasUniform(k: string): boolean; | ||
| getUniform(k: string): ShaderUniformValue; | ||
@@ -401,7 +552,8 @@ getDefines(): ShaderDefines; | ||
| hasSkinAnimation(): boolean; | ||
| getCommandKey(regl: Regl): string; | ||
| getUniforms(regl: Regl): ShaderUniforms; | ||
| getCommandKey(device: any): string; | ||
| getRenderProps(device: any): ShaderUniforms; | ||
| appendGeoAttributes(props: any, device: any, activeAttributes: any): void; | ||
| getUniforms(device: any): ShaderUniforms; | ||
| getMaterial(): Material; | ||
| getElements(): any; | ||
| getREGLProps(regl: Regl, activeAttributes: ActiveAttributes): ShaderUniforms; | ||
| dispose(): this; | ||
@@ -413,4 +565,9 @@ isValid(): boolean; | ||
| getWorldTransform(): any; | ||
| _meshBuffer: Record<string, DynamicBuffer>; | ||
| writeDynamicBuffer(commandUID: number, renderProps: any, bindGroupMapping: BindGroupFormat, pool: DynamicBufferPool, dynamicOffsets: DynamicOffsets): DynamicBuffer; | ||
| getBindGroup(key: any): GPUBindGroup; | ||
| setBindGroup(key: any, bindGroup: any): this; | ||
| getShaderFnValues(shaderUID: number): GPUBindGroup; | ||
| setShaderFnValues(shaderUID: number, fnValues: any): this; | ||
| } | ||
| //# sourceMappingURL=Mesh.d.ts.map | ||
@@ -424,7 +581,9 @@ declare class InstancedMesh extends Mesh$1 { | ||
| getDefines(): ShaderDefines; | ||
| getCommandKey(regl: Regl): string; | ||
| getCommandKey(device: any): string; | ||
| updateInstancedData(name: string, data: any): this; | ||
| generateInstancedBuffers(regl: Regl): this; | ||
| getREGLProps(regl: Regl, activeAttributes: ActiveAttributes): ShaderUniforms; | ||
| getInstancedBuffer(name: string): any; | ||
| generateInstancedBuffers(device: any): this; | ||
| getRenderProps(regl: Regl): ShaderUniforms; | ||
| disposeInstancedData(): void; | ||
| getBufferDescriptor(vertexInfo: any): any[]; | ||
| } | ||
@@ -458,6 +617,6 @@ | ||
| declare class Renderer { | ||
| regl: Regl; | ||
| constructor(regl: Regl); | ||
| render(shader: any, uniforms: Uniforms, scene: Scene, framebuffer: REGL__default.Framebuffer): number; | ||
| clear(options: REGL__default.ClearOptions): void; | ||
| device: any; | ||
| constructor(device: any); | ||
| render(shader: any, uniforms: Uniforms, scene: Scene, framebuffer: REGL.Framebuffer): number; | ||
| clear(options: REGL.ClearOptions): void; | ||
| } | ||
@@ -471,9 +630,14 @@ //# sourceMappingURL=Renderer.d.ts.map | ||
| declare class Texture2D extends AbstractTexture { | ||
| _version: number; | ||
| get version(): number; | ||
| set version(version: number); | ||
| onLoad({ data }: { | ||
| data: any; | ||
| }): void; | ||
| createREGLTexture(regl: Regl): REGL__default.Texture2D; | ||
| setConfig(config: any): void; | ||
| setMinFilter(value: number): void; | ||
| setMagFilter(value: number): void; | ||
| createREGLTexture(regl: Regl): REGL.Texture2D; | ||
| _checkNPOT(regl: any): void; | ||
| } | ||
| //# sourceMappingURL=Texture2D.d.ts.map | ||
@@ -567,2 +731,3 @@ declare class Plane extends Geometry { | ||
| declare function isArray(arr: any): boolean; | ||
| declare function getArrayCtor(arr: any): ArrayConstructor | Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor; | ||
| /** | ||
@@ -614,3 +779,3 @@ * 对两个矢量执行线性推算 | ||
| */ | ||
| declare function isSupportVAO(regl: Regl): boolean; | ||
| declare function isSupportVAO(regl: any): any; | ||
| /** | ||
@@ -639,3 +804,3 @@ * Object.hasOwnProperty的包装方法 | ||
| */ | ||
| declare function getTexMemorySize(tex: REGL__default.Texture): number; | ||
| declare function getTexMemorySize(tex: REGL.Texture): number; | ||
| /** | ||
@@ -648,3 +813,3 @@ * 获取regl texture的byte width | ||
| */ | ||
| declare function getTextureByteWidth(type: any): 0 | 1 | 2 | 4; | ||
| declare function getTextureByteWidth(type: any): 4 | 1 | 2 | 0; | ||
| /** | ||
@@ -657,3 +822,3 @@ * 获取regl texture 的channels数量 | ||
| */ | ||
| declare function getTextureChannels(format: any): 1 | 2 | 4 | 3; | ||
| declare function getTextureChannels(format: any): 4 | 1 | 2 | 3; | ||
| /** | ||
@@ -682,3 +847,3 @@ * 检查该attribute数据是否处于interleaved数据中 | ||
| */ | ||
| declare function getSupportedFormats(gl: WebGL2RenderingContext | WebGLRenderingContext): { | ||
| declare function getSupportedFormats(gl: WebGL2RenderingContext | WebGLRenderingContext | GPUDevice): { | ||
| etc: boolean; | ||
@@ -707,3 +872,3 @@ etc1: boolean; | ||
| declare function isPowerOfTwo(value: number): boolean; | ||
| declare function resizeToPowerOfTwo(image: HTMLImageElement | NumberArray, width?: number, height?: number): NumberArray | HTMLImageElement | HTMLCanvasElement; | ||
| declare function resizeToPowerOfTwo(image: HTMLImageElement | NumberArray, width?: number, height?: number): NumberArray | HTMLCanvasElement | HTMLImageElement; | ||
| declare function supportNPOT(regl: any): boolean; | ||
@@ -716,2 +881,3 @@ declare function isTextureDestroyed(texture: any): boolean; | ||
| declare const Util_d_extendWithoutNil: typeof extendWithoutNil; | ||
| declare const Util_d_getArrayCtor: typeof getArrayCtor; | ||
| declare const Util_d_getBufferSize: typeof getBufferSize; | ||
@@ -743,3 +909,3 @@ declare const Util_d_getPosArrayType: typeof getPosArrayType; | ||
| declare namespace Util_d { | ||
| export { Util_d_clamp as clamp, Util_d_defined as defined, Util_d_extend as extend, Util_d_extendWithoutNil as extendWithoutNil, Util_d_getBufferSize as getBufferSize, Util_d_getPosArrayType as getPosArrayType, Util_d_getSupportedFormats as getSupportedFormats, Util_d_getTexMemorySize as getTexMemorySize, Util_d_getTextureByteWidth as getTextureByteWidth, Util_d_getTextureChannels as getTextureChannels, Util_d_hasOwn as hasOwn, Util_d_hashCode as hashCode, Util_d_interpolate as interpolate, Util_d_isArray as isArray, Util_d_isFunction as isFunction, Util_d_isInStride as isInStride, Util_d_isInterleaved as isInterleaved, Util_d_isNil as isNil, Util_d_isNumber as isNumber, Util_d_isPowerOfTwo as isPowerOfTwo, Util_d_isString as isString, Util_d_isSupportVAO as isSupportVAO, Util_d_isTextureDestroyed as isTextureDestroyed, Util_d_lerp as lerp, Util_d_log2 as log2, Util_d_normalize as normalize, Util_d_resizeToPowerOfTwo as resizeToPowerOfTwo, Util_d_set as set, Util_d_supportNPOT as supportNPOT }; | ||
| export { Util_d_clamp as clamp, Util_d_defined as defined, Util_d_extend as extend, Util_d_extendWithoutNil as extendWithoutNil, Util_d_getArrayCtor as getArrayCtor, Util_d_getBufferSize as getBufferSize, Util_d_getPosArrayType as getPosArrayType, Util_d_getSupportedFormats as getSupportedFormats, Util_d_getTexMemorySize as getTexMemorySize, Util_d_getTextureByteWidth as getTextureByteWidth, Util_d_getTextureChannels as getTextureChannels, Util_d_hasOwn as hasOwn, Util_d_hashCode as hashCode, Util_d_interpolate as interpolate, Util_d_isArray as isArray, Util_d_isFunction as isFunction, Util_d_isInStride as isInStride, Util_d_isInterleaved as isInterleaved, Util_d_isNil as isNil, Util_d_isNumber as isNumber, Util_d_isPowerOfTwo as isPowerOfTwo, Util_d_isString as isString, Util_d_isSupportVAO as isSupportVAO, Util_d_isTextureDestroyed as isTextureDestroyed, Util_d_lerp as lerp, Util_d_log2 as log2, Util_d_normalize as normalize, Util_d_resizeToPowerOfTwo as resizeToPowerOfTwo, Util_d_set as set, Util_d_supportNPOT as supportNPOT }; | ||
| } | ||
@@ -754,3 +920,18 @@ | ||
| declare namespace _default { | ||
| declare const GL_NEAREST = 9728; | ||
| declare const GL_LINEAR = 9729; | ||
| declare const GL_LINEAR_MIPMAP_LINEAR = 9987; | ||
| declare const MAG_FILTER = 10240; | ||
| declare const MIN_FILTER = 10241; | ||
| declare const WebGLConstants_d_GL_LINEAR: typeof GL_LINEAR; | ||
| declare const WebGLConstants_d_GL_LINEAR_MIPMAP_LINEAR: typeof GL_LINEAR_MIPMAP_LINEAR; | ||
| declare const WebGLConstants_d_GL_NEAREST: typeof GL_NEAREST; | ||
| declare const WebGLConstants_d_MAG_FILTER: typeof MAG_FILTER; | ||
| declare const WebGLConstants_d_MIN_FILTER: typeof MIN_FILTER; | ||
| declare namespace WebGLConstants_d { | ||
| export { WebGLConstants_d_GL_LINEAR as GL_LINEAR, WebGLConstants_d_GL_LINEAR_MIPMAP_LINEAR as GL_LINEAR_MIPMAP_LINEAR, WebGLConstants_d_GL_NEAREST as GL_NEAREST, WebGLConstants_d_MAG_FILTER as MAG_FILTER, WebGLConstants_d_MIN_FILTER as MIN_FILTER }; | ||
| } | ||
| declare namespace _default$1 { | ||
| /** | ||
@@ -767,23 +948,38 @@ * Register a new shader segment for includes for 3rd parties | ||
| function compile(source: string): any; | ||
| function get(name: any): any; | ||
| } | ||
| //# sourceMappingURL=ShaderLib.d.ts.map | ||
| declare class Shader { | ||
| constructor({ vert, frag, uniforms, defines, extraCommandProps }: { | ||
| declare const _default: { | ||
| register(name: any, segment: any): void; | ||
| /** | ||
| * Compile the given source, replace #include with registered shader sources | ||
| * @param {String} source source to compile | ||
| */ | ||
| compile(source: any, defines: any): any; | ||
| get(name: any): any; | ||
| }; | ||
| //# sourceMappingURL=WgslShaderLib.d.ts.map | ||
| declare class GLShader { | ||
| vert: string; | ||
| frag: string; | ||
| wgslVert: string; | ||
| wgslFrag: string; | ||
| uid: number; | ||
| version: number; | ||
| extraCommandProps: any; | ||
| name: string; | ||
| constructor({ vert, frag, wgslVert, wgslFrag, uniforms, defines, extraCommandProps, name }: { | ||
| vert: any; | ||
| frag: any; | ||
| wgslVert: any; | ||
| wgslFrag: any; | ||
| uniforms: any; | ||
| defines: any; | ||
| extraCommandProps: any; | ||
| name: any; | ||
| }); | ||
| vert: any; | ||
| frag: any; | ||
| set shaderDefines(defines: any); | ||
| get shaderDefines(): any; | ||
| uniforms: any; | ||
| contextDesc: {}; | ||
| extraCommandProps: any; | ||
| commands: {}; | ||
| _shaderDefines: any; | ||
| dkey: string; | ||
| set shaderDefines(defines: Record<string, string | number>); | ||
| get shaderDefines(): Record<string, string | number>; | ||
| setDefines(defines: any): void; | ||
@@ -796,2 +992,9 @@ /** | ||
| setFramebuffer(framebuffer: any): this; | ||
| run(regl: any, command: any, props: any): any; | ||
| getShaderCommandKey(device: any, mesh: any, uniformValues: any): string; | ||
| getVersion(regl: any, source: any): "" | "#version 300 es\n" | "#version 100\n"; | ||
| getActiveVars(regl: any, vert: any, frag: any, hash: any): any; | ||
| _insertDefines(source: any, defines: any): string; | ||
| createMeshCommand(regl: any, mesh: any, commandProps?: {}, uniformValues?: any): any; | ||
| dispose(): void; | ||
| /** | ||
@@ -807,18 +1010,22 @@ * Get shader's context uniforms values | ||
| setUniforms(uniforms: any): this; | ||
| contextKeys: string; | ||
| context: any; | ||
| getVersion(regl: any, source: any): "" | "#version 300 es\n" | "#version 100\n"; | ||
| getActiveVars(regl: any, vert: any, frag: any, hash: any): any; | ||
| createREGLCommand(regl: any, materialDefines: any, elements: any, isInstanced: any, disableVAO: any, commandProps?: {}): any; | ||
| dispose(): void; | ||
| _insertDefines(source: any, defines: any): string; | ||
| _compileSource(): void; | ||
| } | ||
| //# sourceMappingURL=Shader.d.ts.map | ||
| declare class GPUShader extends GLShader { | ||
| getShaderCommandKey(device: any, mesh: any, renderProps: any): any; | ||
| createMeshCommand(device: any, mesh: Mesh$1, commandProps: any, renderProps: any): any; | ||
| _compileWGSLSource(defines: any): { | ||
| vert: any; | ||
| frag: any; | ||
| }; | ||
| run(deviceOrRegl: any, command: any, props: any): any; | ||
| _getCurrentRenderPassEncoder(device: GraphicsDevice): GPURenderPassEncoder; | ||
| setFramebuffer(framebuffer: any): this; | ||
| dispose(): void; | ||
| } | ||
| declare class MeshShader extends Shader { | ||
| draw(regl: any, meshes: any): number; | ||
| declare class MeshShader extends GPUShader { | ||
| draw(device: any, meshes: any): number; | ||
| _ensureContextDefines(v: any): void; | ||
| _runFilter(m: any): any; | ||
| getMeshCommand(regl: any, mesh: any): any; | ||
| getMeshCommand(device: any, mesh: any, renderProps: any): any; | ||
| _cmdKeys: {}; | ||
@@ -830,3 +1037,2 @@ } | ||
| constructor(config?: {}); | ||
| version: number; | ||
| } | ||
@@ -837,3 +1043,2 @@ //# sourceMappingURL=WireframeShader.d.ts.map | ||
| constructor(config?: {}); | ||
| version: number; | ||
| getGeometryDefines(geometry: any): { | ||
@@ -875,2 +1080,8 @@ HAS_TANGENT: number; | ||
| declare class ImageShader extends MeshShader { | ||
| constructor(config: any); | ||
| getMeshCommand(regl: any, mesh: any): any; | ||
| } | ||
| //# sourceMappingURL=ImageShader.d.ts.map | ||
| declare class PostProcessShader extends QuadShader { | ||
@@ -966,4 +1177,4 @@ constructor(); | ||
| _renderer: Renderer; | ||
| render(sourceTex: any, bloomTex: any, bloomThreshold: any, bloomFactor: any, bloomRadius: any, noAaSource: any, pointSource: any, enableAA: any, paintToScreen: any): REGL.Texture2D; | ||
| _combine(sourceTex: any, blurTexes: any, inputTex: any, bloomFactor: any, bloomRadius: any, noAaSource: any, pointSource: any, enableAA: any, paintToScreen: any): REGL.Texture2D; | ||
| render(sourceTex: any, bloomTex: any, bloomThreshold: any, bloomFactor: any, bloomRadius: any, noAaSource: any, pointSource: any, enableAA: any, paintToScreen: any): any; | ||
| _combine(sourceTex: any, blurTexes: any, inputTex: any, bloomFactor: any, bloomRadius: any, noAaSource: any, pointSource: any, enableAA: any, paintToScreen: any): any; | ||
| _combineUniforms: { | ||
@@ -984,6 +1195,6 @@ bloomFactor: number; | ||
| _createTextures(tex: any): void; | ||
| _combineTex: REGL.Texture2D; | ||
| _combineFBO: REGL.Framebuffer2D; | ||
| _createColorTex(curTex: any, w: any, h: any, dataType: any): REGL.Texture2D; | ||
| _createBlurFBO(tex: any): REGL.Framebuffer2D; | ||
| _combineTex: any; | ||
| _combineFBO: any; | ||
| _createColorTex(curTex: any, w: any, h: any, dataType: any): any; | ||
| _createBlurFBO(tex: any): any; | ||
| _initShaders(): void; | ||
@@ -997,3 +1208,2 @@ _blurPass: BlurPass; | ||
| constructor(); | ||
| version: number; | ||
| getMeshCommand(regl: any, mesh: any): any; | ||
@@ -1063,3 +1273,2 @@ } | ||
| constructor(); | ||
| version: number; | ||
| /** | ||
@@ -1102,3 +1311,2 @@ * @param inputRGBM 输入的cubemap是否是rgbm格式 | ||
| constructor(config?: {}); | ||
| version: number; | ||
| } | ||
@@ -1157,4 +1365,4 @@ //# sourceMappingURL=StandardLiteShader.d.ts.map | ||
| _init(): void; | ||
| _maskColorFbo: REGL.Framebuffer2D; | ||
| _maskModeFbo: REGL.Framebuffer2D; | ||
| _maskColorFbo: any; | ||
| _maskModeFbo: any; | ||
| _maskColorShader: MeshShader; | ||
@@ -1164,4 +1372,4 @@ _maskModeShader: MeshShader; | ||
| render(meshes: any, projViewMatrix: any): { | ||
| colorExtent: REGL.Framebuffer2D; | ||
| modeExtent: REGL.Framebuffer2D; | ||
| colorExtent: any; | ||
| modeExtent: any; | ||
| }; | ||
@@ -1344,3 +1552,3 @@ _resize(): void; | ||
| }; | ||
| declare function generateDFGLUT(regl: any, size: any, sampleSize: any, roughnessLevels: any): any; | ||
| declare function generateDFGLUT(device: any, size: any, sampleSize: any, roughnessLevels: any): any; | ||
| declare function supportFloat16(regl: any): any; | ||
@@ -1366,3 +1574,2 @@ | ||
| constructor(config?: {}); | ||
| version: number; | ||
| getGeometryDefines(geometry: any): { | ||
@@ -1464,2 +1671,3 @@ HAS_TANGENT: number; | ||
| constructor(defines: any); | ||
| getMeshCommand(regl: any, mesh: any): any; | ||
| } | ||
@@ -1469,4 +1677,6 @@ //# sourceMappingURL=ShadowDisplayShader.d.ts.map | ||
| declare class FBORayPicking { | ||
| constructor(renderer: any, { vert, uniforms, defines, extraCommandProps, enableStencil }: { | ||
| constructor(renderer: any, { name, vert, wgslVert, uniforms, defines, extraCommandProps, enableStencil }: { | ||
| name: any; | ||
| vert: any; | ||
| wgslVert: any; | ||
| uniforms: any; | ||
@@ -1480,3 +1690,5 @@ defines: any; | ||
| _map: any; | ||
| _name: any; | ||
| _vert: any; | ||
| _wgslVert: any; | ||
| _uniforms: any; | ||
@@ -1563,2 +1775,3 @@ _defines: any; | ||
| getPickingVert(): any; | ||
| getPickingWGSLVert(): any; | ||
| getUniformDeclares(): any; | ||
@@ -1570,3 +1783,5 @@ } | ||
| declare const WEBGL_OPTIONAL_EXTENSIONS: string[]; | ||
| declare const ERROR_NOT_IMPLEMENTED = "not implemented"; | ||
| declare const Constants_d_ERROR_NOT_IMPLEMENTED: typeof ERROR_NOT_IMPLEMENTED; | ||
| declare const Constants_d_KEY_DISPOSED: typeof KEY_DISPOSED; | ||
@@ -1576,3 +1791,3 @@ declare const Constants_d_WEBGL_EXTENSIONS: typeof WEBGL_EXTENSIONS; | ||
| declare namespace Constants_d { | ||
| export { Constants_d_KEY_DISPOSED as KEY_DISPOSED, Constants_d_WEBGL_EXTENSIONS as WEBGL_EXTENSIONS, Constants_d_WEBGL_OPTIONAL_EXTENSIONS as WEBGL_OPTIONAL_EXTENSIONS }; | ||
| export { Constants_d_ERROR_NOT_IMPLEMENTED as ERROR_NOT_IMPLEMENTED, Constants_d_KEY_DISPOSED as KEY_DISPOSED, Constants_d_WEBGL_EXTENSIONS as WEBGL_EXTENSIONS, Constants_d_WEBGL_OPTIONAL_EXTENSIONS as WEBGL_OPTIONAL_EXTENSIONS }; | ||
| } | ||
@@ -1607,2 +1822,17 @@ | ||
| /*! | ||
| * codes from GEngine | ||
| * https://github.com/GEngine-js/GEngine/blob/e9c0e2c4a28cc6b9fec133c75958b80115e53a63/src/shader/WGSLParseDefines.ts | ||
| * ISC License | ||
| */ | ||
| declare function WGSLParseDefines(shader: string, meshDefines: ShaderDefines): string; | ||
| declare function getDefineConditionValue(define: any, defines: any, usedDefines: any): any; | ||
| declare const WGSLParseDefines_d_WGSLParseDefines: typeof WGSLParseDefines; | ||
| declare const WGSLParseDefines_d_getDefineConditionValue: typeof getDefineConditionValue; | ||
| declare namespace WGSLParseDefines_d { | ||
| export { WGSLParseDefines_d_WGSLParseDefines as WGSLParseDefines, WGSLParseDefines_d_getDefineConditionValue as getDefineConditionValue }; | ||
| } | ||
| declare const HDR: { | ||
@@ -1624,2 +1854,2 @@ parseHDR: typeof parseRGBE; | ||
| export { AbstractTexture, BloomPass, BoundingBox, BoxBlurShader, Constants_d as Constants, CopyShader, EdgeGeometry, EdgeShader, ExtentPass, FBORayPicking, FogPass, FogShader, FxaaShader, GLTFHelper_d as GLTFHelper, GLTFManager, Geometry, HDR, HeatmapDisplayShader, HeatmapShader, InstancedMesh, Jitter, KHRTechniquesWebglManager, Material, Mesh$1 as Mesh, MeshShader, PhongMaterial, PhongShader, PhongSpecularGlossinessMaterial, Plane, PointLineShader, PostProcessShader, QuadShader, REGLHelper_d as REGLHelper, RainRipplePass as RainRipplesPass, Renderer, ResourceLoader, ScanEffectPass, EffectShader as ScanEffectShader, Scene, Shader, _default as ShaderLib, ShadowDisplayShader, ShadowMapShader, ShadowPass, SkyboxShader, SsrPass, StandardLiteMaterial, StandardLiteShader, Texture2D, Util_d as Util, WaterShader, WireFrameMaterial, WireframeShader, earcut, pbr }; | ||
| export { AbstractTexture, BloomPass, BoundingBox, BoxBlurShader, Constants_d as Constants, CopyShader, EdgeGeometry, EdgeShader, ExtentPass, FBORayPicking, FogPass, FogShader, FxaaShader, GLTFHelper_d as GLTFHelper, GLTFManager, Geometry, GraphicsDevice, GraphicsFramebuffer, GraphicsTexture, HDR, HeatmapDisplayShader, HeatmapShader, ImageShader, InstancedMesh, Jitter, KHRTechniquesWebglManager, Material, Mesh$1 as Mesh, MeshShader, PhongMaterial, PhongShader, PhongSpecularGlossinessMaterial, Plane, PointLineShader, PostProcessShader, QuadShader, REGLHelper_d as REGLHelper, RainRipplePass as RainRipplesPass, Renderer, ResourceLoader, ScanEffectPass, EffectShader as ScanEffectShader, Scene, GPUShader as Shader, _default$1 as ShaderLib, ShadowDisplayShader, ShadowMapShader, ShadowPass, SkyboxShader, SsrPass, StandardLiteMaterial, StandardLiteShader, Texture2D, Util_d as Util, WGSLParseDefines_d as WGSLParseDefines, WaterShader, WebGLConstants_d as WebGLConstants, _default as WgslShaderLib, WireFrameMaterial, WireframeShader, earcut, pbr }; |
+11
-5
| { | ||
| "name": "@maptalks/reshader.gl", | ||
| "version": "0.107.4", | ||
| "version": "0.108.0", | ||
| "description": "A shader centric WebGL engine based on regl", | ||
@@ -18,6 +18,8 @@ "module": "dist/reshadergl.es.js", | ||
| "dependencies": { | ||
| "@maptalks/regl": "^3.4.0", | ||
| "@maptalks/regl": "^3.6.0", | ||
| "@maptalks/tbn-packer": "^1.4.5", | ||
| "@webgpu/types": "0.1.52", | ||
| "earcut": "^3.0.1", | ||
| "gl-matrix": "^3.4.0" | ||
| "gl-matrix": "^3.4.0", | ||
| "wgsl_reflect": "^1.0.16" | ||
| }, | ||
@@ -29,7 +31,11 @@ "devDependencies": { | ||
| "@rollup/plugin-terser": "0.4.4", | ||
| "@rollup/plugin-typescript": "^11.1.6", | ||
| "eslint": "^8.57.0", | ||
| "eslint-plugin-mocha": "^10.4.1", | ||
| "eslint-plugin-mocha": "^10.5.0", | ||
| "mocha": "^10.3.0", | ||
| "rollup": "^4.17.2", | ||
| "rollup-plugin-dts": "^6.1.0" | ||
| "rollup-plugin-dts": "^6.1.0", | ||
| "tslib": "^2.6.2", | ||
| "typescript": "^5.4.2", | ||
| "typescript-eslint": "^8.34.0" | ||
| }, | ||
@@ -36,0 +42,0 @@ "gitHead": "9eeea4807723d460fa7e09969c6556d53f6bed84", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Explicitly Unlicensed Item
LicenseSomething was found which is explicitly marked as unlicensed.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
2098430
141.62%15829
119.91%6
50%13
44.44%3
50%51
34.21%+ Added
+ Added
+ Added
+ Added
Updated