question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Introduce FogExp and consider refactoring+FogLinear

See original GitHub issue

In https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderChunk/fog_fragment.glsl.js, under the FOG_EXP2 ifdef:

float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );

Is exp2(something*LOG2) intended here? LOG2 is 1/ln(2), and exp2 is the base 2 exponential, so the expression simplifies to exp(something).

I also wonder why the density and depth are squared. What is the physical analogy? For comparison, they are not squared in the implementation here: https://iquilezles.org/www/articles/fog/fog.htm

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:24 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
mrdoobcommented, Aug 17, 2019

I think adding support for FOG_EXP is good. Not sure how I feel about a new class for it, but it can be refactored later.

1reaction
WestLangleycommented, Aug 20, 2019

I find this confusing…

issue tite:  "Support Foobar"     label: Suggestion

PR title:    "Support Foobar"     label: none

Of course, it is just my opinion, and it is no-big-deal. You are very good about being consistent on things, so I thought I bring it up. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found