babylon.stereogramInterlacePostProcess.ts 927 B

12345678910111213141516171819
  1. module BABYLON {
  2. export class StereogramInterlacePostProcess extends PostProcess {
  3. private _stepSize : Vector2;
  4. constructor(name: string, camB: Camera, postProcessA : PostProcess, isStereogramHoriz: boolean, samplingMode?: number) {
  5. super(name, "stereogramInterlace", ['stepSize'], ['camASampler'], 1, camB, samplingMode, camB.getScene().getEngine(), false, isStereogramHoriz ? "#define IS_STEREOGRAM_HORIZ 1" : undefined);
  6. this._stepSize = new Vector2(1 / this.width, 1 / this.height);
  7. this.onSizeChanged = () => {
  8. this._stepSize = new Vector2(1 / this.width, 1 / this.height);
  9. };
  10. this.onApply = (effect: Effect) => {
  11. effect.setTextureFromPostProcess("camASampler", postProcessA);
  12. effect.setFloat2("stepSize", this._stepSize.x, this._stepSize.y);
  13. };
  14. }
  15. }
  16. }