Обводка выбранного объекта

This commit is contained in:
2023-04-03 18:19:18 +03:00
committed by re.kovalev
parent 68a8f4d0d0
commit 329bea7124
2 changed files with 24 additions and 1 deletions

View File

@@ -209,7 +209,7 @@ int main(void)
lightShader.load(GL_FRAGMENT_SHADER, "shaders/lighting.frag");
lightShader.link();
// Привязка текстур
const char* gtextures_shader_names[] = {"gPosition", "gNormal", "gDiffuseP", "gAmbientSpecular", "sunShadowDepth", "pointShadowDepth", "ssao"};
const char* gtextures_shader_names[] = {"gPosition", "gNormal", "gDiffuseP", "gAmbientSpecular", "sunShadowDepth", "pointShadowDepth", "ssao", "gID"};
lightShader.bindTextures(gtextures_shader_names, sizeof(gtextures_shader_names)/sizeof(const char*));
// Загрузка данных о границах каскадов
glUniform1fv(lightShader.getUniformLoc("camera_cascade_distances"), CAMERA_CASCADE_COUNT, &camera_cascade_distances[1]);
@@ -529,6 +529,9 @@ int main(void)
gNormal.use();
gDiffuseP.use();
gAmbientSpecular.use();
gID.use();
// Идентификатор выбранного объекта для обводки
glUniform3uiv(lightShader.getUniformLoc("selectedID"), 1, (GLuint*) &selected);
// Подключаем текстуры теней
sunShadowDepth.use();
pointShadowDepth.use();