2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-10-01 04:26:46 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <optional>
|
|
|
|
|
2019-09-29 00:30:53 +00:00
|
|
|
#include "Runtime/GCNTypes.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp"
|
|
|
|
|
2019-09-29 00:30:53 +00:00
|
|
|
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <zeus/CColor.hpp>
|
|
|
|
#include <zeus/CMatrix4f.hpp>
|
2017-10-01 04:26:46 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
|
|
|
|
|
|
|
class CWorldShadowShader {
|
|
|
|
boo::ObjToken<boo::ITextureR> m_tex;
|
2019-06-12 02:05:17 +00:00
|
|
|
std::optional<CTexturedQuadFilter> m_prevQuad;
|
2018-12-08 05:30:43 +00:00
|
|
|
u32 m_w, m_h;
|
|
|
|
|
|
|
|
struct Uniform {
|
|
|
|
zeus::CMatrix4f m_matrix;
|
|
|
|
zeus::CColor m_color;
|
|
|
|
};
|
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_vbo;
|
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_uniBuf;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_dataBind;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_zDataBind;
|
|
|
|
Uniform m_uniform;
|
2017-10-01 04:26:46 +00:00
|
|
|
|
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
static void Initialize();
|
|
|
|
static void Shutdown();
|
|
|
|
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; }
|
|
|
|
|
|
|
|
const boo::ObjToken<boo::ITextureR>& GetTexture() const { return m_tex; }
|
2017-10-01 04:26:46 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|