History

More work on avatar voxels.

Andrzej Kapolka committed 13 years ago

Commit 6c975f91 parent 7425b396 files · +121 −19Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 6 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+16−8
@@ -625,10 +625,7 @@ void VoxelSystem::render(bool texture) { · 624 unmodified lines
625 glBindBuffer(GL_ARRAY_BUFFER, _vboColorsID);625 glBindBuffer(GL_ARRAY_BUFFER, _vboColorsID);
626 glColorPointer(3, GL_UNSIGNED_BYTE, 0, 0);626 glColorPointer(3, GL_UNSIGNED_BYTE, 0, 0);
627 627
628 if (texture) {628 bindProgram(texture);
629 _perlinModulateProgram->bind();
630 glBindTexture(GL_TEXTURE_2D, _permutationNormalTextureID);
631 }
632 629
633 // for performance, disable blending and enable backface culling630 // for performance, disable blending and enable backface culling
634 glDisable(GL_BLEND);631 glDisable(GL_BLEND);
@@ -643,10 +640,7 @@ void VoxelSystem::render(bool texture) { · 8 unmodified lines
643 glEnable(GL_BLEND);640 glEnable(GL_BLEND);
644 glDisable(GL_CULL_FACE);641 glDisable(GL_CULL_FACE);
645 642
646 if (texture) {643 releaseProgram(texture);
647 _perlinModulateProgram->release();
648 glBindTexture(GL_TEXTURE_2D, 0);
649 }
650 644
651 // deactivate vertex and color arrays after drawing645 // deactivate vertex and color arrays after drawing
652 glDisableClientState(GL_VERTEX_ARRAY);646 glDisableClientState(GL_VERTEX_ARRAY);
@@ -663,6 +657,20 @@ void VoxelSystem::render(bool texture) { · 10 unmodified lines
663 pthread_mutex_unlock(&_bufferWriteLock);657 pthread_mutex_unlock(&_bufferWriteLock);
664}658}
665 659
660void VoxelSystem::bindProgram(bool texture) {
661 if (texture) {
662 _perlinModulateProgram->bind();
663 glBindTexture(GL_TEXTURE_2D, _permutationNormalTextureID);
664 }
665}
666
667void VoxelSystem::releaseProgram(bool texture) {
668 if (texture) {
669 _perlinModulateProgram->release();
670 glBindTexture(GL_TEXTURE_2D, 0);
671 }
672}
673
666int VoxelSystem::_nodeCount = 0;674int VoxelSystem::_nodeCount = 0;
667 675
668void VoxelSystem::killLocalVoxels() {676void VoxelSystem::killLocalVoxels() {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t