threepipe
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import {IDisposable, ValOrFunc} from 'ts-browser-helpers'
  2. import {IUniform} from 'three'
  3. import {Pass} from 'three/examples/jsm/postprocessing/Pass.js'
  4. import {MaterialExtension} from '../materials'
  5. import {ICamera, IRenderManager, IScene} from '../core'
  6. export type IPassID = 'render' | 'screen' | string
  7. export interface IPass<Tid extends IPassID = IPassID> extends Pass, IDisposable {
  8. uniforms?: {[name: string]: IUniform}
  9. // todo?
  10. // updateShaderProperties?: (updater?: (IShaderPropertiesUpdater|undefined) | (IShaderPropertiesUpdater|undefined)[])=>void
  11. materialExtension?: MaterialExtension
  12. /**
  13. * Checked by {@link RenderManager} to determine whether to render this frame. A frame is rendered if any pass is dirty.
  14. * This can be set by the plugin/pass to indicate when to continue rendering. See {@link ProgressivePlugin}.
  15. * This is different from {@link setDirty} which is implementation specific to the pass/plugin. It generally calls onDirty and set the viewer dirty.
  16. */
  17. dirty?: ValOrFunc<boolean> // isDirty (optional)
  18. /**
  19. * Set the pass as dirty. This is implementation specific to the pass/plugin. It generally calls all {@link onDirty} and set the viewer dirty.
  20. */
  21. setDirty?(): void
  22. onDirty?: (()=>void)[];
  23. /**
  24. * Unique id for the pass. Used to determine the order of passes in the pipeline.
  25. */
  26. passId?: Tid;
  27. }
  28. export interface IPipelinePass<Tid extends IPassID = IPassID> extends IPass<Tid> {
  29. readonly passId: Tid
  30. after?: IPassID[]
  31. before?: IPassID[]
  32. required?: IPassID[]
  33. beforeRender?(scene: IScene, camera: ICamera, renderManager: IRenderManager): void;
  34. onRegister?(renderer: IRenderManager): void;
  35. onUnregister?(renderer: IRenderManager): void;
  36. onPostFrame?(renderManager: IRenderManager): void;
  37. }