Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 3 files). Show all
Unified · Split
| @@ -388,6 +388,9 @@ void HeightfieldBuffer::render() { · 387 unmodified lines | ||
| 388 | 388 | glActiveTexture(GL_TEXTURE1); |
| 389 | 389 | glBindTexture(GL_TEXTURE_2D, _colorTextureID); |
| 390 | 390 | |
| 391 | + DefaultMetavoxelRendererImplementation::getHeightfieldProgram().setUniformValue( | |
| 392 | + DefaultMetavoxelRendererImplementation::getHeightScaleLocation(), 1.0f / _heightSize); | |
| 393 | + | |
| 391 | 394 | glDrawRangeElements(GL_QUADS, 0, vertexCount - 1, indexCount, GL_UNSIGNED_INT, 0); |
| 392 | 395 | |
| 393 | 396 | glBindTexture(GL_TEXTURE_2D, 0); |
| @@ -470,6 +473,7 @@ void DefaultMetavoxelRendererImplementation::init() { · 76 unmodified lines | ||
| 470 | 473 | _heightfieldProgram.bind(); |
| 471 | 474 | _heightfieldProgram.setUniformValue("heightMap", 0); |
| 472 | 475 | _heightfieldProgram.setUniformValue("diffuseMap", 1); |
| 476 | + _heightScaleLocation = _heightfieldProgram.uniformLocation("heightScale"); | |
| 473 | 477 | _heightfieldProgram.release(); |
| 474 | 478 | } |
| 475 | 479 | } |
| @@ -766,6 +770,7 @@ void DefaultMetavoxelRendererImplementation::render(MetavoxelData& data, Metavox · 290 unmodified lines | ||
| 766 | 770 | ProgramObject DefaultMetavoxelRendererImplementation::_pointProgram; |
| 767 | 771 | int DefaultMetavoxelRendererImplementation::_pointScaleLocation; |
| 768 | 772 | ProgramObject DefaultMetavoxelRendererImplementation::_heightfieldProgram; |
| 773 | +int DefaultMetavoxelRendererImplementation::_heightScaleLocation; | |
| 769 | 774 | |
| 770 | 775 | static void enableClipPlane(GLenum plane, float x, float y, float z, float w) { |
| 771 | 776 | GLdouble coefficients[] = { x, y, z, w }; |