Showing the changes to interface/src/VoxelSystem.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1266,16 +1266,16 @@ void VoxelSystem::render(bool texture) { · 1265 unmodified lines | ||
| 1266 | 1266 | glm::vec2 viewDimensions = Application::getInstance()->getViewportDimensions(); |
| 1267 | 1267 | float viewportWidth = viewDimensions.x; |
| 1268 | 1268 | float viewportHeight = viewDimensions.y; |
| 1269 | + glm::vec3 cameraPosition = Application::getInstance()->getViewFrustum()->getPosition(); | |
| 1270 | + PointShader& pointShader = Application::getInstance()->getPointShader(); | |
| 1269 | 1271 | |
| 1270 | − Application::getInstance()->getPointShader().begin(); | |
| 1272 | + pointShader.begin(); | |
| 1271 | 1273 | |
| 1272 | − int uniformLocation = Application::getInstance()->getPointShader().uniformLocation("viewportWidth"); | |
| 1273 | − Application::getInstance()->getPointShader().setUniformValue(uniformLocation, viewportWidth); | |
| 1274 | + pointShader.setUniformValue(pointShader.uniformLocation("viewportWidth"), viewportWidth); | |
| 1275 | + pointShader.setUniformValue(pointShader.uniformLocation("viewportHeight"), viewportHeight); | |
| 1276 | + pointShader.setUniformValue(pointShader.uniformLocation("cameraPosition"), cameraPosition); | |
| 1274 | 1277 | |
| 1275 | − uniformLocation = Application::getInstance()->getPointShader().uniformLocation("viewportHeight"); | |
| 1276 | − Application::getInstance()->getPointShader().setUniformValue(uniformLocation, viewportHeight); | |
| 1277 | − | |
| 1278 | − attributeLocation = Application::getInstance()->getVoxelShader().attributeLocation("voxelSizeIn"); | |
| 1278 | + attributeLocation = pointShader.attributeLocation("voxelSizeIn"); | |
| 1279 | 1279 | glEnableVertexAttribArray(attributeLocation); |
| 1280 | 1280 | glVertexAttribPointer(attributeLocation, 1, GL_FLOAT, false, sizeof(VoxelShaderVBOData), BUFFER_OFFSET(3*sizeof(float))); |
| 1281 | 1281 | } |