X-Git-Url: https://git.lukelau.me/?p=opengl.git;a=blobdiff_plain;f=skybox.hpp;h=6961e8d861104d82843739e28978e399b7104d12;hp=f1ac4ee9a19c2ab3bab08440c496e49515855756;hb=d0c631f46c6db417e013b1bc0edec24cb9c2824a;hpb=c44e69ec78367fb2957324026894aef970f2481a diff --git a/skybox.hpp b/skybox.hpp index f1ac4ee..6961e8d 100644 --- a/skybox.hpp +++ b/skybox.hpp @@ -1,13 +1,28 @@ +#ifndef SKYBOX_HPP +#define SKYBOX_HPP + #include #include #include #include #include "program.hpp" +#include "image.hpp" class Skybox { public: - Skybox(const std::vector faces); + // img must be HDR + Skybox(const Image img); void draw(glm::mat4 proj, glm::mat4 view) const; + GLuint getTexture() const { return cubemapTexId; } + GLuint getIrradianceMap() const { return irradianceTexId; } + GLuint getPrefilterMap() const { return prefilterTexId; } + GLuint getBRDFMap() const { return brdfMapTexId; } private: - GLuint texId, vao; + GLuint hdrTexId, cubemapTexId, irradianceTexId, prefilterTexId, brdfMapTexId; + GLuint captureFBO, captureRBO; + GLuint vao; const Program program; + void generatePrefilterMap() const; + void generateBRDFMap() const; }; + +#endif