Hey guys.
I have some questions that I coudn’t find on the internet(maybe I wasn’t searching for the right thing).
So I’m trying to implement the deferred lighting tehnique.
I have my buffers drawn well enough.
When I draw the lighting pass I need to have the light position in the view matrix. Note that the view changes from the perspective one to the orthogonal one in order to draw the albedo buffer.
Anyway to get to the point I want to calculate the viewMatrix. Is that by any chance the projection matrix multiplied with the modelviewmatrix?
I’ll have to send the old viewmatrix to the shader in order to get the light position in the viewmatrix.
Next in order is something about viewplanes and frustum.
I have the frustum as this “float frustum[6][4]”. The function I used to calculate it is not written by me and thus I’m not sure which are the near and far planes (vector4).
Aparently I need that too in order to get things right.