浏览代码

fixing some stuff regarding webgl 1 compat

Benjamin Guignabert 8 年之前
父节点
当前提交
a439def2b1
共有 4 个文件被更改,包括 7022 次插入7017 次删除
  1. 3507 3507
      dist/preview release/babylon.d.ts
  2. 3507 3507
      dist/preview release/babylon.module.d.ts
  3. 2 0
      src/Shaders/ShadersInclude/lightFragmentDeclaration.fx
  4. 6 3
      src/babylon.scene.ts

文件差异内容过多而无法显示
+ 3507 - 3507
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 3507 - 3507
dist/preview release/babylon.module.d.ts


+ 2 - 0
src/Shaders/ShadersInclude/lightFragmentDeclaration.fx

@@ -3,6 +3,8 @@
 	uniform vec4 vLightDiffuse{X};
 	#ifdef SPECULARTERM
 		uniform vec3 vLightSpecular{X};
+	#else
+		vec3 vLightSpecular{X} = vec3(0.);
 	#endif
 	#ifdef SHADOW{X}
 		#if defined(SPOTLIGHT{X}) || defined(DIRLIGHT{X})

+ 6 - 3
src/babylon.scene.ts

@@ -1689,9 +1689,12 @@
             } else {
                 Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes);
             }
-            this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix);
-            this._sceneUbo.updateMatrix("view", this._viewMatrix);
-            this._sceneUbo.update();
+
+            if (this._sceneUbo.useUbo) {
+                this._sceneUbo.updateMatrix("viewProjection", this._transformMatrix);
+                this._sceneUbo.updateMatrix("view", this._viewMatrix);
+                this._sceneUbo.update();
+            }
         }
 
         public getSceneUniformBuffer(): UniformBuffer {