playdeadgames / temporal

Temporal Reprojection Anti-Aliasing for Unity 5.0+
MIT License
1.84k stars 192 forks source link

Does this AA solution work for orthographic cameras? #4

Closed Hyperparticle closed 7 years ago

Hyperparticle commented 8 years ago

Thanks for this fantastic AA solution!

I have tried to use this for orthographic cameras, but it appears to do nothing until I switch it to perspective. I may have missed something in the documentation, but I haven't seen anything that clearly specifies what camera types are supported.

Is this only limited to perspective cameras, or am I doing something wrong with orthographic?

Sleem81 commented 8 years ago

Yeah I have the same problem

yvan-sraka commented 7 years ago

Yes, currently jittering and AA are enabled only if camera.orthographic == false.

So I just started working on this, I deleted the check, created another projection function for the orthographic camera. Now it just lacks the correct 4x4 matrix, I have copy-pasted the one used by the perspective projection, so if you activate the Frustum Jitter... SURPRISE: it switch to perspective view!

You can follow my changes here: https://github.com/yvan-sraka/temporal/commit/19ba3783302a83d124872cc0d56b8a6b49b5da57