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

Mirror Fog #14

Open
titansoftime opened this issue Jun 28, 2015 · 3 comments
Open

Mirror Fog #14

titansoftime opened this issue Jun 28, 2015 · 3 comments

Comments

@titansoftime
Copy link

The reflected elements do not have fog applied to them. At least not when using FogExp2, not sure about regular Fog.

@jbouny
Copy link
Owner

jbouny commented Jul 5, 2015

The problem is due to the fact that the frustum of the mirrored camera correspond to the water plane.

The distance taken into account to compute the fog is the distance between the object and the plane, instead of the distance to the camera.

I currently really don't know how to fix this problem ... This problem will be the same on the basic Mirror of three.js.

@mattlockyer
Copy link

A hacky solution is to multiply the scene fog by some factor before rendering water then restoring it before rendering the scene. This fades the objects out as you move deeper into the surface of the water, but does not color the objects correctly as the problem states is the main issue.

@stmaccarelli
Copy link

@jbouny what about a vignette shader applied to the generated mirror texture, just acting on left, top and right side of the texture?, with a radius proportionally corresponding to normalized fog near / far distance relative to camera near / far values, and the color of the vignette would be the same of the fog.

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