#include "Runtime/Graphics/Shaders/CLineRendererShaders.hpp" #include "Runtime/Graphics/CLineRenderer.hpp" #include "CLineRendererShaders.cpp.hshhead" namespace urde { using namespace hsh::pipeline; template struct CLineRendererTexPipeline : pipeline, BlendAttachment>, depth_compare> { CLineRendererTexPipeline(hsh::vertex_buffer vbo, hsh::uniform_buffer uniBuf HSH_VAR_STAGE(fragment), hsh::texture2d tex) { this->position = vbo->pos; hsh::float4 colorIn = vbo->color * uniBuf->moduColor * tex.sample(vbo->uv); FOG_SHADER(uniBuf->fog) FOG_OUT(this->color_out[0], uniBuf->fog, colorIn) } }; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererTexPipeline; template struct CLineRendererNoTexPipeline : pipeline, BlendAttachment>, depth_compare> { CLineRendererNoTexPipeline(hsh::vertex_buffer vbo, hsh::uniform_buffer uniBuf HSH_VAR_STAGE(fragment)) { this->position = vbo->pos; hsh::float4 colorIn = vbo->color * uniBuf->moduColor; FOG_SHADER(uniBuf->fog) FOG_OUT(this->color_out[0], uniBuf->fog, colorIn) } }; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; template struct CLineRendererNoTexPipeline; void CLineRendererShaders::BindShader(CLineRenderer& renderer, hsh::texture2d texture, bool additive, hsh::Compare zcomp) { if (texture) { renderer.m_shaderBind[0].hsh_tex_bind(CLineRendererTexPipeline( renderer.m_vertBuf.get(), renderer.m_uniformBuf.get(), texture)); renderer.m_shaderBind[1].hsh_tex_bind_awrite(CLineRendererTexPipeline( renderer.m_vertBuf.get(), renderer.m_uniformBuf.get(), texture)); } else { renderer.m_shaderBind[0].hsh_notex_bind( CLineRendererNoTexPipeline(renderer.m_vertBuf.get(), renderer.m_uniformBuf.get())); renderer.m_shaderBind[1].hsh_notex_bind_awrite( CLineRendererNoTexPipeline(renderer.m_vertBuf.get(), renderer.m_uniformBuf.get())); } } } // namespace urde