As of r76, THREE.DepthMaterial encodes the depth in NDC rather than a random hard-coded range. The DOF effect examples were apparently not updated and still assume it to work the old way.
Checking showFocus on the GUI of webgl_camera_cinematic exposes the problem most clearly. The expected behavior is that moving the mouse over an object highlights all objects at a similar depth and also sets the focus to that depth. Instead, weird things happen.
[ ] no others
[x] All of them
[x] All of them
My fault. I'll have a look soon. It should be a simple function to add to do the decoding properly.
Any movement on this? I am trying to use your example in a project I am currently working on and was about to create a bug ticket for the very same issue but I used to issue tracker to find that it had already been created. Forgive my ignorance on this but where would this simple function go and what would it do?
Thanks guys! Awesome work here :)
to be clearer I was actually looking at the following examples:
http://threejs.org/examples/webgl_postprocessing_dof2.html
the above example does not seem to work properly (expected is that on hover it would focus on objects at that depth as mentioned in the original comment)
I found a working version of the same example here that does do the expected behavior... probably using pre r76:
http://broiler.astrometry.net/~kilian/bloopyfloop/examples/webgl_postprocessing_dof2.html
Haha oh man so glad I found this. I've been working with the examples for the past few days trying to get something simple to work. I tried both DoF and DoF2 and have been unable to get these things to look right. On r86.
/ping @bhouston
@bhouston Any way I can help?
@gigablox I've fixed the first DOF example. That may help to show how to fix the others. Please review my PR.
Most helpful comment
My fault. I'll have a look soon. It should be a simple function to add to do the decoding properly.