Browse Source

remove unused en/decodeFloatLog

Alexander Rose 3 years ago
parent
commit
e76a08c73a
2 changed files with 1 additions and 16 deletions
  1. 0 5
      src/mol-gl/shader/chunks/common.glsl.ts
  2. 1 11
      src/mol-util/float-packing.ts

+ 0 - 5
src/mol-gl/shader/chunks/common.glsl.ts

@@ -32,11 +32,6 @@ int imod(const in int a, const in int b) { return a - b * (a / b); }
 
 float pow2(const in float x) { return x * x; }
 
-const float maxFloat = 10000.0; // NOTE constant also set in TypeScript
-const float floatLogFactor = 9.210440366976517; // log(maxFloat + 1.0);
-float encodeFloatLog(const in float value) { return log(value + 1.0) / floatLogFactor; }
-float decodeFloatLog(const in float value) { return exp(value * floatLogFactor) - 1.0; }
-
 vec3 packIntToRGB(in float value) {
     value = clamp(round(value), 0.0, 16777216.0 - 1.0) + 1.0;
     vec3 c = vec3(0.0);

+ 1 - 11
src/mol-util/float-packing.ts

@@ -1,23 +1,13 @@
 /**
- * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
 import { clamp } from '../mol-math/interpolate';
-import { fasterExp, fasterLog } from '../mol-math/approx';
 import { Vec3, Vec4 } from '../mol-math/linear-algebra';
 import { NumberArray } from './type-helpers';
 
-const maxFloat = 10000.0; // NOTE same constant is set in shaders
-const floatLogFactor = fasterLog(maxFloat + 1);
-
-/** encode float logarithmically */
-export function encodeFloatLog(value: number) { return fasterLog(value + 1) / floatLogFactor; }
-
-/** decode logarithmically encoded float */
-export function decodeFloatLog(value: number) { return fasterExp(value * floatLogFactor) - 1; }
-
 /** encode positive integer as rgb byte triplet into array at offset */
 export function packIntToRGBArray(value: number, array: NumberArray, offset: number) {
     value = clamp(Math.round(value), 0, 16777216 - 1) + 1;