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

Implement non-rippling CFluidPlaneCPU render path

This commit is contained in:
Jack Andersen
2017-08-10 13:13:25 -10:00
parent ea2fdc939b
commit fd7589afd5
9 changed files with 507 additions and 120 deletions

View File

@@ -178,7 +178,8 @@ CFluidPlaneShader::CFluidPlaneShader(CFluidPlane::EFluidType type,
}
void CFluidPlaneShader::draw(const zeus::CMatrix4f texMtxs[6], const zeus::CMatrix4f& normMtx, float indScale,
const std::vector<CLight>& lights, const zeus::CColor kColors[4])
const std::vector<CLight>& lights, const zeus::CColor kColors[4],
const std::vector<Vertex>& verts)
{
Uniform& uni = *reinterpret_cast<Uniform*>(m_uniBuf->map(sizeof(Uniform)));
uni.m_mv = CGraphics::g_GXModelView.toMatrix4f();
@@ -192,8 +193,11 @@ void CFluidPlaneShader::draw(const zeus::CMatrix4f texMtxs[6], const zeus::CMatr
uni.m_lighting.mulColor = kColors[3];
uni.m_lighting.fog.m_rangeScale = indScale;
m_uniBuf->unmap();
m_vbo->load(verts.data(), verts.size() * sizeof(Vertex));
CGraphics::SetShaderDataBinding(m_dataBind);
CGraphics::DrawArray(0, 0);
CGraphics::DrawArray(0, verts.size());
}
}