diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 1f2767bd46..a0133ec1c4 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -598,17 +598,25 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix); const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset()); // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr - //LLVertexBuffer::unbind(); - //glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions); - //if (vol_face.mTexCoords) - //{ - // glEnableClientState(GL_TEXTURE_COORD_ARRAY); - // glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords); - //} - //gGL.syncMatrices(); - //glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices); - //glDisableClientState(GL_TEXTURE_COORD_ARRAY); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mNumVertices, vol_face.mPositions, vol_face.mTexCoords, vol_face.mNumIndices, vol_face.mIndices); + if (LLGLSLShader::sNoFixedFunction) + { + LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mNumVertices, vol_face.mPositions, vol_face.mTexCoords, vol_face.mNumIndices, vol_face.mIndices); + } + else + { + // + LLVertexBuffer::unbind(); + glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions); + if (vol_face.mTexCoords) + { + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords); + } + gGL.syncMatrices(); + glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + } // } } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index d4fcb5a81c..fe1c0c9761 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2611,24 +2611,32 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) if (phys_volume->mHullPoints && phys_volume->mHullIndices) { // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr - //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - //llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); - //LLVertexBuffer::unbind(); - //glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); - //gGL.diffuseColor4fv(line_color.mV); - //gGL.syncMatrices(); - //glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); - // - //gGL.diffuseColor4fv(color.mV); - //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - //glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); - gGL.diffuseColor4fv(line_color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + if (LLGLSLShader::sNoFixedFunction) + { + gGL.diffuseColor4fv(line_color.mV); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); - gGL.diffuseColor4fv(color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + gGL.diffuseColor4fv(color.mV); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + } + else + { + // + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); + LLVertexBuffer::unbind(); + glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); + gGL.diffuseColor4fv(line_color.mV); + gGL.syncMatrices(); + glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); + + gGL.diffuseColor4fv(color.mV); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + } // } else @@ -3144,13 +3152,21 @@ void renderRaycast(LLDrawable* drawablep) { //render face positions // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr - //LLVertexBuffer::unbind(); - //gGL.diffuseColor4f(0,1,1,0.5f); - //glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions); - //gGL.syncMatrices(); - //glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); - gGL.diffuseColor4f(0.f, 1.f, 1.f, 0.5f); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mNumVertices, face.mPositions, NULL, face.mNumIndices, face.mIndices); + if (LLGLSLShader::sNoFixedFunction) + { + gGL.diffuseColor4f(0.f, 1.f, 1.f, 0.5f); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mNumVertices, face.mPositions, NULL, face.mNumIndices, face.mIndices); + } + else + { + // + LLVertexBuffer::unbind(); + gGL.diffuseColor4f(0,1,1,0.5f); + glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions); + gGL.syncMatrices(); + glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + } // }