Запись идентификатора в uniform-буфер

This commit is contained in:
2023-04-03 14:52:24 +03:00
committed by re.kovalev
parent 9bcd8c06c5
commit c37566d406
4 changed files with 31 additions and 2 deletions

View File

@@ -70,6 +70,13 @@ struct Material
Material() : ka(0.2f), kd(0.2f), ks(0.2f), p(1), normalmapped(false), parallaxmapped(false), displacementmapped(false) { };
};
// Идентификатор модели
struct ID
{
GLuint64 value = 0; // Идентификатор
GLuint etc = 0; // Дополнительная информация
};
// Класс модели
class Model : public Node
{
@@ -92,6 +99,8 @@ class Model : public Node
void set_texture(Texture& texture); // Привязка текстуры к модели
Material material; // Материал модели
ID id; // ID модели
private:
VAO vao;
BO vertex_vbo, index_vbo; // вершинный и индексный буферы

View File

@@ -19,6 +19,8 @@ class Scene
void render(ShaderProgram &shaderProgram, UBO &material_buffer); // Рендер сцены
void set_group_id(GLuint64 id, GLuint etc = 0); // Изменение флага записи идентификатора для всех моделей
Node root; // Корневой узел
// Списки объектов, выступающих узлами