GlistEngine
Loading...
Searching...
No Matches
gSkybox.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Nitra Games Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef GRAPHICS_GSKYBOX_H_
18#define GRAPHICS_GSKYBOX_H_
19
20#include <array>
21#include <string>
22#include "gNode.h"
23#include "gVbo.h"
24#include "gImage.h"
25
29class gSkybox : public gNode {
30public:
32 virtual ~gSkybox();
33
38 unsigned int loadTextures(const std::vector<std::string>& texturePaths);
39
44 unsigned int load(const std::vector<std::string>& fullPaths);
45
46 unsigned int loadEquirectangular(const std::string& fullPath);
47 unsigned int loadTextureEquirectangular(const std::string& texturePath);
48
49 void loadFromData(std::array<int, 6> widths, std::array<int, 6> heights, std::array<void*, 6> rawdata, std::array<bool, 6> ishdr);
50
55 void draw();
56
59
60 void loadSkybox(gImage* images);
61 void loadDataSkybox(std::string* data, int width, int height);
62private:
63 unsigned int id;
64 int width, height, nrChannels;
65 void setupRenderData();
66
67 unsigned int cubeVAO, cubeVBO;
68 unsigned int skyboxVAO, skyboxVBO;
69
70 gShader* skyboxshader;
71
72 gVbo vbo;
73 int skymapint, skymapslot;
74
75 //Equirectangular variables and objects
76 gShader* pbrShader;
77 gShader* equirectangularToCubemapShader;
78 gShader* irradianceShader;
79 gShader* prefilterShader;
80 gShader* brdfShader;
81
82 unsigned int captureFBO;
83 unsigned int captureRBO;
84 unsigned int irradianceMap;
85 unsigned int prefilterMap;
86 unsigned int brdfLUTTexture;
87 unsigned int quadVAO;
88 unsigned int quadVBO;
89
90 void renderCube();
91 void renderQuad();
92
93 bool ishdr, ispbr;
94};
95
96#endif /* GRAPHICS_GSKYBOX_H_ */
Definition gImage.h:34
Definition gNode.h:15
Definition gShader.h:19
Definition gSkybox.h:29
void draw()
unsigned int load(const std::vector< std::string > &fullPaths)
unsigned int loadTextures(const std::vector< std::string > &texturePaths)
virtual ~gSkybox()
unsigned int loadEquirectangular(const std::string &fullPath)
void loadFromData(std::array< int, 6 > widths, std::array< int, 6 > heights, std::array< void *, 6 > rawdata, std::array< bool, 6 > ishdr)
void loadSkybox(gImage *images)
void generatePbrMaps()
void bindPbrMaps()
unsigned int loadTextureEquirectangular(const std::string &texturePath)
void loadDataSkybox(std::string *data, int width, int height)
Definition gVbo.h:30