mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 03:09:18 +02:00
work
This commit is contained in:
@@ -12,7 +12,7 @@ gl::postfx::postfx(const std::string &s) : postfx(shader("postfx_" + s + ".frag"
|
||||
gl::postfx::postfx(const shader &s)
|
||||
{
|
||||
if (!vertex)
|
||||
vertex = std::make_shared<gl::shader>("postfx.vert");
|
||||
vertex = std::make_shared<gl::shader>("quad.vert");
|
||||
if (!vao)
|
||||
vao = std::make_shared<gl::vao>();
|
||||
|
||||
|
||||
@@ -105,7 +105,10 @@ void gl::program::init()
|
||||
i++;
|
||||
}
|
||||
|
||||
glUniform1i(glGetUniformLocation(*this, "shadowmap"), 10); //m7t: do something better
|
||||
//tbd: do something better
|
||||
|
||||
glUniform1i(glGetUniformLocation(*this, "shadowmap"), MAX_TEXTURES + 0);
|
||||
glUniform1i(glGetUniformLocation(*this, "envmap"), MAX_TEXTURES + 1);
|
||||
|
||||
GLuint index;
|
||||
|
||||
|
||||
8
gl/ubo.h
8
gl/ubo.h
@@ -31,14 +31,17 @@ namespace gl
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
const size_t MAX_TEXTURES = 4;
|
||||
|
||||
struct scene_ubs
|
||||
{
|
||||
glm::mat4 projection;
|
||||
glm::mat4 lightview;
|
||||
float time;
|
||||
UBS_PAD(12)
|
||||
};
|
||||
|
||||
static_assert(sizeof(scene_ubs) == 132, "bad size of ubs");
|
||||
static_assert(sizeof(scene_ubs) == 144, "bad size of ubs");
|
||||
|
||||
const size_t MAX_PARAMS = 3;
|
||||
|
||||
@@ -51,6 +54,7 @@ namespace gl
|
||||
glm::vec3 velocity;
|
||||
float opacity;
|
||||
float emission;
|
||||
UBS_PAD(12)
|
||||
|
||||
void set_modelview(const glm::mat4 &mv)
|
||||
{
|
||||
@@ -59,7 +63,7 @@ namespace gl
|
||||
}
|
||||
};
|
||||
|
||||
static_assert(sizeof(model_ubs) == 156 + 8 * MAX_PARAMS, "bad size of ubs");
|
||||
static_assert(sizeof(model_ubs) == 144 + 16 * MAX_PARAMS, "bad size of ubs");
|
||||
|
||||
struct light_element_ubs
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user