فهرست منبع

remove use of isnan in impostor shaders

- not needed and causing slowdown
Alexander Rose 2 سال پیش
والد
کامیت
b69f62c9a4
2فایلهای تغییر یافته به همراه2 افزوده شده و 8 حذف شده
  1. 1 0
      CHANGELOG.md
  2. 1 8
      src/mol-gl/shader/chunks/apply-light-color.glsl.ts

+ 1 - 0
CHANGELOG.md

@@ -7,6 +7,7 @@ Note that since we don't clearly distinguish between a public and private interf
 ## [Unreleased]
 
 - Bind shared textures only once per pass, not for each render item
+- Remove use of ``isnan`` in impostor shaders, not needed and causing slowdown
 
 ## [v3.11.0] - 2022-07-04
 

+ 1 - 8
src/mol-gl/shader/chunks/apply-light-color.glsl.ts

@@ -13,14 +13,7 @@ export const apply_light_color = `
 #else
     #ifdef bumpEnabled
         if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0) {
-            vec3 bumpNormal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);
-            #ifdef enabledFragDepth
-                if (!isNaN(bumpNormal.x) && !isNaN(bumpNormal.y) && !isNaN(bumpNormal.z)) {
-                    normal = bumpNormal;
-                }
-            #else
-                normal = bumpNormal;
-            #endif
+            normal = perturbNormal(-vViewPosition, normal, fbm(vModelPosition * uBumpFrequency), (uBumpAmplitude * bumpiness) / uBumpFrequency);
         }
     #endif