2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2017-09-30 21:26:46 -07:00
|
|
|
|
2019-09-27 19:53:03 -07:00
|
|
|
#include <optional>
|
|
|
|
|
2019-09-28 17:30:53 -07:00
|
|
|
#include "Runtime/GCNTypes.hpp"
|
2019-09-27 19:53:03 -07:00
|
|
|
#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp"
|
|
|
|
|
2022-01-31 16:06:54 -08:00
|
|
|
//#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
2019-09-28 17:30:53 -07:00
|
|
|
|
2019-09-27 19:53:03 -07:00
|
|
|
#include <zeus/CColor.hpp>
|
|
|
|
#include <zeus/CMatrix4f.hpp>
|
2017-09-30 21:26:46 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2018-12-07 21:30:43 -08:00
|
|
|
|
|
|
|
class CWorldShadowShader {
|
2022-02-15 21:21:24 -08:00
|
|
|
std::shared_ptr<aurora::gfx::TextureHandle> m_tex;
|
2019-06-11 19:05:17 -07:00
|
|
|
std::optional<CTexturedQuadFilter> m_prevQuad;
|
2018-12-07 21:30:43 -08:00
|
|
|
u32 m_w, m_h;
|
|
|
|
|
|
|
|
struct Uniform {
|
|
|
|
zeus::CMatrix4f m_matrix;
|
|
|
|
zeus::CColor m_color;
|
|
|
|
};
|
2022-01-31 16:06:54 -08: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;
|
2018-12-07 21:30:43 -08:00
|
|
|
Uniform m_uniform;
|
2017-09-30 21:26:46 -07:00
|
|
|
|
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
static void Initialize();
|
|
|
|
static void Shutdown();
|
2020-03-30 20:52:22 -07:00
|
|
|
explicit CWorldShadowShader(u32 w, u32 h);
|
2018-12-07 21:30:43 -08:00
|
|
|
void bindRenderTarget();
|
|
|
|
void drawBase(float extent);
|
|
|
|
void lightenShadow();
|
|
|
|
void blendPreviousShadow();
|
|
|
|
void resolveTexture();
|
|
|
|
|
|
|
|
u32 GetWidth() const { return m_w; }
|
|
|
|
u32 GetHeight() const { return m_h; }
|
|
|
|
|
2022-02-15 21:21:24 -08:00
|
|
|
const std::shared_ptr<aurora::gfx::TextureHandle>& GetTexture() const { return m_tex; }
|
2017-09-30 21:26:46 -07:00
|
|
|
};
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|