-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
Closed
Labels
Description
Should fog be distance from camera instead of distance from camera's zplane?
Currently fog is just the z distance from the zplane of the camera. That means if you just turn the camera in place objects that are not really getting closer to the camera come out of the fog. That doesn't seem correct (although maybe it's intentional?)
Here's 6 cubes in a circle around the camera. The camera is spinning in place. you can see the cubes come out of the fog even though they are not actually closer to the camera
http://jsfiddle.net/greggman/Lx3mhvbe/
Changing the fog from this
fogDepth = -mvPosition.z;
to this
fogDepth = length(mvPosition);
Seem like it might work?
Example: https://fog-fix.glitch.me/
Not sure it's correct but the objects are no long coming out of the fog
Three.js version
- Dev
- r94
Reactions are currently unavailable