# [Learning] Why no deferred in orthographic?

This is a topic purely for learning purpose.

A while back, I stumble upon the fact that shadow didn’t work in orthographic, and Aras stated that was by design, for performance reason, because “deferred does not work with orthographic cameras”.

Now I’ve written some small deferred rendering in OGL/D3D earliers, and a friend asked me “well why it didn’t work in deferred”…And I found myself unable to answer, because I see no problem in a deferred rendering in orthographic…

Orthographic is just a different projection Matrix. As long as you have the matrix, you can unroll each space (world, view, projection) ans so write your GBuffer (depth, normal, albedo) and perform your lightning calculation (you have all the information needed and the matrix to set all in the space you decided, view or world)

So what’s the catch with deferred that make it either impossible to do in deferred, or at least require a different pipeline, that would have require twice as much maintenant in Unity? I miss some points but can’t find them :x

We do read depth buffer value in the deferred lighting shader to reconstruct the position. In perspective case, that depth is very non-linear (and needs some kind of shader code to linearize it), but the same shader code does not work when using orthographic (where depth is linear).

The depthmap (non)linearity…forgotten the fact that it was linear in ortho.
Thanks to have taken the time to answer a student question o/

But apart from linearization of the depth, the rest of the pipeline is the same? Because that would mean just change the mean to retrieve view or world pos from Gbuffers info.

Or does it bring other problem like the fact that the depth is as precise at the near plane than at the far plane, instead of having more precision at close range and less and less toward the far plane? Messing with z-fighting optimization then maybe? Or even shader generator, since Unity work with lightning pass shader generated?