Do not render shadows for waterPlane.
This commit is contained in:
parent
5d9df519a6
commit
d129989b5f
6
level.cc
6
level.cc
@ -19,6 +19,7 @@ Level::~Level() {
|
|||||||
}
|
}
|
||||||
for(unsigned int i = 0; i<objects.size(); i++) {
|
for(unsigned int i = 0; i<objects.size(); i++) {
|
||||||
delete(objects.at(i));
|
delete(objects.at(i));
|
||||||
|
delete(waterPlane);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
|
|||||||
for(unsigned int i = 0; i<objects.size(); i++) {
|
for(unsigned int i = 0; i<objects.size(); i++) {
|
||||||
if (lightingPass) {
|
if (lightingPass) {
|
||||||
objects.at(i)->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
objects.at(i)->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
||||||
|
waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs);
|
objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs);
|
||||||
@ -319,3 +321,7 @@ void Level::forceMove(float x, float y, float z, unsigned indice){
|
|||||||
void Level::activateEndgame(){
|
void Level::activateEndgame(){
|
||||||
physics.activateEndgame();
|
physics.activateEndgame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Level::setWaterPlane(Object* water) {
|
||||||
|
this->waterPlane = water;
|
||||||
|
}
|
||||||
|
2
level.hh
2
level.hh
@ -39,6 +39,7 @@ class Level {
|
|||||||
glm::vec4 getFogColourNight();
|
glm::vec4 getFogColourNight();
|
||||||
void setSkydomeSize(float size);
|
void setSkydomeSize(float size);
|
||||||
float getSkydomeSize();
|
float getSkydomeSize();
|
||||||
|
void setWaterPlane(Object* water);
|
||||||
Skydome* getSkydome();
|
Skydome* getSkydome();
|
||||||
std::vector<Object*>* getObjects();
|
std::vector<Object*>* getObjects();
|
||||||
std::vector<Object*>* getPhysicsObjects();
|
std::vector<Object*>* getPhysicsObjects();
|
||||||
@ -76,6 +77,7 @@ class Level {
|
|||||||
std::vector<Object*> physicsObjects;
|
std::vector<Object*> physicsObjects;
|
||||||
std::vector<Light> lights;
|
std::vector<Light> lights;
|
||||||
std::vector<Trigger> triggers;
|
std::vector<Trigger> triggers;
|
||||||
|
Object* waterPlane;
|
||||||
glm::vec3 ambientLight;
|
glm::vec3 ambientLight;
|
||||||
glm::vec4 fogColourDay;
|
glm::vec4 fogColourDay;
|
||||||
glm::vec4 fogColourRise;
|
glm::vec4 fogColourRise;
|
||||||
|
@ -147,7 +147,7 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa
|
|||||||
water_vao->attachAllAttributes(water_ab);
|
water_vao->attachAllAttributes(water_ab);
|
||||||
Material water_material = Material(waterTexture, 0.1f, 0.2f, 0.8f, 5.0f, true);
|
Material water_material = Material(waterTexture, 0.1f, 0.2f, 0.8f, 5.0f, true);
|
||||||
Object* water_object = new Object(water_vao, water_material, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), true);
|
Object* water_object = new Object(water_vao, water_material, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), true);
|
||||||
level->addObject(water_object);
|
level->setWaterPlane(water_object);
|
||||||
}
|
}
|
||||||
|
|
||||||
//load lighting parameters
|
//load lighting parameters
|
||||||
|
Loading…
Reference in New Issue
Block a user