2017-10-01 04:26:46 +00:00
|
|
|
#ifndef URDE_CWORLDSHADOWSHADER_HPP
|
|
|
|
#define URDE_CWORLDSHADOWSHADER_HPP
|
|
|
|
|
|
|
|
#include "TShader.hpp"
|
|
|
|
#include "CColoredQuadFilter.hpp"
|
|
|
|
#include "CTexturedQuadFilter.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
|
|
|
class CWorldShadowShader
|
|
|
|
{
|
2017-10-01 05:32:37 +00:00
|
|
|
friend struct CWorldShadowShaderGLDataBindingFactory;
|
|
|
|
friend struct CWorldShadowShaderVulkanDataBindingFactory;
|
|
|
|
friend struct CWorldShadowShaderD3DDataBindingFactory;
|
|
|
|
friend struct CWorldShadowShaderMetalDataBindingFactory;
|
2017-10-01 04:26:46 +00:00
|
|
|
|
2017-11-05 06:17:12 +00:00
|
|
|
boo::ObjToken<boo::ITextureR> m_tex;
|
2017-10-01 04:26:46 +00:00
|
|
|
std::experimental::optional<CTexturedQuadFilter> m_prevQuad;
|
|
|
|
u32 m_w, m_h;
|
|
|
|
|
|
|
|
struct Uniform
|
|
|
|
{
|
|
|
|
zeus::CMatrix4f m_matrix;
|
|
|
|
zeus::CColor m_color;
|
|
|
|
};
|
2017-11-05 06:17:12 +00:00
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_vbo;
|
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_uniBuf;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_dataBind;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_zDataBind;
|
2017-10-01 04:26:46 +00:00
|
|
|
Uniform m_uniform;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CWorldShadowShader(u32 w, u32 h);
|
|
|
|
void bindRenderTarget();
|
|
|
|
void drawBase(float extent);
|
|
|
|
void lightenShadow();
|
|
|
|
void blendPreviousShadow();
|
|
|
|
void resolveTexture();
|
|
|
|
|
|
|
|
u32 GetWidth() const { return m_w; }
|
|
|
|
u32 GetHeight() const { return m_h; }
|
|
|
|
|
2017-11-05 06:17:12 +00:00
|
|
|
const boo::ObjToken<boo::ITextureR>& GetTexture() const { return m_tex; }
|
2017-10-01 04:26:46 +00:00
|
|
|
|
|
|
|
using _CLS = CWorldShadowShader;
|
|
|
|
#include "TShaderDecl.hpp"
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // URDE_CWORLDSHADOWSHADER_HPP
|