2019-09-29 00:30:53 +00:00
|
|
|
#include "Runtime/Graphics/Shaders/CEnvFxShaders.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/World/CEnvFxManager.hpp"
|
|
|
|
|
2022-02-01 00:06:54 +00:00
|
|
|
//#include <hecl/Pipeline.hpp>
|
2018-11-02 08:16:16 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2022-02-01 00:06:54 +00:00
|
|
|
//boo::ObjToken<boo::IShaderPipeline> CEnvFxShaders::m_snowPipeline;
|
|
|
|
//boo::ObjToken<boo::IShaderPipeline> CEnvFxShaders::m_underwaterPipeline;
|
2018-11-02 08:16:16 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CEnvFxShaders::Initialize() {
|
2022-02-01 00:06:54 +00:00
|
|
|
// m_snowPipeline = hecl::conv->convert(Shader_CEnvFxSnowShader{});
|
|
|
|
// m_underwaterPipeline = hecl::conv->convert(Shader_CEnvFxUnderwaterShader{});
|
2018-11-02 08:16:16 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CEnvFxShaders::Shutdown() {
|
2022-02-01 00:06:54 +00:00
|
|
|
// m_snowPipeline.reset();
|
|
|
|
// m_underwaterPipeline.reset();
|
2018-11-02 08:16:16 +00:00
|
|
|
}
|
|
|
|
|
2022-02-01 00:06:54 +00:00
|
|
|
void CEnvFxShaders::BuildShaderDataBinding(CEnvFxManager& fxMgr,
|
2018-12-08 05:30:43 +00:00
|
|
|
CEnvFxManagerGrid& grid) {
|
2022-02-01 00:06:54 +00:00
|
|
|
// const auto uBufInfo = grid.m_uniformBuf.getBufferInfo();
|
|
|
|
// const auto iBufInfo = grid.m_instBuf.getBufferInfo();
|
|
|
|
|
|
|
|
// const std::array<boo::ObjToken<boo::IGraphicsBuffer>, 2> uniforms{{
|
|
|
|
// uBufInfo.first.get(),
|
|
|
|
// fxMgr.m_fogUniformBuf.get(),
|
|
|
|
// }};
|
|
|
|
// const std::array<size_t, 2> ubufOffsets{
|
|
|
|
// size_t(uBufInfo.second),
|
|
|
|
// 0,
|
|
|
|
// };
|
|
|
|
// constexpr std::array<size_t, 2> ubufSizes{
|
|
|
|
// sizeof(CEnvFxShaders::Uniform),
|
|
|
|
// sizeof(CGraphics::g_Fog),
|
|
|
|
// };
|
|
|
|
// constexpr std::array<boo::PipelineStage, 2> uniformStages{
|
|
|
|
// boo::PipelineStage::Vertex,
|
|
|
|
// boo::PipelineStage::Fragment,
|
|
|
|
// };
|
|
|
|
// std::array<boo::ObjToken<boo::ITexture>, 2> textures{
|
|
|
|
// fxMgr.xb74_txtrSnowFlake->GetBooTexture(),
|
|
|
|
// fxMgr.x40_txtrEnvGradient->GetBooTexture(),
|
|
|
|
// };
|
|
|
|
//
|
|
|
|
// grid.m_snowBinding = ctx.newShaderDataBinding(
|
|
|
|
// m_snowPipeline, nullptr, iBufInfo.first.get(), nullptr, uniforms.size(), uniforms.data(), uniformStages.data(),
|
|
|
|
// ubufOffsets.data(), ubufSizes.data(), textures.size(), textures.data(), nullptr, nullptr, 0, iBufInfo.second);
|
|
|
|
// textures[0] = fxMgr.xc48_underwaterFlake->GetBooTexture();
|
|
|
|
// grid.m_underwaterBinding =
|
|
|
|
// ctx.newShaderDataBinding(m_underwaterPipeline, nullptr, iBufInfo.first.get(), nullptr, uniforms.size(),
|
|
|
|
// uniforms.data(), uniformStages.data(), ubufOffsets.data(), ubufSizes.data(),
|
|
|
|
// textures.size(), textures.data(), nullptr, nullptr, 0, iBufInfo.second);
|
2018-11-02 08:16:16 +00:00
|
|
|
}
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|