Browse Source

Merge pull request #9541 from Popov72/fix-detailmap-webgl1

Fix detail map not working in WebGL1
David Catuhe 4 years ago
parent
commit
3b34555ba1

+ 1 - 0
dist/preview release/what's new.md

@@ -55,6 +55,7 @@
 - Fix the code generated for the NME gradient block ([Popov72](https://github.com/Popov72))
 - Fix ssao2RenderingPipeline for orthographic cameras ([Kesshi](https://github.com/Kesshi))
 - Fix mipmaps creation in the KTX2 decoder for non square textures ([Popov72](https://github.com/Popov72))
+- Fix detail map not working in WebGL1 ([Popov72](https://github.com/Popov72))
 
 ## Breaking changes
 

+ 1 - 0
src/Materials/material.detailMapConfiguration.ts

@@ -220,6 +220,7 @@ export class DetailMapConfiguration {
      */
     public static AddUniforms(uniforms: string[]): void {
         uniforms.push("vDetailInfos");
+        uniforms.push("detailMatrix");
     }
 
     /**

+ 4 - 0
src/Shaders/ShadersInclude/defaultFragmentDeclaration.fx

@@ -89,4 +89,8 @@ uniform vec2 vReflectionInfos;
     uniform vec4 reflectionRightColor;
     #endif
 
+#endif
+
+#ifdef DETAIL
+uniform vec4 vDetailInfos;
 #endif

+ 5 - 0
src/Shaders/ShadersInclude/defaultVertexDeclaration.fx

@@ -45,3 +45,8 @@ uniform mat4 reflectionMatrix;
 #ifdef POINTSIZE
 	uniform float pointSize;
 #endif
+
+#ifdef DETAIL
+uniform vec4 vDetailInfos;
+uniform mat4 detailMatrix;
+#endif

+ 0 - 1
src/Shaders/ShadersInclude/pbrFragmentDeclaration.fx

@@ -166,7 +166,6 @@ uniform mat4 view;
 
 #ifdef DETAIL
     uniform vec4 vDetailInfos;
-    uniform mat4 detailMatrix;
 #endif
 
 #ifdef USESPHERICALFROMREFLECTIONMAP

+ 4 - 0
src/Shaders/ShadersInclude/pbrVertexDeclaration.fx

@@ -147,3 +147,7 @@ uniform float pointSize;
     #endif
 #endif
 
+#ifdef DETAIL
+uniform vec4 vDetailInfos;
+uniform mat4 detailMatrix;
+#endif