Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 5 files). Show all
Unified · Split
| @@ -533,8 +533,10 @@ void MetavoxelSystem::renderHeightfieldCursor(const glm::vec3& position, float r · 532 unmodified lines | ||
| 533 | 533 | float scale = 1.0f / radius; |
| 534 | 534 | glm::vec4 sCoefficients(scale, 0.0f, 0.0f, -scale * position.x); |
| 535 | 535 | glm::vec4 tCoefficients(0.0f, 0.0f, scale, -scale * position.z); |
| 536 | + glm::vec4 rCoefficients(0.0f, 0.0f, 0.0f, 0.0f); | |
| 536 | 537 | glTexGenfv(GL_S, GL_EYE_PLANE, (const GLfloat*)&sCoefficients); |
| 537 | 538 | glTexGenfv(GL_T, GL_EYE_PLANE, (const GLfloat*)&tCoefficients); |
| 539 | + glTexGenfv(GL_R, GL_EYE_PLANE, (const GLfloat*)&rCoefficients); | |
| 538 | 540 | glActiveTexture(GL_TEXTURE0); |
| 539 | 541 | |
| 540 | 542 | glm::vec3 extents(radius, radius, radius); |
| @@ -575,12 +577,23 @@ void MetavoxelSystem::renderVoxelCursor(const glm::vec3& position, float radius) · 34 unmodified lines | ||
| 575 | 577 | glActiveTexture(GL_TEXTURE0); |
| 576 | 578 | |
| 577 | 579 | glm::vec3 extents(radius, radius, radius); |
| 578 | − CursorRenderVisitor visitor(Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), | |
| 579 | − Box(position - extents, position + extents)); | |
| 580 | − guideToAugmented(visitor); | |
| 580 | + Box bounds(position - extents, position + extents); | |
| 581 | + CursorRenderVisitor voxelVisitor(Application::getInstance()->getMetavoxels()->getVoxelBufferAttribute(), bounds); | |
| 582 | + guideToAugmented(voxelVisitor); | |
| 581 | 583 | |
| 582 | 584 | DefaultMetavoxelRendererImplementation::getVoxelCursorProgram().release(); |
| 583 | 585 | |
| 586 | + glEnableClientState(GL_TEXTURE_COORD_ARRAY); | |
| 587 | + | |
| 588 | + DefaultMetavoxelRendererImplementation::getHeightfieldCursorProgram().bind(); | |
| 589 | + | |
| 590 | + CursorRenderVisitor heightfieldVisitor(Application::getInstance()->getMetavoxels()->getHeightfieldBufferAttribute(), | |
| 591 | + bounds); | |
| 592 | + guideToAugmented(heightfieldVisitor); | |
| 593 | + | |
| 594 | + DefaultMetavoxelRendererImplementation::getHeightfieldCursorProgram().release(); | |
| 595 | + | |
| 596 | + glDisableClientState(GL_TEXTURE_COORD_ARRAY); | |
| 584 | 597 | glDisableClientState(GL_VERTEX_ARRAY); |
| 585 | 598 | |
| 586 | 599 | glDisable(GL_POLYGON_OFFSET_FILL); |
| @@ -1450,7 +1463,7 @@ void DefaultMetavoxelRendererImplementation::init() { · 863 unmodified lines | ||
| 1450 | 1463 | _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() + |
| 1451 | 1464 | "shaders/metavoxel_heightfield_cursor.vert"); |
| 1452 | 1465 | _heightfieldCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() + |
| 1453 | − "shaders/metavoxel_heightfield_cursor.frag"); | |
| 1466 | + "shaders/metavoxel_cursor.frag"); | |
| 1454 | 1467 | _heightfieldCursorProgram.link(); |
| 1455 | 1468 | |
| 1456 | 1469 | _heightfieldCursorProgram.bind(); |
| @@ -1468,7 +1481,7 @@ void DefaultMetavoxelRendererImplementation::init() { · 11 unmodified lines | ||
| 1468 | 1481 | _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Vertex, Application::resourcesPath() + |
| 1469 | 1482 | "shaders/metavoxel_voxel_cursor.vert"); |
| 1470 | 1483 | _voxelCursorProgram.addShaderFromSourceFile(QGLShader::Fragment, Application::resourcesPath() + |
| 1471 | − "shaders/metavoxel_voxel_cursor.frag"); | |
| 1484 | + "shaders/metavoxel_cursor.frag"); | |
| 1472 | 1485 | _voxelCursorProgram.link(); |
| 1473 | 1486 | } |
| 1474 | 1487 | } |