Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fog based on depth not view distance? #17274

Closed
4 of 13 tasks
supereggbert opened this issue Aug 17, 2019 · 5 comments
Closed
4 of 13 tasks

Fog based on depth not view distance? #17274

supereggbert opened this issue Aug 17, 2019 · 5 comments

Comments

@supereggbert
Copy link
Contributor

supereggbert commented Aug 17, 2019

Just playing with some fog and noticed something that seems a bit off, I'm not sure if it's intentional but it looks like fog is currently using the camera depth, should it not be using view distance? Using depth as apposed to distance means what you see is dependant on camera direction and you get a horizontal line across the scene instead of a nice circular fall off and that doesn't seem right.

Three.js version
  • Dev
  • r107
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
@supereggbert
Copy link
Contributor Author

Here is a quick example of what I was expecting compared to what I'm getting:
example

@mrdoob
Copy link
Owner

mrdoob commented Aug 17, 2019

We tried to fix this last year: #14601 #14602 #14601 (comment) #14617

@supereggbert
Copy link
Contributor Author

Sorry, I completely forgot to check the closed issues. I've hacked round the problem, and it looks like an easy fix given current code base vViewPosition is already setup so it's only a minor change. I'll sort out a PR.

@EliasHasle
Copy link
Contributor

EliasHasle commented Aug 17, 2019

That sounds like good idea. I guess I will wait until your PR is merged (or closed, or abandoned) before I introduce FogExp (#17264, step 2. Step 1 is merged to dev.)

@Mugen87
Copy link
Collaborator

Mugen87 commented Mar 9, 2021

Merging into #17420.

@Mugen87 Mugen87 closed this as completed Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants