Do not render shadows for waterPlane.
This commit is contained in:
parent
3ad7ddf1cd
commit
8694025e08
6
level.cc
6
level.cc
@ -19,6 +19,7 @@ Level::~Level() {
|
||||
}
|
||||
for(unsigned int i = 0; i<objects.size(); 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++) {
|
||||
if (lightingPass) {
|
||||
objects.at(i)->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
||||
waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
|
||||
}
|
||||
else {
|
||||
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(){
|
||||
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();
|
||||
void setSkydomeSize(float size);
|
||||
float getSkydomeSize();
|
||||
void setWaterPlane(Object* water);
|
||||
Skydome* getSkydome();
|
||||
std::vector<Object*>* getObjects();
|
||||
std::vector<Object*>* getPhysicsObjects();
|
||||
@ -76,6 +77,7 @@ class Level {
|
||||
std::vector<Object*> physicsObjects;
|
||||
std::vector<Light> lights;
|
||||
std::vector<Trigger> triggers;
|
||||
Object* waterPlane;
|
||||
glm::vec3 ambientLight;
|
||||
glm::vec4 fogColourDay;
|
||||
glm::vec4 fogColourRise;
|
||||
|
@ -147,7 +147,7 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa
|
||||
water_vao->attachAllAttributes(water_ab);
|
||||
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);
|
||||
level->addObject(water_object);
|
||||
level->setWaterPlane(water_object);
|
||||
}
|
||||
|
||||
//load lighting parameters
|
||||
|
Loading…
Reference in New Issue
Block a user