Skip to content

Commit

Permalink
Added MM matrices to UniformConstants (TODO fix missing MM matrices)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhog committed Mar 13, 2021
1 parent 992f292 commit 625af77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rts/Rendering/UniformConstants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "Game/Camera.h"
#include "Game/CameraHandler.h"
#include "Game/GlobalUnsynced.h"
#include "Game/UI/MiniMap.h"
#include "Sim/Misc/GlobalConstants.h"
#include "Sim/Misc/GlobalSynced.h"
#include "Sim/Misc/TeamHandler.h"
Expand Down Expand Up @@ -87,6 +88,14 @@ void UniformConstants::UpdateMatricesImpl(UniformMatricesBuffer* updateBuffer)
updateBuffer->shadowViewProj = updateBuffer->shadowProj * updateBuffer->shadowView;

updateBuffer->orthoProj01 = CMatrix44f::ClipOrthoProj01();

updateBuffer->mmDrawView = minimap->GetViewMat(0);
updateBuffer->mmDrawIMMView = minimap->GetViewMat(1);
updateBuffer->mmDrawDimView = minimap->GetViewMat(2);

updateBuffer->mmDrawProj = minimap->GetProjMat(0);
updateBuffer->mmDrawIMMProj = minimap->GetProjMat(1);
updateBuffer->mmDrawDimProj = minimap->GetProjMat(2);
}


Expand Down
9 changes: 9 additions & 0 deletions rts/Rendering/UniformConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ struct UniformMatricesBuffer {

CMatrix44f orthoProj01;
//TODO: minimap matrices

// transforms for [0] := Draw, [1] := DrawInMiniMap, [2] := Lua DrawInMiniMap
CMatrix44f mmDrawView; //world to MM
CMatrix44f mmDrawIMMView; //heightmap to MM
CMatrix44f mmDrawDimView; //mm dims

CMatrix44f mmDrawProj; //world to MM
CMatrix44f mmDrawIMMProj; //heightmap to MM
CMatrix44f mmDrawDimProj; //mm dims
};

struct UniformParamsBuffer {
Expand Down

0 comments on commit 625af77

Please sign in to comment.