-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
Distance based fog? #14601
Comments
I think this is a good suggestion. |
Ditto. @greggman Do you want to file a PR? |
Agreed. I never liked this fog technique. |
Actually, this approach only works correctly if the distance is calculated in the fragment shader, not in the vertex shader. So #14602 will have to be reverted for now. |
Is there any progress about this issue? |
Is there any progress on this? I have implemented it and I am going to create a PR. |
@Mugen87 I need to change in realtime all object's opacity based on their distance from the camera. The fog technique doesn't work there. Changing manually in animate is consuming a lot of CPU. |
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
to this
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
The text was updated successfully, but these errors were encountered: