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 add Shader skyboxShader(). 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 the advanced_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 add GLuint skyboxVAO and skyboxVBO;.
- Then, we'll add glGenVertexArrays...