macaw-threejs
Version:
Macaw Three.js is ready to use library to connect Three.js with your project.<br/> Under the hood is a fully optimized, clean Three.js set up to make it easy to implement effects for images (future text, etc.). With effects out of the box, you don't even
50 lines (49 loc) • 1.6 kB
TypeScript
import { SCENE_TYPE } from "../constants";
import type { MacawImage } from "../Image";
import type { MacawCore } from "../Core";
export declare abstract class Effect {
core?: MacawCore;
isUsingShaderPass?: boolean;
settings?: Record<string, unknown>;
type?: Set<SCENE_TYPE>;
imageFragmentString?: FragmentString;
imageVertexString?: VertexString;
imageUniforms?: Uniform;
setImageUniforms?(img: MacawImage): void | unknown;
composerFragmentString?: FragmentString;
composerVertexString?: VertexString;
composerUniforms?: Uniform;
setComposerUniforms?(): void | unknown;
setSettings?(...args: unknown[]): void | unknown;
render?(): void | unknown;
manualRender?(): void | unknown;
add?(): void | unknown;
scroll?(): void | unknown;
click?(imageId: string, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void | unknown;
resize?(): void | unknown;
}
export declare type Uniform = Record<string, {
value: unknown;
}>;
export declare type FragmentStringKeys = [
"utils",
"struct",
"uniforms",
"varying",
"const",
"functions",
"beforeGl_FragColor",
"afterGl_FragColor"
];
export declare type VertexStringKeys = [
"utils",
"struct",
"uniforms",
"varying",
"const",
"functions",
"beforeGl_Position",
"afterGl_Position"
];
export declare type FragmentString = Partial<Record<FragmentStringKeys[number], string>>;
export declare type VertexString = Partial<Record<VertexStringKeys[number], string>>;