2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-07-29 10:38:44 -07:00
|
|
|
|
2019-09-28 19:22:12 -07:00
|
|
|
#include <array>
|
|
|
|
|
2019-09-28 17:30:53 -07:00
|
|
|
#include "Runtime/GCNTypes.hpp"
|
2022-01-31 16:06:54 -08:00
|
|
|
#include "Runtime/Graphics/CGraphics.hpp"
|
2019-09-28 17:30:53 -07:00
|
|
|
|
2019-09-27 19:53:03 -07:00
|
|
|
#include <zeus/CMatrix4f.hpp>
|
2019-09-28 17:30:53 -07:00
|
|
|
#include <zeus/CVector3f.hpp>
|
2016-07-29 10:38:44 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2016-07-29 10:38:44 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CSpaceWarpFilter {
|
|
|
|
struct Uniform {
|
|
|
|
zeus::CMatrix4f m_matrix;
|
|
|
|
zeus::CMatrix4f m_indXf;
|
|
|
|
zeus::CVector3f m_strength;
|
|
|
|
};
|
2019-09-28 19:22:12 -07:00
|
|
|
std::array<std::array<std::array<u8, 4>, 8>, 4> m_shiftTexture{};
|
2022-02-15 21:21:24 -08:00
|
|
|
std::shared_ptr<aurora::gfx::TextureHandle> m_warpTex;
|
2022-01-31 16:06:54 -08:00
|
|
|
// boo::ObjToken<boo::IGraphicsBufferS> m_vbo;
|
|
|
|
// boo::ObjToken<boo::IGraphicsBufferD> m_uniBuf;
|
|
|
|
// boo::ObjToken<boo::IShaderDataBinding> m_dataBind;
|
2018-12-07 21:30:43 -08:00
|
|
|
Uniform m_uniform;
|
|
|
|
float m_strength = 1.f;
|
2016-07-29 10:38:44 -07:00
|
|
|
|
2022-01-31 16:06:54 -08:00
|
|
|
void GenerateWarpRampTex();
|
2016-07-29 10:38:44 -07:00
|
|
|
|
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
static void Initialize();
|
|
|
|
static void Shutdown();
|
|
|
|
CSpaceWarpFilter();
|
|
|
|
void setStrength(float strength) { m_strength = strength; }
|
|
|
|
void draw(const zeus::CVector3f& pt);
|
2016-07-29 10:38:44 -07:00
|
|
|
};
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|