David Catuhe 5 yıl önce
ebeveyn
işleme
d3d8b497ef
2 değiştirilmiş dosya ile 8 ekleme ve 2 silme
  1. 1 1
      src/Engines/constants.ts
  2. 7 1
      src/PostProcesses/postProcess.ts

+ 1 - 1
src/Engines/constants.ts

@@ -181,7 +181,7 @@ export class Constants {
     /** FLOAT_32_UNSIGNED_INT_24_8_REV */
     public static readonly TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;
 
-    /** nearest is mag = nearest and min = nearest and mip = linear */
+    /** nearest is mag = nearest and min = nearest and mip = nearest */
     public static readonly TEXTURE_NEAREST_SAMPLINGMODE = 1;
     /** Bilinear is mag = linear and min = linear and mip = nearest */
     public static readonly TEXTURE_BILINEAR_SAMPLINGMODE = 2;

+ 7 - 1
src/PostProcesses/postProcess.ts

@@ -484,9 +484,15 @@ export class PostProcess {
                 this.width = desiredWidth;
                 this.height = desiredHeight;
 
+                const needMipMaps = this.renderTargetSamplingMode === Constants.TEXTURE_TRILINEAR_SAMPLINGMODE || 
+                                    this.renderTargetSamplingMode === Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR ||
+                                    this.renderTargetSamplingMode === Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR ||
+                                    this.renderTargetSamplingMode === Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR ||
+                                    this.renderTargetSamplingMode === Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR;
+
                 let textureSize = { width: this.width, height: this.height };
                 let textureOptions = {
-                    generateMipMaps: false,
+                    generateMipMaps: needMipMaps,
                     generateDepthBuffer: forceDepthStencil || camera._postProcesses.indexOf(this) === 0,
                     generateStencilBuffer: (forceDepthStencil || camera._postProcesses.indexOf(this) === 0) && this._engine.isStencilEnable,
                     samplingMode: this.renderTargetSamplingMode,