Access to camera matrices without touching the driver's?
Posted: Thu Jul 26, 2012 11:41 am
In order to do some old-fashioned matrix wrangling, I have some non-active cameras.
Now, I need to set their position and target, and then get their projection and view matrices. But after calling setPosition or setTarget those matrices aren't updated; that only happens in render().
But, render also uploads those matrices to the driver, which I don't want. I'm going to pass them as a shader uniform, without disturbing the active cam's rendering.
Now, I could call thiscam->render(); activecam->render();, but that would cause unneeded state changes. So I propose a public call updateMatrices() for cameras that does everything that render does except upload matrices to the driver.
Now, I need to set their position and target, and then get their projection and view matrices. But after calling setPosition or setTarget those matrices aren't updated; that only happens in render().
But, render also uploads those matrices to the driver, which I don't want. I'm going to pass them as a shader uniform, without disturbing the active cam's rendering.
Now, I could call thiscam->render(); activecam->render();, but that would cause unneeded state changes. So I propose a public call updateMatrices() for cameras that does everything that render does except upload matrices to the driver.