1
0
Fork 0
Univerxel/src/client/render/gl/pass/VoxelProgram.hpp

48 lines
1.2 KiB
C++
Raw Normal View History

2020-07-10 17:49:16 +00:00
#pragma once
#include "Program.hpp"
2020-07-25 16:45:03 +00:00
namespace pass {
2020-08-30 16:35:45 +00:00
/// Abstract voxels pass
class VoxelProgram: public Program {
2020-07-25 16:45:03 +00:00
public:
2020-09-26 22:05:43 +00:00
using options = render::passOptions;
2020-07-25 16:45:03 +00:00
2020-08-30 16:35:45 +00:00
VoxelProgram(const options &opts, std::vector<std::string> flags = {});
~VoxelProgram();
2020-07-25 16:45:03 +00:00
2020-09-26 22:05:43 +00:00
void start(render::gl::Renderer *);
2020-08-30 16:35:45 +00:00
protected:
2020-09-26 22:05:43 +00:00
buffer::params setup(render::gl::Renderer *);
2020-07-25 16:45:03 +00:00
2020-08-30 16:35:45 +00:00
std::string getName() const override;
2020-07-25 16:45:03 +00:00
void setView(const GLfloat *matrix);
2020-08-14 16:56:28 +00:00
void setProj(const GLfloat *matrix);
2020-07-25 16:45:03 +00:00
void bindTexture(const GLuint textureID);
void bindNormal(const GLuint textureID);
void bindHOS(const GLuint textureID);
void setLightInvDir(const GLfloat *pos);
void setFog(const GLfloat *color, GLfloat depth);
2020-08-14 16:56:28 +00:00
void setSphereProj(const GLfloat *offRad);
void setCurvature(GLfloat ratio);
2020-07-25 16:45:03 +00:00
private:
GLuint ViewMatrixID;
2020-08-14 16:56:28 +00:00
GLuint ProjMatrixID;
2020-07-25 16:45:03 +00:00
GLuint TextureID;
GLuint NormalID;
GLuint HOSID;
GLuint LightInvDirID;
GLuint FogDepthID;
GLuint FogColorID;
2020-08-14 16:56:28 +00:00
GLuint SphereProjID;
GLuint CurvatureID;
2020-07-10 17:49:16 +00:00
};
2020-07-25 16:45:03 +00:00
}