Slight fps increas by reducing the amount the point lights have to render.
This commit is contained in:
parent
1fd6058eaf
commit
2a3f976b5e
@ -361,7 +361,7 @@ void Graphics::render(double time)
|
|||||||
depthCubeShader->setUniform("farPlane", farPlane);
|
depthCubeShader->setUniform("farPlane", farPlane);
|
||||||
// render depth textures for point lights
|
// render depth textures for point lights
|
||||||
glViewport(0, 0, cube_size, cube_size);
|
glViewport(0, 0, cube_size, cube_size);
|
||||||
glm::mat4 depthProjectionMatrix_pointlights = glm::perspective(1.571f, (float)cube_size/(float)cube_size, 0.1f, farPlane);
|
glm::mat4 depthProjectionMatrix_pointlights = glm::perspective(1.571f, (float)cube_size/(float)cube_size, 0.1f, 50.0f);
|
||||||
glm::vec3 looking_directions[6] = {glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(-1.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f),
|
glm::vec3 looking_directions[6] = {glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(-1.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f),
|
||||||
glm::vec3(0.0f, -1.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.0f, 0.0f, -1.0f)};
|
glm::vec3(0.0f, -1.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.0f, 0.0f, -1.0f)};
|
||||||
glm::vec3 upvectors[6] = {glm::vec3(0.0f, -1.0f, 0.0f),glm::vec3(0.0f, -1.0f, 0.0f),glm::vec3(0.0f, 0.0f, -1.0f),
|
glm::vec3 upvectors[6] = {glm::vec3(0.0f, -1.0f, 0.0f),glm::vec3(0.0f, -1.0f, 0.0f),glm::vec3(0.0f, 0.0f, -1.0f),
|
||||||
|
@ -61,6 +61,9 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
|
|||||||
else {
|
else {
|
||||||
renderDistance = ((((int)skydomeSize)+chunkSize/2)/chunkSize) + 1;
|
renderDistance = ((((int)skydomeSize)+chunkSize/2)/chunkSize) + 1;
|
||||||
}
|
}
|
||||||
|
if(!lightingPass) {
|
||||||
|
renderDistance = 1;
|
||||||
|
}
|
||||||
int xPosition = ((int)cameraCenter->getPosition().x + (terrain.getHeightmapWidth()/2))/chunkSize;
|
int xPosition = ((int)cameraCenter->getPosition().x + (terrain.getHeightmapWidth()/2))/chunkSize;
|
||||||
int zPosition = ((int)cameraCenter->getPosition().z + (terrain.getHeightmapHeight()/2))/chunkSize;
|
int zPosition = ((int)cameraCenter->getPosition().z + (terrain.getHeightmapHeight()/2))/chunkSize;
|
||||||
int xStart = xPosition - renderDistance;
|
int xStart = xPosition - renderDistance;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
|
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
|
||||||
using namespace tinyxml2;
|
using namespace tinyxml2;
|
||||||
|
|
||||||
const int chunkSize = 30;
|
const int chunkSize = 25;
|
||||||
|
|
||||||
Loader::Loader() {
|
Loader::Loader() {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user