Skip to content
Snippets Groups Projects
Commit 09cfd856 authored by Alexander Rose's avatar Alexander Rose
Browse files

tweaked shader const

parent 846a3011
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ float intMod(const in float a, const in float b) { return a - b * float(int(a) / ...@@ -11,7 +11,7 @@ float intMod(const in float a, const in float b) { return a - b * float(int(a) /
float pow2(const in float x) { return x*x; } float pow2(const in float x) { return x*x; }
const float maxFloat = 10000.0; // NOTE constant also set in TypeScript const float maxFloat = 10000.0; // NOTE constant also set in TypeScript
const float floatLogFactor = log(maxFloat + 1.0); const float floatLogFactor = 4.0000434273; // log(maxFloat + 1.0);
float encodeFloatLog(const in float value) { return log(value + 1.0) / floatLogFactor; } float encodeFloatLog(const in float value) { return log(value + 1.0) / floatLogFactor; }
float decodeFloatLog(const in float value) { return exp(value * floatLogFactor) - 1.0; } float decodeFloatLog(const in float value) { return exp(value * floatLogFactor) - 1.0; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment