diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 36d6ded886..33ddad3c2b 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2799,7 +2799,6 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs if (!selfAvatarOnly) { // draw a red sphere float originSphereRadius = 0.05f; - glColor3f(1,0,0); DependencyManager::get()->renderSphere(originSphereRadius, 15, 15, glm::vec4(1.0f, 0.0f, 0.0f, 1.0f)); // also, metavoxels diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index ea65475ddc..ab313d03a2 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -106,7 +106,10 @@ void drawText(int x, int y, float scale, float radians, int mono, // glPushMatrix(); glTranslatef(static_cast(x), static_cast(y), 0.0f); + + // TODO: add support for color to rendering text glColor3fv(color); + glRotated(double(radians * DEGREES_PER_RADIAN), 0.0, 0.0, 1.0); glScalef(scale / 0.1f, scale / 0.1f, 1.0f); textRenderer(mono)->draw(0, 0, string); diff --git a/interface/src/audio/AudioIOStatsRenderer.cpp b/interface/src/audio/AudioIOStatsRenderer.cpp index c253794924..2f0c01beaa 100644 --- a/interface/src/audio/AudioIOStatsRenderer.cpp +++ b/interface/src/audio/AudioIOStatsRenderer.cpp @@ -56,7 +56,8 @@ void AudioIOStatsRenderer::render(const float* color, int width, int height) { int w = STATS_WIDTH; int h = statsHeight; DependencyManager::get()->renderQuad(x, y, w, h, backgroundColor); - glColor4f(1, 1, 1, 1); + + glColor4f(1, 1, 1, 1); // TODO: change text rendering to use collor as parameter int horizontalOffset = x + 5; int verticalOffset = y; diff --git a/interface/src/audio/AudioScope.cpp b/interface/src/audio/AudioScope.cpp index b2e6d35dcf..6ad3a60cba 100644 --- a/interface/src/audio/AudioScope.cpp +++ b/interface/src/audio/AudioScope.cpp @@ -196,8 +196,6 @@ void AudioScope::renderLineStrip(int id, const glm::vec4& color, int x, int y, i geometryCache->updateVertices(id, points, color); geometryCache->renderVertices(gpu::LINE_STRIP, id); - - glColor4f(1, 1, 1, 1); } int AudioScope::addBufferToScope(QByteArray* byteArray, int frameOffset, const int16_t* source, int sourceSamplesPerChannel, diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 9762f3fd4a..354ba174f8 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -703,7 +703,7 @@ void Avatar::renderDisplayName() { DependencyManager::get()->renderBevelCornersRect(left, bottom, right - left, top - bottom, 3, glm::vec4(0.2f, 0.2f, 0.2f, _displayNameAlpha * DISPLAYNAME_BACKGROUND_ALPHA / DISPLAYNAME_ALPHA)); - glColor4f(0.93f, 0.93f, 0.93f, _displayNameAlpha); + glColor4f(0.93f, 0.93f, 0.93f, _displayNameAlpha); // TODO: change text rendering to use collor as parameter QByteArray ba = _displayName.toLocal8Bit(); const char* text = ba.data(); diff --git a/interface/src/ui/BandwidthMeter.cpp b/interface/src/ui/BandwidthMeter.cpp index d6ec937d1d..d0f8b48568 100644 --- a/interface/src/ui/BandwidthMeter.cpp +++ b/interface/src/ui/BandwidthMeter.cpp @@ -88,6 +88,7 @@ void BandwidthMeter::Stream::updateValue(double amount) { void BandwidthMeter::setColorRGBA(unsigned c) { + // TODO: add support for color to rendering text, since that's why this method is used glColor4ub(GLubyte( c >> 24), GLubyte((c >> 16) & 0xff), GLubyte((c >> 8) & 0xff), diff --git a/interface/src/ui/overlays/Line3DOverlay.cpp b/interface/src/ui/overlays/Line3DOverlay.cpp index ab537eea89..f02006c5f8 100644 --- a/interface/src/ui/overlays/Line3DOverlay.cpp +++ b/interface/src/ui/overlays/Line3DOverlay.cpp @@ -49,7 +49,6 @@ void Line3DOverlay::render(RenderArgs* args) { float alpha = getAlpha(); xColor color = getColor(); const float MAX_COLOR = 255.0f; - glColor4f(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha); glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha); glm::vec3 position = getPosition(); @@ -60,6 +59,8 @@ void Line3DOverlay::render(RenderArgs* args) { glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); if (getIsDashedLine()) { + // TODO: add support for color to renderDashedLine() + glColor4f(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha); DependencyManager::get()->renderDashedLine(_position, _end, _geometryCacheID); } else { DependencyManager::get()->renderLine(_start, _end, colorv4, _geometryCacheID); diff --git a/interface/src/ui/overlays/Text3DOverlay.cpp b/interface/src/ui/overlays/Text3DOverlay.cpp index 623a487bb5..0d0741772c 100644 --- a/interface/src/ui/overlays/Text3DOverlay.cpp +++ b/interface/src/ui/overlays/Text3DOverlay.cpp @@ -124,6 +124,7 @@ void Text3DOverlay::render(RenderArgs* args) { enableClipPlane(GL_CLIP_PLANE2, 0.0f, -1.0f, 0.0f, clipMinimum.y + clipDimensions.y); enableClipPlane(GL_CLIP_PLANE3, 0.0f, 1.0f, 0.0f, -clipMinimum.y); + // TODO: add support for color to rendering text glColor3f(_color.red / MAX_COLOR, _color.green / MAX_COLOR, _color.blue / MAX_COLOR); float alpha = getAlpha(); QStringList lines = _text.split("\n"); diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index 1333134907..d3893b5b04 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -90,6 +90,7 @@ void TextOverlay::render(RenderArgs* args) { int x = _bounds.left() + _leftMargin + leftAdjust; int y = _bounds.top() + _topMargin + topAdjust; + // TODO: add support for color to rendering text glColor3f(_color.red / MAX_COLOR, _color.green / MAX_COLOR, _color.blue / MAX_COLOR); float alpha = getAlpha(); QStringList lines = _text.split("\n"); diff --git a/libraries/entities-renderer/src/RenderableLightEntityItem.cpp b/libraries/entities-renderer/src/RenderableLightEntityItem.cpp index 9097956c88..7eccaff06b 100644 --- a/libraries/entities-renderer/src/RenderableLightEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableLightEntityItem.cpp @@ -63,7 +63,7 @@ void RenderableLightEntityItem::render(RenderArgs* args) { } #ifdef WANT_DEBUG - glColor4f(diffuseR, diffuseG, diffuseB, 1.0f); + glm::vec4 color(diffuseR, diffuseG, diffuseB, 1.0f); glPushMatrix(); glTranslatef(position.x, position.y, position.z); glm::vec3 axis = glm::axis(rotation); @@ -73,7 +73,7 @@ void RenderableLightEntityItem::render(RenderArgs* args) { glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z); glScalef(dimensions.x, dimensions.y, dimensions.z); - DependencyManager::get()->renderWireSphere(0.5f, 15, 15); + DependencyManager::get()->renderWireSphere(0.5f, 15, 15, color); glPopMatrix(); glPopMatrix(); #endif diff --git a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp index 492543fd62..d142f76dfe 100644 --- a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp @@ -78,6 +78,7 @@ void RenderableTextEntityItem::render(RenderArgs* args) { enableClipPlane(GL_CLIP_PLANE3, 0.0f, 1.0f, 0.0f, -clipMinimum.y); xColor textColor = getTextColorX(); + // TODO: add support for color to rendering text glColor3f(textColor.red / MAX_COLOR, textColor.green / MAX_COLOR, textColor.blue / MAX_COLOR); QStringList lines = _text.split("\n"); int lineOffset = maxHeight; diff --git a/libraries/render-utils/src/TextureCache.cpp b/libraries/render-utils/src/TextureCache.cpp index 3644ded81c..28bda7689a 100644 --- a/libraries/render-utils/src/TextureCache.cpp +++ b/libraries/render-utils/src/TextureCache.cpp @@ -154,14 +154,16 @@ const gpu::TexturePointer& TextureCache::getPermutationNormalTexture() { } const unsigned char OPAQUE_WHITE[] = { 0xFF, 0xFF, 0xFF, 0xFF }; -const unsigned char TRANSPARENT_WHITE[] = { 0xFF, 0xFF, 0xFF, 0x0 }; -const unsigned char OPAQUE_BLACK[] = { 0x0, 0x0, 0x0, 0xFF }; +//const unsigned char TRANSPARENT_WHITE[] = { 0xFF, 0xFF, 0xFF, 0x0 }; +//const unsigned char OPAQUE_BLACK[] = { 0x0, 0x0, 0x0, 0xFF }; const unsigned char OPAQUE_BLUE[] = { 0x80, 0x80, 0xFF, 0xFF }; +/* static void loadSingleColorTexture(const unsigned char* color) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, color); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } +*/ const gpu::TexturePointer& TextureCache::getWhiteTexture() { if (_whiteTexture.isNull()) {