2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 09:47:43 +00:00

Work on CMapWorld rendering

This commit is contained in:
Jack Andersen
2017-04-21 20:42:32 -10:00
parent 56e386088a
commit 337ffd1c16
23 changed files with 1406 additions and 132 deletions

View File

@@ -0,0 +1,28 @@
#include "CMapSurfaceShader.hpp"
namespace urde
{
CMapSurfaceShader::CMapSurfaceShader(boo::IGraphicsDataFactory::Context& ctx,
boo::IGraphicsBufferS* vbo,
boo::IGraphicsBufferS* ibo)
: m_vbo(vbo), m_ibo(ibo)
{
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
m_dataBind = TShader<CMapSurfaceShader>::BuildShaderDataBinding(ctx, *this);
}
void CMapSurfaceShader::draw(const zeus::CColor& color, u32 start, u32 count)
{
m_uniform.mtx = CGraphics::GetPerspectiveProjectionMatrix(true) * CGraphics::g_GXModelView.toMatrix4f();
m_uniform.color = color;
m_uniBuf->load(&m_uniform, sizeof(m_uniform));
CGraphics::SetShaderDataBinding(m_dataBind);
CGraphics::DrawArrayIndexed(start, count);
}
URDE_SPECIALIZE_SHADER(CMapSurfaceShader)
void CMapSurfaceShader::Shutdown() {}
}