David Catuhe 8 rokov pred
rodič
commit
4009100adb

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 6501 - 6496
dist/preview release/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 6501 - 6496
dist/preview release/babylon.module.d.ts


+ 8 - 0
src/Cameras/babylon.camera.ts

@@ -292,6 +292,14 @@
         public _checkInputs(): void {
         }
 
+        public get rigCameras(): Camera[] {
+            return this._rigCameras;
+        }
+
+        public get rigPostProcess(): PostProcess {
+            return this._rigPostProcess;
+        }
+
         private _cascadePostProcessesToRigCams(): void {
             // invalidate framebuffer
             if (this._postProcesses.length > 0) {

+ 8 - 0
src/PostProcess/babylon.postProcess.ts

@@ -14,6 +14,8 @@
         */ 
         public enablePixelPerfectMode = false;
 
+        public samples = 1;
+
         private _camera: Camera;
         private _scene: Scene;
         private _engine: Engine;
@@ -193,6 +195,12 @@
                 this.onSizeChangedObservable.notifyObservers(this);
             }
 
+            this._textures.forEach(texture => {
+                if (texture.samples !== this.samples) {
+                    this._engine.updateRenderTargetTextureSampleCount(texture, this.samples);
+                }
+            });
+
             if (this.enablePixelPerfectMode) {
                 this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight);
                 this._engine.bindFramebuffer(this._textures.data[this._currentRenderTextureInd], 0, requiredWidth, requiredHeight);

+ 6 - 0
src/Tools/babylon.smartArray.ts

@@ -25,6 +25,12 @@
             value.__smartArrayFlags[this._id] = this._duplicateId;
         }
 
+        public forEach(func: (content: T) => void): void {
+            for (var index = 0; index < this.length; index++) {
+                func(this.data[index]);
+            }
+        }
+
         public pushNoDuplicate(value): boolean {
             if (value.__smartArrayFlags && value.__smartArrayFlags[this._id] === this._duplicateId) {
                 return false;

+ 8 - 0
src/babylon.engine.ts

@@ -2499,6 +2499,7 @@
             texture._width = width;
             texture._height = height;
             texture.isReady = true;
+            texture.samples = 1;
             texture.generateMipMaps = generateMipMaps;
             texture.references = 1;
             texture.samplingMode = samplingMode;
@@ -2550,6 +2551,11 @@
             if (this.webGLVersion < 2) {
                 return 1;
             }
+
+            if (texture.samples === samples) {
+                return samples;
+            }
+
             var gl = this._gl;
 
             samples = Math.min(samples, gl.getParameter(gl.MAX_SAMPLES));
@@ -2582,6 +2588,7 @@
                 this.bindUnboundFramebuffer(texture._framebuffer);
             }
 
+            texture.samples = samples;
             texture._depthStencilBuffer = this._setupFramebufferDepthAttachments(texture._generateStencilBuffer, texture._generateDepthBuffer, texture._width, texture._height, samples);
 
             gl.bindRenderbuffer(gl.RENDERBUFFER, null);
@@ -2614,6 +2621,7 @@
             texture.references = 1;
             texture.generateMipMaps = generateMipMaps;
             texture.references = 1;
+            texture.samples = 1;
             texture.samplingMode = samplingMode;
 
             var filters = getSamplingParameters(samplingMode, generateMipMaps, gl);

+ 1 - 0
src/babylon.mixins.ts

@@ -89,6 +89,7 @@ interface WebGLTexture {
     samplingMode: number;
     references: number;
     generateMipMaps: boolean;
+    samples: number;
     type: number;
     onLoadedCallbacks: Array<Function>;
     _size: number;