diff --git a/Runtime/Graphics/CMakeLists.txt b/Runtime/Graphics/CMakeLists.txt index 3b4e136e2..fe19fc8ff 100644 --- a/Runtime/Graphics/CMakeLists.txt +++ b/Runtime/Graphics/CMakeLists.txt @@ -64,4 +64,5 @@ runtime_add_hsh(Graphics Shaders/CElementGenShaders.cpp Shaders/CEnvFxShaders.cpp Shaders/CFogVolumeFilter.cpp + Shaders/CMapSurfaceShader.cpp ) diff --git a/Runtime/Graphics/Shaders/CMapSurfaceShader.cpp b/Runtime/Graphics/Shaders/CMapSurfaceShader.cpp index 54a28524e..c158fc5b1 100644 --- a/Runtime/Graphics/Shaders/CMapSurfaceShader.cpp +++ b/Runtime/Graphics/Shaders/CMapSurfaceShader.cpp @@ -1,15 +1,24 @@ #include "Runtime/Graphics/Shaders/CMapSurfaceShader.hpp" -#include - #include "Runtime/Graphics/CGraphics.hpp" -namespace urde { +#include "CMapSurfaceShader.cpp.hshhead" -CMapSurfaceShader::CMapSurfaceShader(hsh::vertex_buffer vbo, - hsh::index_buffer ibo) { +namespace urde { +using namespace hsh::pipeline; + +struct CMapSurfaceShaderPipeline : pipeline, BlendAttachment<>, depth_compare, + depth_write, cull_mode> { + CMapSurfaceShaderPipeline(hsh::uniform_buffer uniBuf, + hsh::vertex_buffer vbo, hsh::index_buffer ibo) { + this->position = uniBuf->mtx * hsh::float4(vbo->pos, 1.f); + this->color_out[0] = uniBuf->color; + } +}; + +CMapSurfaceShader::CMapSurfaceShader(hsh::vertex_buffer vbo, hsh::index_buffer ibo) { m_uniBuf = hsh::create_dynamic_uniform_buffer(); - m_dataBind.hsh_bind(m_uniBuf.get(), vbo, ibo); + m_dataBind.hsh_bind(CMapSurfaceShaderPipeline(m_uniBuf.get(), vbo, ibo)); } void CMapSurfaceShader::draw(const zeus::CColor& color, u32 start, u32 count) {