diff --git a/Drizzle3D/OpenGL.cpp b/Drizzle3D/OpenGL.cpp index 7137caa..c2d2ccb 100644 --- a/Drizzle3D/OpenGL.cpp +++ b/Drizzle3D/OpenGL.cpp @@ -95,6 +95,9 @@ namespace Drizzle3D { glUniform1f(glGetUniformLocation(shaderProgram, (lightPrefix + ".quadratic").c_str()), Lights[i].quadratic); } for (const auto& obje : Objects) { + if (obje.hide) + continue; + } else { if (obje.mat != shaderProgram) { glUseProgram(obje.mat); GLuint viewMatrixLoc = glGetUniformLocation(obje.mat, "viewMatrix"); @@ -178,9 +181,10 @@ namespace Drizzle3D { glBindVertexArray(obje.VertexArray); glDrawElements(GL_TRIANGLES, obje.indices.size(), GL_UNSIGNED_INT, 0); } + } glUseProgram(0); glDisable(GL_CULL_FACE); } -} \ No newline at end of file +} diff --git a/Drizzle3D/RenderingLayer.h b/Drizzle3D/RenderingLayer.h index d0ad5a2..54fbd0e 100644 --- a/Drizzle3D/RenderingLayer.h +++ b/Drizzle3D/RenderingLayer.h @@ -55,6 +55,7 @@ namespace Drizzle3D { GLuint textureID = NULL; GLuint mat = 0; char* name = (char*)"PLZ_SPECIFY_A_NAME"; + bool hide = false; // Add New Vulkan Shader here as pass it NULL by default. }; @@ -121,4 +122,4 @@ namespace Drizzle3D { std::shared_ptr resourcemgr; Logging log; }; -} \ No newline at end of file +} diff --git a/Drizzle3D/Vulkan.cpp b/Drizzle3D/Vulkan.cpp index 4f440d7..72f05aa 100644 --- a/Drizzle3D/Vulkan.cpp +++ b/Drizzle3D/Vulkan.cpp @@ -35,6 +35,9 @@ namespace Drizzle3D { // Set its values } for (const auto& obje : Objects) { + if (obje.hide) { + continue; + } else { // Look at Object struct in RenderingLayer.h if (false) { // If Default Vulkan shader is not equal to Vulkan Shader Inside "obje" @@ -85,7 +88,7 @@ namespace Drizzle3D { // Pass Vulkan Shader the ModelMatrix } - + } // Bind Vertex Array inside of "obje" // Draw Vertexs } @@ -101,4 +104,4 @@ namespace Drizzle3D { // Copy vertex data to vertex buffer // Create index buffer (similar to vertex buffer) } -} \ No newline at end of file +}