123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- import {
- BufferGeometry,
- Color,
- Clock,
- DataTexture,
- Mesh,
- OrthographicCamera,
- PlaneBufferGeometry,
- Scene,
- ShaderMaterial,
- Texture,
- Uniform,
- WebGLRenderer,
- WebGLRenderTarget
- } from '../../../src/Three';
- export interface FireOptions {
- textureWidth?: number;
- textureHeight?: number;
- debug?: boolean;
- color1?: Color;
- color2?: Color;
- color3?: Color;
- colorBias?: number;
- diffuse?: number;
- viscosity?: number;
- expansion?: number;
- swirl?: number;
- burnRate?: number;
- drag?: number;
- airSpeed?: number;
- windVector?: number;
- speed?: number;
- massConservation?: boolean;
- }
- export class Fire extends Mesh {
- constructor( geometry: BufferGeometry, options: FireOptions );
- clock: Clock;
- color1: Color;
- color2: Color;
- color3: Color;
- colorBias: number;
- diffuse: number;
- viscosity: number;
- expansion: number;
- swirl: number;
- burnRate: number;
- drag: number;
- airSpeed: number;
- windVector: number;
- speed: number;
- massConservation: boolean;
- sourceData: Uint8Array;
- field0: WebGLRenderTarget;
- field1: WebGLRenderTarget;
- fieldProj: WebGLRenderTarget;
- fieldScene: Scene;
- orthoCamera: OrthographicCamera;
- fieldGeometry: PlaneBufferGeometry;
- internalSource: DataTexture;
- sourceMaterial: ShaderMaterial;
- sourceMesh: Mesh;
- diffuseMaterial: ShaderMaterial;
- driftMaterial: ShaderMaterial;
- projMaterial1: ShaderMaterial;
- projMaterial2: ShaderMaterial;
- projMaterial3: ShaderMaterial;
- material: ShaderMaterial;
- addSource( u: number, v: number, radius: number, density?: number, windX?: number, windY?: number ): Uint8Array;
- clearDiffuse(): void;
- clearSources(): Uint8Array;
- configShaders( dt: number ): void;
- renderDiffuse( renderer: WebGLRenderer ): void;
- renderDrift( renderer: WebGLRenderer ): void;
- renderProject( renderer: WebGLRenderer ): void;
- renderSource( renderer: WebGLRenderer ): void;
- restoreRenderState( renderer: WebGLRenderer ): void;
- saveRenderState( renderer: WebGLRenderer ): void;
- setSourceMap( texture: Texture ): void;
- swapTextures(): void;
- static SourceShader: SourceShader;
- static DiffuseShader: DiffuseShader;
- static DriftShader: DriftShader;
- static ProjectionShader1: ProjectionShader1;
- static ProjectionShader2: ProjectionShader2;
- static ProjectionShader3: ProjectionShader3;
- static ColorShader: ColorShader;
- static DebugShader: DebugShader;
- }
- declare interface SourceShader {
- uniforms: {
- sourceMap: Uniform;
- densityMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
- declare interface DiffuseShader {
- uniforms: {
- oneOverWidth: Uniform;
- oneOverHeight: Uniform;
- diffuse: Uniform;
- viscosity: Uniform;
- expansion: Uniform;
- swirl: Uniform;
- drag: Uniform;
- burnRate: Uniform;
- densityMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
- declare interface DriftShader {
- uniforms: {
- oneOverWidth: Uniform;
- oneOverHeight: Uniform;
- windVector: Uniform;
- airSpeed: Uniform;
- densityMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
- declare interface ProjectionShader1 {
- uniforms: {
- oneOverWidth: Uniform;
- oneOverHeight: Uniform;
- densityMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
- declare interface ProjectionShader2 {
- uniforms: {
- oneOverWidth: Uniform;
- oneOverHeight: Uniform;
- densityMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
- declare interface ProjectionShader3 {
- uniforms: {
- oneOverWidth: Uniform;
- oneOverHeight: Uniform;
- densityMap: Uniform;
- projMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
- declare interface ColorShader {
- uniforms: {
- color1: Uniform;
- color2: Uniform;
- color3: Uniform;
- colorBias: Uniform;
- densityMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
- declare interface DebugShader {
- uniforms: {
- color1: Uniform;
- color2: Uniform;
- color3: Uniform;
- colorBias: Uniform;
- densityMap: Uniform;
- };
- vertexShader: string;
- fragmentShader: string;
- }
|