PassState.js 1.7 KB

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