Showing the changes to interface/src/VoxelSystem.cpp (1 of 21 files). Show all
Unified · Split
| @@ -545,7 +545,6 @@ glm::vec3 VoxelSystem::computeVoxelVertex(const glm::vec3& startVertex, float vo · 544 unmodified lines | ||
| 545 | 545 | return startVertex + glm::vec3(identityVertex[0], identityVertex[1], identityVertex[2]) * voxelScale; |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | −bool VoxelSystem::_perlinModulateProgramInitialized = false; | |
| 549 | 548 | ProgramObject VoxelSystem::_perlinModulateProgram; |
| 550 | 549 | |
| 551 | 550 | void VoxelSystem::init() { |
| @@ -634,7 +633,7 @@ void VoxelSystem::init() { · 82 unmodified lines | ||
| 634 | 633 | |
| 635 | 634 | |
| 636 | 635 | // create our simple fragment shader if we're the first system to init |
| 637 | − if (!_perlinModulateProgramInitialized) { | |
| 636 | + if (!_perlinModulateProgram.isLinked()) { | |
| 638 | 637 | switchToResourcesParentIfRequired(); |
| 639 | 638 | _perlinModulateProgram.addShaderFromSourceFile(QGLShader::Vertex, "resources/shaders/perlin_modulate.vert"); |
| 640 | 639 | _perlinModulateProgram.addShaderFromSourceFile(QGLShader::Fragment, "resources/shaders/perlin_modulate.frag"); |
| @@ -643,8 +642,6 @@ void VoxelSystem::init() { · 2 unmodified lines | ||
| 643 | 642 | _perlinModulateProgram.bind(); |
| 644 | 643 | _perlinModulateProgram.setUniformValue("permutationNormalTexture", 0); |
| 645 | 644 | _perlinModulateProgram.release(); |
| 646 | − | |
| 647 | − _perlinModulateProgramInitialized = true; | |
| 648 | 645 | } |
| 649 | 646 | _initialized = true; |
| 650 | 647 | } |