@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
44 lines (39 loc) • 1.67 kB
text/typescript
import type { EffectComposer } from "postprocessing";
import type { ToneMapping } from "three";
import type { EffectComposer as ThreeEffectComposer } from "three/examples/jsm/postprocessing/EffectComposer.js";
/**
* Minimal interface for a postprocessing effect as seen by the core stack.
* Implemented by `PostProcessingEffect` in engine-components.
*/
export interface IPostProcessingEffect {
readonly active: boolean;
readonly enabled: boolean;
/** When true, this effect is a tonemapping effect. The core stack uses this to detect tonemapping-only scenarios. */
readonly isToneMapping?: boolean;
}
/**
* Extended interface for tonemapping effects.
* When ONLY tonemapping effects are in the stack, the core applies tonemapping
* directly to the renderer instead of creating a full postprocessing pipeline.
*/
export interface ITonemappingEffect extends IPostProcessingEffect {
readonly isToneMapping: true;
/** The three.js ToneMapping enum value to apply to the renderer */
readonly threeToneMapping: ToneMapping;
/** The exposure value to apply to the renderer */
readonly toneMappingExposure: number;
}
/**
* Interface for the pipeline builder that manages the EffectComposer.
* Implemented by `PostProcessingHandler` in engine-components.
*/
export interface IPostProcessingHandler {
readonly composer: EffectComposer | ThreeEffectComposer | null;
readonly hasSmaaEffect: boolean;
multisampling: number;
adaptivePixelRatio: boolean;
apply(effects: IPostProcessingEffect[]): Promise<void>;
unapply(dispose?: boolean): void;
updateAdaptivePixelRatio(): void;
dispose(): void;
}