Deferred lighting implementation in progress. Now generating view-space normal fragments for the 1st pass G-buffer.

Added transpose() method to KRMat4

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4043
This commit is contained in:
kearwood
2012-04-13 01:13:18 +00:00
parent 3749d3edfd
commit b88cf8e0cb
16 changed files with 124 additions and 48 deletions

View File

@@ -67,7 +67,7 @@ KRModel::~KRModel() {
}
#if TARGET_OS_IPHONE
void KRModel::render(KRCamera *pCamera, KRContext *pContext, bool bRenderShadowMap, KRMat4 &mvpMatrix, KRVector3 &cameraPosition, KRVector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers, KRTexture *pLightMap) {
void KRModel::render(KRCamera *pCamera, KRContext *pContext, bool bRenderShadowMap, KRMat4 &matModelToView, KRMat4 &mvpMatrix, KRVector3 &cameraPosition, KRVector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers, KRTexture *pLightMap) {
if(m_materials.size() == 0) {
vector<KRMesh::Submesh *> submeshes = m_pMesh->getSubmeshes();
@@ -104,7 +104,7 @@ void KRModel::render(KRCamera *pCamera, KRContext *pContext, bool bRenderShadowM
KRMaterial *pMaterial = m_materials[iSubmesh];
if(pMaterial != NULL && pMaterial == (*mat_itr)) {
pMaterial->bind(&pPrevBoundMaterial, szPrevShaderKey, pCamera, mvpMatrix, cameraPosition, lightDirection, pShadowMatrices, shadowDepthTextures, cShadowBuffers, pContext, pLightMap);
pMaterial->bind(&pPrevBoundMaterial, szPrevShaderKey, pCamera, matModelToView, mvpMatrix, cameraPosition, lightDirection, pShadowMatrices, shadowDepthTextures, cShadowBuffers, pContext, pLightMap);
m_pMesh->renderSubmesh(iSubmesh, &iPrevBuffer);
}
}