0beqz / realism-effects

SSGI, Motion Blur, TRAA - Effects to enhance your three.js scene's realism
https://realism-effects-obeqz.vercel.app/
MIT License
1.41k stars 63 forks source link

Orthographic camera #10

Open kanopa opened 1 year ago

kanopa commented 1 year ago

In the example, when changing the camera from perspective to orthographic, tracing does not seem to work, and because of this, the light creates a completely different picture, slightly overexposed and without such shadows as with a perspective camera.

// const camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 0.01, 250)
const frustumSize = 10
const aspect = window.innerWidth / window.innerHeight
const camera = new THREE.OrthographicCamera(
    -frustumSize * aspect,
    frustumSize * aspect,
    frustumSize,
    -frustumSize,
    1,
    1000,
)
scene.add(camera)

Perspective (default example) perspective Orthographic ortho

Is it possible to achieve a similar result with an orthographic camera as a perspective one? Or is it not supported yet?

0beqz commented 1 year ago

It's not supported yet, I'll implement it soon. Using orthographic projection doesn't work in the velocity pass as well as in the SSGI pass so that's why you are getting those heavy distortions.

kanopa commented 1 year ago

@0beqz Thanks for your reply, I'm looking forward to it :)