Browse Source

fix bump scaling with ignoreLight enabled

Alexander Rose 1 year ago
parent
commit
1b7b38b47e
2 changed files with 3 additions and 2 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 2
      src/mol-gl/shader/chunks/apply-light-color.glsl.ts

+ 1 - 0
CHANGELOG.md

@@ -22,6 +22,7 @@ Note that since we don't clearly distinguish between a public and private interf
 - MolViewSpec extension (MVS)
 - Add URL parameters `mvs-url`, `mvs-data`, `mvs-format`
 - Add drag&drop for `.mvsj` files
+- Fix `bumpiness` scaling with `ignoreLight` enabled
 
 ## [v3.42.0] - 2023-11-05
 

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

@@ -11,8 +11,8 @@ export const apply_light_color = `
 #ifdef dIgnoreLight
     #ifdef bumpEnabled
         if (uBumpFrequency > 0.0 && uBumpAmplitude > 0.0 && bumpiness > 0.0) {
-            material.rgb += fbm(vModelPosition * uBumpFrequency) * (uBumpAmplitude * bumpiness) / uBumpFrequency;
-            material.rgb -= bumpiness / (2.0 * uBumpFrequency);
+            material.rgb += fbm(vModelPosition * uBumpFrequency) * uBumpAmplitude * bumpiness;
+            material.rgb -= 0.5 * uBumpAmplitude * bumpiness;
         }
     #endif