@fjandin/react-shader 0.0.20 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -213
- package/dist/example/frontend.d.ts.map +1 -1
- package/dist/hooks/useWebGPU.d.ts.map +1 -1
- package/dist/index.cjs +24 -1007
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -1007
- package/dist/types.d.ts +0 -28
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/ReactShader.d.ts +0 -3
- package/dist/ReactShader.d.ts.map +0 -1
- package/dist/example/examples/webgl.d.ts +0 -2
- package/dist/example/examples/webgl.d.ts.map +0 -1
- package/dist/hooks/useWebGL.d.ts +0 -20
- package/dist/hooks/useWebGL.d.ts.map +0 -1
- package/dist/shaders/color-palette.d.ts +0 -2
- package/dist/shaders/color-palette.d.ts.map +0 -1
- package/dist/shaders/distortion-ripple.d.ts +0 -16
- package/dist/shaders/distortion-ripple.d.ts.map +0 -1
- package/dist/shaders/scene-circles.d.ts +0 -21
- package/dist/shaders/scene-circles.d.ts.map +0 -1
- package/dist/shaders/simplex-noise.d.ts +0 -2
- package/dist/shaders/simplex-noise.d.ts.map +0 -1
- package/dist/shaders/utils.d.ts +0 -2
- package/dist/shaders/utils.d.ts.map +0 -1
- package/dist/utils/shader.d.ts +0 -6
- package/dist/utils/shader.d.ts.map +0 -1
- package/dist/utils/textures.d.ts +0 -23
- package/dist/utils/textures.d.ts.map +0 -1
- package/dist/utils/uniforms.d.ts +0 -12
- package/dist/utils/uniforms.d.ts.map +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
export type Vec2 = [number, number];
|
|
2
2
|
export type Vec3 = [number, number, number];
|
|
3
3
|
export type Vec4 = [number, number, number, number];
|
|
4
|
-
export type FloatArray = number[];
|
|
5
4
|
export type Vec2Array = Vec2[];
|
|
6
5
|
export type Vec3Array = Vec3[];
|
|
7
6
|
export type Vec4Array = Vec4[];
|
|
8
7
|
export type GpuUniformValue = number | Vec2 | Vec3 | Vec4;
|
|
9
8
|
export type GpuStorageBuffers = Record<string, Vec4Array>;
|
|
10
|
-
export type TextureSource = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ImageData | OffscreenCanvas;
|
|
11
|
-
export type TextureWrap = "repeat" | "clamp" | "mirror";
|
|
12
|
-
export type TextureMinFilter = "nearest" | "linear" | "mipmap";
|
|
13
|
-
export type TextureMagFilter = "nearest" | "linear";
|
|
14
|
-
export interface TextureOptions {
|
|
15
|
-
source: TextureSource;
|
|
16
|
-
wrapS?: TextureWrap;
|
|
17
|
-
wrapT?: TextureWrap;
|
|
18
|
-
minFilter?: TextureMinFilter;
|
|
19
|
-
magFilter?: TextureMagFilter;
|
|
20
|
-
flipY?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export type UniformValue = number | Vec2 | Vec3 | Vec4 | FloatArray | Vec2Array | Vec3Array | Vec4Array | TextureSource | TextureOptions;
|
|
23
9
|
export interface FrameInfo {
|
|
24
10
|
deltaTime: number;
|
|
25
11
|
time: number;
|
|
@@ -28,20 +14,6 @@ export interface FrameInfo {
|
|
|
28
14
|
mouseNormalized: [number, number];
|
|
29
15
|
mouseLeftDown: boolean;
|
|
30
16
|
}
|
|
31
|
-
export interface ReactShaderProps {
|
|
32
|
-
className?: string;
|
|
33
|
-
fragment: string;
|
|
34
|
-
vertex?: string;
|
|
35
|
-
uniforms?: Record<string, UniformValue>;
|
|
36
|
-
fullscreen?: boolean;
|
|
37
|
-
timeScale?: number;
|
|
38
|
-
onFrame?: (info: FrameInfo) => void;
|
|
39
|
-
onClick?: (info: FrameInfo) => void;
|
|
40
|
-
onMouseMove?: (info: FrameInfo) => void;
|
|
41
|
-
onMouseDown?: (info: FrameInfo) => void;
|
|
42
|
-
onMouseUp?: (info: FrameInfo) => void;
|
|
43
|
-
onMouseWheel?: (info: FrameInfo, wheelDelta: number) => void;
|
|
44
|
-
}
|
|
45
17
|
export interface DefaultUniforms {
|
|
46
18
|
iTime: number;
|
|
47
19
|
iMouse: Vec2;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACnC,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAEnD,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACnC,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAEnD,MAAM,MAAM,SAAS,GAAG,IAAI,EAAE,CAAA;AAC9B,MAAM,MAAM,SAAS,GAAG,IAAI,EAAE,CAAA;AAC9B,MAAM,MAAM,SAAS,GAAG,IAAI,EAAE,CAAA;AAG9B,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAGzD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEzD,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,IAAI,CAAA;IACZ,gBAAgB,EAAE,IAAI,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,IAAI,CAAA;CAClB;AAGD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAA;AAClE,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAA;AAExF,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,YAAY,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,IAAI,CAAA;IACzD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;QACvB,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACrB,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACrB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACvB,CAAC,CAAA;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,CAAA;IACnB,aAAa,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;IAC7C,KAAK,EAAE,oBAAoB,CAAA;IAC3B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjandin/react-shader",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "React component for rendering
|
|
3
|
+
"version": "0.0.30",
|
|
4
|
+
"description": "React component for rendering WebGPU shaders with WGSL",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"keywords": [
|
|
10
10
|
"react",
|
|
11
11
|
"shader",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"webgpu",
|
|
13
|
+
"wgsl",
|
|
14
14
|
"graphics"
|
|
15
15
|
],
|
|
16
16
|
"author": "fjandin",
|
package/dist/ReactShader.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ReactShaderProps } from "./types";
|
|
2
|
-
export declare function ReactShader({ className, fragment, vertex, uniforms, fullscreen, timeScale, onFrame, onClick, onMouseMove, onMouseDown, onMouseUp, onMouseWheel, }: ReactShaderProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
//# sourceMappingURL=ReactShader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactShader.d.ts","sourceRoot":"","sources":["../src/ReactShader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAiC/C,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,QAAQ,EACR,MAAuB,EACvB,QAAQ,EACR,UAAkB,EAClB,SAAa,EACb,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,GACb,EAAE,gBAAgB,2CA0DlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../../../src/example/examples/webgl.tsx"],"names":[],"mappings":"AAiDA,wBAAgB,SAAS,4CA6BxB"}
|
package/dist/hooks/useWebGL.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { FrameInfo, UniformValue } from "../types";
|
|
2
|
-
interface UseWebGLOptions {
|
|
3
|
-
fragment: string;
|
|
4
|
-
vertex: string;
|
|
5
|
-
uniforms?: Record<string, UniformValue>;
|
|
6
|
-
onError?: (error: Error) => void;
|
|
7
|
-
onFrame?: (info: FrameInfo) => void;
|
|
8
|
-
onClick?: (info: FrameInfo) => void;
|
|
9
|
-
onMouseDown?: (info: FrameInfo) => void;
|
|
10
|
-
onMouseUp?: (info: FrameInfo) => void;
|
|
11
|
-
onMouseMove?: (info: FrameInfo) => void;
|
|
12
|
-
onMouseWheel?: (info: FrameInfo, wheelDelta: number) => void;
|
|
13
|
-
timeScale?: number;
|
|
14
|
-
}
|
|
15
|
-
export declare function useWebGL(options: UseWebGLOptions): {
|
|
16
|
-
canvasRef: import("react").RefObject<HTMLCanvasElement>;
|
|
17
|
-
mouseRef: import("react").MutableRefObject<[number, number]>;
|
|
18
|
-
};
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=useWebGL.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useWebGL.d.ts","sourceRoot":"","sources":["../../src/hooks/useWebGL.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAKvD,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACvC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACnC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACnC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACvC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACrC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAwED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe;;;EA0ShD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-palette.d.ts","sourceRoot":"","sources":["../../src/shaders/color-palette.ts"],"names":[],"mappings":"AAQA,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAgB/E"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @returns glsl function for distortion ripple
|
|
4
|
-
*
|
|
5
|
-
* vec2 uv: uv coordinates
|
|
6
|
-
*
|
|
7
|
-
* vec2 center: center of the ripple
|
|
8
|
-
*
|
|
9
|
-
* float radius: radius of the ripple
|
|
10
|
-
*
|
|
11
|
-
* float intensity: intensity of the ripple
|
|
12
|
-
*
|
|
13
|
-
* float thickness: thickness of the ripple
|
|
14
|
-
*/
|
|
15
|
-
export declare function generateDistortionRippleFunction(): string;
|
|
16
|
-
//# sourceMappingURL=distortion-ripple.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"distortion-ripple.d.ts","sourceRoot":"","sources":["../../src/shaders/distortion-ripple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,WAqB/C"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param paletteString
|
|
4
|
-
* @returns glsl function for rendering circles
|
|
5
|
-
*
|
|
6
|
-
* vec2 uv0: uv coordinates
|
|
7
|
-
*
|
|
8
|
-
* float iterations: number of iterations
|
|
9
|
-
*
|
|
10
|
-
* float fractMultiplier: fract multiplier
|
|
11
|
-
*
|
|
12
|
-
* float time: time
|
|
13
|
-
*
|
|
14
|
-
* float waveLength: wave length
|
|
15
|
-
*
|
|
16
|
-
* float edgeBlur: edge blur
|
|
17
|
-
*
|
|
18
|
-
* float contrast: contrast
|
|
19
|
-
*/
|
|
20
|
-
export declare function generateSceneCirclesFunction(paletteString?: string): string;
|
|
21
|
-
//# sourceMappingURL=scene-circles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scene-circles.d.ts","sourceRoot":"","sources":["../../src/shaders/scene-circles.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,SAAoE,UAiClF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simplex-noise.d.ts","sourceRoot":"","sources":["../../src/shaders/simplex-noise.ts"],"names":[],"mappings":"AAWA,wBAAgB,4BAA4B,WAsL3C"}
|
package/dist/shaders/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/shaders/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,WAUpC"}
|
package/dist/utils/shader.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;
|
|
2
|
-
export declare function compileShader(gl: WebGLContext, type: number, source: string): WebGLShader;
|
|
3
|
-
export declare function createProgram(gl: WebGLContext, vertexShader: WebGLShader, fragmentShader: WebGLShader): WebGLProgram;
|
|
4
|
-
export declare function createShaderProgram(gl: WebGLContext, vertexSource: string, fragmentSource: string): WebGLProgram;
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=shader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shader.d.ts","sourceRoot":"","sources":["../../src/utils/shader.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,qBAAqB,GAAG,sBAAsB,CAAA;AAElE,wBAAgB,aAAa,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAiBzF;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,GAAG,YAAY,CAiBpH;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,YAAY,CAWhH"}
|
package/dist/utils/textures.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { TextureOptions, TextureSource } from "../types";
|
|
2
|
-
type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;
|
|
3
|
-
interface TextureEntry {
|
|
4
|
-
texture: WebGLTexture;
|
|
5
|
-
unit: number;
|
|
6
|
-
source: TextureSource;
|
|
7
|
-
}
|
|
8
|
-
export interface TextureManager {
|
|
9
|
-
cache: Map<string, TextureEntry>;
|
|
10
|
-
nextUnit: number;
|
|
11
|
-
maxUnits: number;
|
|
12
|
-
}
|
|
13
|
-
export declare function isTextureSource(value: unknown): value is TextureSource;
|
|
14
|
-
export declare function isTextureOptions(value: unknown): value is TextureOptions;
|
|
15
|
-
export declare function isTexture(value: unknown): value is TextureSource | TextureOptions;
|
|
16
|
-
export declare function createTextureManager(gl: WebGLContext): TextureManager;
|
|
17
|
-
export declare function createTexture(gl: WebGLContext, source: TextureSource, options?: Partial<TextureOptions>): WebGLTexture;
|
|
18
|
-
export declare function updateTexture(gl: WebGLContext, texture: WebGLTexture, source: TextureSource, flipY?: boolean): void;
|
|
19
|
-
export declare function needsVideoUpdate(source: TextureSource): boolean;
|
|
20
|
-
export declare function bindTextureUniform(gl: WebGLContext, program: WebGLProgram, name: string, value: TextureSource | TextureOptions, manager: TextureManager, locationCache: Map<string, WebGLUniformLocation | null>): void;
|
|
21
|
-
export declare function cleanupTextures(gl: WebGLContext, manager: TextureManager): void;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=textures.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textures.d.ts","sourceRoot":"","sources":["../../src/utils/textures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsC,cAAc,EAAE,aAAa,EAAe,MAAM,UAAU,CAAA;AAE9G,KAAK,YAAY,GAAG,qBAAqB,GAAG,sBAAsB,CAAA;AAElE,UAAU,YAAY;IACpB,OAAO,EAAE,YAAY,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,aAAa,CAAA;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAUtE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAOxE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,GAAG,cAAc,CAEjF;AAmDD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,GAAG,cAAc,CAOrE;AAED,wBAAgB,aAAa,CAC3B,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,OAAO,CAAC,cAAc,CAAM,GACpC,YAAY,CAqCd;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,UAAO,GAAG,IAAI,CAKhH;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAG/D;AAED,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,YAAY,EAChB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,GAAG,cAAc,EACrC,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC,GACtD,IAAI,CA+CN;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAM/E"}
|
package/dist/utils/uniforms.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { UniformValue } from "../types";
|
|
2
|
-
import { type TextureManager } from "./textures";
|
|
3
|
-
type WebGLContext = WebGLRenderingContext | WebGL2RenderingContext;
|
|
4
|
-
export declare const MAX_ARRAY_LENGTH = 100;
|
|
5
|
-
export declare function setUniform(gl: WebGLContext, location: WebGLUniformLocation | null, value: UniformValue): void;
|
|
6
|
-
export declare function getUniformLocation(gl: WebGLContext, program: WebGLProgram, name: string): WebGLUniformLocation | null;
|
|
7
|
-
export declare function setUniforms(gl: WebGLContext, program: WebGLProgram, uniforms: Record<string, UniformValue>, locationCache: Map<string, WebGLUniformLocation | null>, textureManager?: TextureManager): void;
|
|
8
|
-
export declare function createUniformLocationCache(): Map<string, WebGLUniformLocation | null>;
|
|
9
|
-
export declare function generateUniformDeclarations(uniforms: Record<string, UniformValue>): string;
|
|
10
|
-
export declare function injectUniformDeclarations(shaderSource: string, customUniforms: Record<string, UniformValue> | undefined, defaultUniforms: Record<string, UniformValue>): string;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=uniforms.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uniforms.d.ts","sourceRoot":"","sources":["../../src/utils/uniforms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,YAAY,EAAqD,MAAM,UAAU,CAAA;AAC3G,OAAO,EAAiC,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA;AAE/E,KAAK,YAAY,GAAG,qBAAqB,GAAG,sBAAsB,CAAA;AAElE,eAAO,MAAM,gBAAgB,MAAM,CAAA;AAkCnC,wBAAgB,UAAU,CAAC,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,oBAAoB,GAAG,IAAI,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAsB7G;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAErH;AAED,wBAAgB,WAAW,CACzB,EAAE,EAAE,YAAY,EAChB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EACtC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC,EACvD,cAAc,CAAC,EAAE,cAAc,GAC9B,IAAI,CA8BN;AAED,wBAAgB,0BAA0B,IAAI,GAAG,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC,CAErF;AAiCD,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,CAa1F;AAID,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,SAAS,EACxD,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAC5C,MAAM,CAQR"}
|