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