In the main.cpp
file, there are a few changes we need to make. Follow the steps shown here:
- First of all, we need to create a new shader object, so before we define
GLfloat cubeVertices[]
, we need to addShaderskyboxShader()
. And, to that we'll pass the locations of our shader files:"res/shaders/skybox.vs"
and"res/shaders/skybox.frag"
. - Next, we're going to need some more vertices for the skybox. Luckily, you can refer those to the
main.cpp
file present inside theadvanced_opengl
folder. Add these vertices to our code. - Once you've got the skybox vertices all set up, you will need to create a vertex array object and vertex buffer object for the skybox. So, let's do that right now.
- After we have defined
glBindVertexArray(0)
, we'll addGLuint skyboxVAO
andskyboxVBO;
. - Then, we'll add
glGenVertexArrays();
the vertex array is going to take the parameter1
and then a skybox vertex array object,skyboxVAO
. Next, we're going to generate the buffers into the skybox...