|
@@ -1,5 +1,5 @@
|
|
|
module BABYLON {
|
|
|
- export type PostProcessRatio = number | { width: number, height: number };
|
|
|
+ export type PostProcessOptions = { width: number, height: number };
|
|
|
|
|
|
export class PostProcess
|
|
|
{
|
|
@@ -17,7 +17,7 @@
|
|
|
private _camera: Camera;
|
|
|
private _scene: Scene;
|
|
|
private _engine: Engine;
|
|
|
- private _renderRatio: PostProcessRatio;
|
|
|
+ private _renderRatio: number | PostProcessOptions;
|
|
|
private _reusable = false;
|
|
|
private _textureType: number;
|
|
|
public _textures = new SmartArray<WebGLTexture>(2);
|
|
@@ -100,7 +100,7 @@
|
|
|
this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);
|
|
|
}
|
|
|
|
|
|
- constructor(public name: string, fragmentUrl: string, parameters: string[], samplers: string[], ratio: PostProcessRatio, camera: Camera, samplingMode: number = Texture.NEAREST_SAMPLINGMODE, engine?: Engine, reusable?: boolean, defines?: string, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
|
|
|
+ constructor(public name: string, fragmentUrl: string, parameters: string[], samplers: string[], ratio: number | PostProcessOptions, camera: Camera, samplingMode: number = Texture.NEAREST_SAMPLINGMODE, engine?: Engine, reusable?: boolean, defines?: string, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
|
|
|
if (camera != null) {
|
|
|
this._camera = camera;
|
|
|
this._scene = camera.getScene();
|
|
@@ -152,15 +152,15 @@
|
|
|
var requiredWidth = ((sourceTexture ? sourceTexture._width : this._engine.getRenderingCanvas().width) * <number>this._renderRatio) | 0;
|
|
|
var requiredHeight = ((sourceTexture ? sourceTexture._height : this._engine.getRenderingCanvas().height) * <number>this._renderRatio) | 0;
|
|
|
|
|
|
- var desiredWidth = (<any>this._renderRatio).width || requiredWidth;
|
|
|
- var desiredHeight = (<any>this._renderRatio).height || requiredHeight;
|
|
|
+ var desiredWidth = (<PostProcessOptions>this._renderRatio).width || requiredWidth;
|
|
|
+ var desiredHeight = (<PostProcessOptions>this._renderRatio).height || requiredHeight;
|
|
|
|
|
|
if (this.renderTargetSamplingMode !== Texture.NEAREST_SAMPLINGMODE) {
|
|
|
- if (!(<any>this._renderRatio).width) {
|
|
|
+ if (!(<PostProcessOptions>this._renderRatio).width) {
|
|
|
desiredWidth = Tools.GetExponentOfTwo(desiredWidth, maxSize);
|
|
|
}
|
|
|
|
|
|
- if (!(<any>this._renderRatio).height) {
|
|
|
+ if (!(<PostProcessOptions>this._renderRatio).height) {
|
|
|
desiredHeight = Tools.GetExponentOfTwo(desiredHeight, maxSize);
|
|
|
}
|
|
|
}
|