문제

Three.js comes with a great depth of field example which I've been using in a project and it works nice.

What i'd like to do is modify it so that the bokeh works in front AND behind of the focal point, tilt-shift style.

I'm pretty new to this stuff but it looks like what I'd need to do is have it calculate the depth texture from a camera point in front of the camera (the example calculates it from the current camera position) but no matter what I try I can't get that to work.

Can anyone point me in the right direction?

도움이 되었습니까?

해결책

Ok nvm, the "focus" uniform is what I wanted, you get the focal point in front of the camera if you make it < 1 - I just didn't realise it before because the steps required are minute, in my scene placing the focal point at the scene's center requires a focus value of 0.98, and the example GUI was moving the focal length by steps of 0.025

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top