|
| 1 | +import { |
| 2 | + BufferGeometry, |
| 3 | + Object3D, |
| 4 | + ShaderMaterial, |
| 5 | + Texture, |
| 6 | +} from '../../../src/Three'; |
| 7 | + |
| 8 | + |
| 9 | +export interface GPUParticleSystemOptions { |
| 10 | + maxParticles?: number; |
| 11 | + containerCount?: number; |
| 12 | + particleNoiseTex?: Texture; |
| 13 | + particleSpriteTex?: Texture; |
| 14 | +} |
| 15 | + |
| 16 | +export class GPUParticleSystem extends Object3D { |
| 17 | + constructor( options: GPUParticleSystemOptions ); |
| 18 | + |
| 19 | + PARTICLE_COUNT: number; |
| 20 | + PARTICLE_CONTAINERS: number; |
| 21 | + |
| 22 | + PARTICLE_NOISE_TEXTURE: Texture; |
| 23 | + PARTICLE_SPRITE_TEXTURE: Texture; |
| 24 | + |
| 25 | + PARTICLES_PER_CONTAINER: number; |
| 26 | + PARTICLE_CURSOR: number; |
| 27 | + time: number; |
| 28 | + particleContainers: number[]; |
| 29 | + rand: number[]; |
| 30 | + |
| 31 | + particleNoiseTex: Texture; |
| 32 | + particleSpriteTex: Texture; |
| 33 | + |
| 34 | + particleShaderMat: ShaderMaterial; |
| 35 | + |
| 36 | + random(): number; |
| 37 | + init(): void; |
| 38 | + spawnParticle( option: object ): void; |
| 39 | + update( time: number ): void; |
| 40 | + dispose(): void; |
| 41 | + |
| 42 | +} |
| 43 | + |
| 44 | +export class GPUParticleContainer extends Object3D { |
| 45 | + constructor( maxParticles: number, particleSystem: GPUParticleSystem ); |
| 46 | + |
| 47 | + PARTICLE_COUNT: number; |
| 48 | + PARTICLE_CURSOR: number; |
| 49 | + time: number; |
| 50 | + offset: number; |
| 51 | + count: number; |
| 52 | + DPR: number; |
| 53 | + GPUParticleSystem: GPUParticleSystem; |
| 54 | + particleUpdate: number; |
| 55 | + |
| 56 | + particleShaderGeo: BufferGeometry; |
| 57 | + |
| 58 | + particleShaderMat: ShaderMaterial; |
| 59 | + |
| 60 | + init(): void; |
| 61 | + spawnParticle( option: object ): void; |
| 62 | + update( time: number ): void; |
| 63 | + dispose(): void; |
| 64 | + |
| 65 | +} |
0 commit comments