PassState.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * The state for a particular rendering pass. This is used to supplement the state
  3. * in a command being executed.
  4. *
  5. * @private
  6. */
  7. function PassState(context) {
  8. /**
  9. * The context used to execute commands for this pass.
  10. *
  11. * @type {Context}
  12. */
  13. this.context = context;
  14. /**
  15. * The framebuffer to render to. This framebuffer is used unless a {@link DrawCommand}
  16. * or {@link ClearCommand} explicitly define a framebuffer, which is used for off-screen
  17. * rendering.
  18. *
  19. * @type {Framebuffer}
  20. * @default undefined
  21. */
  22. this.framebuffer = undefined;
  23. /**
  24. * When defined, this overrides the blending property of a {@link DrawCommand}'s render state.
  25. * This is used to, for example, to allow the renderer to turn off blending during the picking pass.
  26. * <p>
  27. * When this is <code>undefined</code>, the {@link DrawCommand}'s property is used.
  28. * </p>
  29. *
  30. * @type {Boolean}
  31. * @default undefined
  32. */
  33. this.blendingEnabled = undefined;
  34. /**
  35. * When defined, this overrides the scissor test property of a {@link DrawCommand}'s render state.
  36. * This is used to, for example, to allow the renderer to scissor out the pick region during the picking pass.
  37. * <p>
  38. * When this is <code>undefined</code>, the {@link DrawCommand}'s property is used.
  39. * </p>
  40. *
  41. * @type {Object}
  42. * @default undefined
  43. */
  44. this.scissorTest = undefined;
  45. /**
  46. * The viewport used when one is not defined by a {@link DrawCommand}'s render state.
  47. * @type {BoundingRectangle}
  48. * @default undefined
  49. */
  50. this.viewport = undefined;
  51. }
  52. export default PassState;