@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
45 lines • 1.9 kB
JavaScript
import { PostProcess } from "./postProcess.js";
import { RegisterClass } from "../Misc/typeStore.js";
import { ThinAnaglyphPostProcess } from "./thinAnaglyphPostProcess.js";
/**
* Postprocess used to generate anaglyphic rendering
*/
export class AnaglyphPostProcess extends PostProcess {
/**
* Gets a string identifying the name of the class
* @returns "AnaglyphPostProcess" string
*/
getClassName() {
return "AnaglyphPostProcess";
}
/**
* Creates a new AnaglyphPostProcess
* @param name defines postprocess name
* @param options defines creation options or target ratio scale
* @param rigCameras defines cameras using this postprocess
* @param samplingMode defines required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)
* @param engine defines hosting engine
* @param reusable defines if the postprocess will be reused multiple times per frame
*/
constructor(name, options, rigCameras, samplingMode, engine, reusable) {
const localOptions = {
samplers: ThinAnaglyphPostProcess.Samplers,
size: typeof options === "number" ? options : undefined,
camera: rigCameras[1],
samplingMode,
engine,
reusable,
...options,
};
super(name, ThinAnaglyphPostProcess.FragmentUrl, {
effectWrapper: typeof options === "number" || !options.effectWrapper ? new ThinAnaglyphPostProcess(name, engine, localOptions) : undefined,
...localOptions,
});
this._passedProcess = rigCameras[0]._rigPostProcess;
this.onApplyObservable.add((effect) => {
effect.setTextureFromPostProcess("leftSampler", this._passedProcess);
});
}
}
RegisterClass("BABYLON.AnaglyphPostProcess", AnaglyphPostProcess);
//# sourceMappingURL=anaglyphPostProcess.js.map