2019-09-29 00:30:53 +00:00
|
|
|
#include "Runtime/Graphics/Shaders/CMapSurfaceShader.hpp"
|
|
|
|
|
2019-09-29 02:22:12 +00:00
|
|
|
#include <array>
|
|
|
|
|
2019-09-29 00:30:53 +00:00
|
|
|
#include "Runtime/Graphics/CGraphics.hpp"
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2017-04-22 06:42:32 +00:00
|
|
|
|
2020-09-28 20:54:40 +00:00
|
|
|
CMapSurfaceShader::CMapSurfaceShader(hsh::vertex_buffer<Vert> vbo,
|
|
|
|
hsh::index_buffer<uint32_t> ibo) {
|
|
|
|
m_uniBuf = hsh::create_dynamic_uniform_buffer<Uniform>();
|
|
|
|
m_dataBind.hsh_bind(m_uniBuf.get(), vbo, ibo);
|
2017-04-22 06:42:32 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CMapSurfaceShader::draw(const zeus::CColor& color, u32 start, u32 count) {
|
2019-07-21 08:42:52 +00:00
|
|
|
SCOPED_GRAPHICS_DEBUG_GROUP("CMapSurfaceShader::draw", zeus::skMagenta);
|
2018-12-08 05:30:43 +00:00
|
|
|
Uniform uniform = {CGraphics::GetPerspectiveProjectionMatrix(true) * CGraphics::g_GXModelView.toMatrix4f(), color};
|
2020-09-28 20:54:40 +00:00
|
|
|
m_uniBuf.load(uniform);
|
|
|
|
m_dataBind.draw_indexed(start, count);
|
2017-04-22 06:42:32 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|