GPUComputationRenderer.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import {
  2. WebGLRenderer,
  3. RenderTarget,
  4. Texture,
  5. DataTexture,
  6. Material,
  7. ShaderMaterial,
  8. Wrapping,
  9. TextureFilter
  10. } from '../../../src/Three';
  11. export interface Variable {
  12. name: string;
  13. initialValueTexture: Texture;
  14. material: Material;
  15. dependencies: Variable[];
  16. renderTargets: RenderTarget[];
  17. wrapS: number;
  18. wrapT: number;
  19. minFilter: number;
  20. magFilter: number;
  21. }
  22. export class GPUComputationRenderer {
  23. constructor( sizeX: number, sizeY: number, renderer: WebGLRenderer );
  24. addVariable( variableName: string, computeFragmentShader: string, initialValueTexture: Texture ): Variable;
  25. setVariableDependencies( variable: Variable, dependencies: Variable[] | null ): void;
  26. init(): string | null;
  27. compute(): void;
  28. getCurrentRenderTarget( variable: Variable ): RenderTarget;
  29. getAlternateRenderTarget( variable: Variable ): RenderTarget;
  30. addResolutionDefine( materialShader: ShaderMaterial ): void;
  31. createRenderTarget( sizeXTexture: number, sizeYTexture: number, wrapS: Wrapping, wrapT: number, minFilter: TextureFilter, magFilter: TextureFilter ): RenderTarget;
  32. createTexture(): DataTexture;
  33. renderTexture( input: Texture, output: Texture ): void;
  34. doRenderTarget( material: Material, output: RenderTarget ): void;
  35. }