mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 09:59:44 +00:00
feat: entity translucent pass & test layered transparency pipeline
This commit is contained in:
parent
e7f030f226
commit
7522016e84
19 changed files with 484 additions and 111 deletions
46
src/graphics/core/TranslucentLayers.hpp
Normal file
46
src/graphics/core/TranslucentLayers.hpp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#pragma once
|
||||
|
||||
#include "typedefs.hpp"
|
||||
#include "commons.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
template<typename VertexStructure> class Mesh;
|
||||
struct PostProcessingVertex;
|
||||
class Shader;
|
||||
|
||||
class TranslucentLayers {
|
||||
public:
|
||||
TranslucentLayers(size_t count, uint width, uint height);
|
||||
~TranslucentLayers();
|
||||
|
||||
void resize(uint width, uint height);
|
||||
|
||||
void prepare(uint sourceFbo);
|
||||
|
||||
Bindable& getLayer(size_t index);
|
||||
|
||||
void compose(Shader& shader);
|
||||
|
||||
private:
|
||||
class Layer : public Bindable {
|
||||
public:
|
||||
uint fbo = 0;
|
||||
uint color = 0;
|
||||
uint depth = 0;
|
||||
|
||||
Layer();
|
||||
~Layer() override;
|
||||
|
||||
void bind() const override;
|
||||
void unbind() const override;
|
||||
|
||||
void allocate(uint width, uint height);
|
||||
};
|
||||
|
||||
uint width;
|
||||
uint height;
|
||||
std::vector<std::unique_ptr<Layer>> layers;
|
||||
std::unique_ptr<Mesh<PostProcessingVertex>> quadMesh;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue