metaforce/Runtime/Graphics/Shaders/CFogVolumePlaneShader.hpp

38 lines
776 B
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
#include <array>
#include <cstddef>
#include <vector>
#include "zeus/CRectangle.hpp"
#include "zeus/CVector4f.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
2018-12-08 05:30:43 +00:00
class CFogVolumePlaneShader {
template <size_t I>
friend struct CFogVolumePlanePipeline;
struct Vert {
hsh::float4 pos;
Vert(hsh::float4 pos) : pos(pos) {}
};
hsh::dynamic_owner<hsh::vertex_buffer<Vert>> m_vbo;
std::array<hsh::binding, 4> m_dataBinds;
std::vector<Vert> m_verts;
2018-12-08 05:30:43 +00:00
size_t m_vertCapacity = 0;
2018-12-08 05:30:43 +00:00
void CommitResources(size_t capacity);
public:
2018-12-08 05:30:43 +00:00
static const zeus::CRectangle DefaultRect;
void reset(size_t numVerts) {
2018-12-08 05:30:43 +00:00
m_verts.clear();
m_verts.reserve(numVerts);
}
void addFan(const zeus::CVector3f* verts, size_t numVerts);
void draw(size_t pass);
};
2018-12-08 05:30:43 +00:00
} // namespace urde