浏览代码

Lint + Log Webgl1

sebavan 5 年之前
父节点
当前提交
093ca158b8
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 0 1
      src/Materials/PBR/pbrBaseMaterial.ts
  2. 6 0
      src/Materials/Textures/Filtering/hdrFiltering.ts

+ 0 - 1
src/Materials/PBR/pbrBaseMaterial.ts

@@ -664,7 +664,6 @@ export abstract class PBRBaseMaterial extends PushMaterial {
         this.markAsDirty(Constants.MATERIAL_TextureDirtyFlag);
     }
 
-
     /**
      * Force normal to face away from face.
      */

+ 6 - 0
src/Materials/Textures/Filtering/hdrFiltering.ts

@@ -10,6 +10,7 @@ import { Nullable } from '../../../types';
 
 import "../../../Shaders/hdrFiltering.vertex";
 import "../../../Shaders/hdrFiltering.fragment";
+import { Logger } from '../../../Misc/logger';
 
 /**
  * Options for texture filtering
@@ -192,6 +193,11 @@ export class HDRFiltering {
       * @return Promise called when prefiltering is done
       */
     public prefilter(texture: BaseTexture, onFinished: Nullable<() => void> = null) {
+        if (this._engine.webGLVersion === 1) {
+            Logger.Warn("HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.");
+            return;
+        }
+
         return new Promise((resolve) => {
             this._effectRenderer = new EffectRenderer(this._engine);
             this._effectWrapper = this._createEffect(texture);