LearnOpenGL/src/Renderer/SkyboxPass.cpp
Nigel 85263312cd Refactor
Refactoring the render engine to feel a little better organized. One major issue remains with the model not rendering at the time. Possibly this is solved after fixing the outline render pass
2023-02-03 16:33:02 +01:00

28 lines
598 B
C++

#include "SkyboxPass.h"
SkyboxPass::SkyboxPass(Skybox& skybox, Camera& camera, glm::mat4& projection) : RenderPass("Render Pass - Skybox", "../Shaders/skybox.vs", "../Shaders/Cubemap.fs"),
skybox(skybox),
camera(camera),
projection(projection)
{
}
void SkyboxPass::Render()
{
glDepthMask(GL_FALSE);
m_shader.use();
m_shader.setMat4("projection", projection);
glm::mat4 centeredView = glm::mat4(glm::mat3(camera.GetViewMatrix()));
m_shader.setMat4("view", centeredView);
skybox.Bind();
glDrawArrays(GL_TRIANGLES, 0, 36);
skybox.Unbind();
glDepthMask(GL_TRUE);
}