Add Skybox

This commit is contained in:
4VRDriver
2020-09-19 00:21:49 +02:00
parent 717447eebf
commit 242b50e9ef
14 changed files with 220 additions and 13 deletions

View File

@@ -78,6 +78,7 @@ void Controller::run() {
ShaderProgram shaderProgram("res/shaders/basic.vert", "res/shaders/basic.frag");
ShaderProgram lightProgram("res/shaders/light.vert", "res/shaders/light.frag");
ShaderProgram skyboxProgram("res/shaders/skybox.vert", "res/shaders/skybox.frag");
//Model model_backpack("res/models/backpack.ffo");
//Model model_plant("res/models/plant.ffo");
@@ -104,6 +105,8 @@ void Controller::run() {
lightSource.setRotation(glm::vec3(0.f));
lightSource.setPosition(glm::vec3(-2.f, 1.5f, 2.f));
Skybox skybox(&model_cube, &skyboxProgram, "res/textures/skybox/");
World world(&shaderProgram);
world.addEntity(dragon);
world.addEntity(lightSource);
@@ -137,6 +140,8 @@ void Controller::run() {
camera->lookForward();
camera->updateVPM();
skybox.draw(camera->getView(), camera->getProj());
world.draw(camera->getViewProj(), camera->getPosition());
#ifdef _DEBUG