Changed skybox to skydome.

This commit is contained in:
Faerbit 2014-11-22 00:39:58 +01:00
parent 59796882e4
commit 3a9a04d4d6
6 changed files with 1044 additions and 13 deletions

1031
Levels/Geometry/skydome.obj Normal file

File diff suppressed because it is too large Load Diff

BIN
Levels/Textures/skydome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB

View File

@ -140,7 +140,7 @@ void Graphics::render(Level* level, ACGL::OpenGL::SharedShaderProgram shader)
}
// set fog Parameters
shader->setUniform("fogStart", (float)((farPlane-40.0f)/sqrt(2)));
shader->setUniform("fogStart", (float)((farPlane/2.0f)-20.0f));
shader->setUniform("fogColor", level->getFogColor());
shader->setUniform("cameraCenter", level->getCameraCenter()->getPosition());

View File

@ -5,7 +5,7 @@
Level::Level(std::string filePath){
this->filePath = filePath;
this->terrain = Terrain(filePath + "/terrain");
skyboxSize = 50.0f;
skydomeSize = 50.0f;
}
Level::Level() {
@ -30,11 +30,11 @@ void Level::load(ACGL::OpenGL::SharedShaderProgram shader) {
objects.push_back(object);
this->physics.addPlayer(1.25f,object,8.0f,1);
Model skyboxModel = Model("skybox.obj", skyboxSize);
Material skyboxMaterial = Material("skybox.png", 0.7f, 0.0f, 0.0f, 0.0f);
Object skyboxObject = Object(skyboxModel, skyboxMaterial, glm::vec3(0.0f, 0.0f, 0.0f),
Model skydomeModel = Model("skydome.obj", skydomeSize);
Material skydomeMaterial = Material("skydome.png", 0.7f, 0.0f, 0.0f, 0.0f);
Object skydomeObject = Object(skydomeModel, skydomeMaterial, glm::vec3(0.0f, 0.0f, 0.0f),
glm::vec3(0.0f, 0.0f, 0.0f), shader);
objects.push_back(skyboxObject);
objects.push_back(skydomeObject);
Model torchModel = Model("torch.obj", 0.75f);
Material torchMaterial = Material("torchTexture.png", 0.1f, 0.3f, 0.7f, 10.0f);
@ -62,7 +62,7 @@ void Level::load(ACGL::OpenGL::SharedShaderProgram shader) {
//set lighting parameters
ambientLight = glm::vec3(1.0f, 1.0f, 1.0f);
fogColor = glm::vec4(0.10f, 0.14f, 0.14f, 1.0f);
directionalLight = Light(glm::vec3(-0.5f, 0.0f, -0.5f), glm::vec3(1.0f, 1.0f, 0.0f), 0.4f);
directionalLight = Light(glm::vec3(-0.1f, 0.8f, -0.9f), glm::vec3(1.0f, 1.0f, 0.9f), 0.2f);
Light light = Light(glm::vec3(-3.0f, 7.0f, 0.0f), glm::vec3(1.0f, 1.0f, 1.0f), 5.0f);
lights.push_back(light);
Light light2 = Light(glm::vec3(3.0f, 7.0f, 0.0f), glm::vec3(1.0f, 1.0f, 1.0f), 10.0f);
@ -156,6 +156,6 @@ glm::vec3 Level::getCameraPosition() {
return cameraCenter->getPosition() + camera.getVector();
}
void Level::setSkyboxSize(float size) {
skyboxSize = size;
void Level::setSkydomeSize(float size) {
skydomeSize = size;
}

View File

@ -25,7 +25,7 @@ class Level {
Camera* getCamera();
glm::vec3 getCameraPosition();
glm::vec4 getFogColor();
void setSkyboxSize(float size);
void setSkydomeSize(float size);
private:
std::string filePath;
std::vector<Object> objects;
@ -38,7 +38,7 @@ class Level {
Physics physics;
Camera camera;
Terrain terrain;
float skyboxSize;
float skydomeSize;
};
#endif

View File

@ -17,7 +17,7 @@
#include <ACGL/Base/Settings.hh>
Application::Application() {
graphics = Graphics(glm::uvec2(1024, 786), 0.1f, 100.0f);
graphics = Graphics(glm::uvec2(1024, 786), 0.1f, 150.0f);
}
Graphics* Application::getGraphics() {
@ -35,7 +35,7 @@ ACGL::OpenGL::SharedShaderProgram Application::getShader() {
void Application::init()
{
// set Skybox size
level.setSkyboxSize((graphics.getFarPlane()-32.0f)/sqrt(2));
level.setSkydomeSize((graphics.getFarPlane()/2.0f)-10.0f);
// define where shaders and textures can be found:
ACGL::Base::Settings::the()->setResourcePath("../");