mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-27 23:18:45 +02:00
Merge pull request #4273 from ZappoMan/bugfix
fix the quad color being broken after rendering text
This commit is contained in:
commit
357dd963f3
2 changed files with 9 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <gpu/GPUConfig.h>
|
#include <gpu/GPUConfig.h>
|
||||||
|
|
||||||
|
#include <DeferredLightingEffect.h>
|
||||||
#include <GeometryCache.h>
|
#include <GeometryCache.h>
|
||||||
#include <PerfStat.h>
|
#include <PerfStat.h>
|
||||||
#include <TextRenderer.h>
|
#include <TextRenderer.h>
|
||||||
|
@ -49,7 +50,12 @@ void RenderableTextEntityItem::render(RenderArgs* args) {
|
||||||
|
|
||||||
glm::vec3 topLeft(-halfDimensions.x, -halfDimensions.y, SLIGHTLY_BEHIND);
|
glm::vec3 topLeft(-halfDimensions.x, -halfDimensions.y, SLIGHTLY_BEHIND);
|
||||||
glm::vec3 bottomRight(halfDimensions.x, halfDimensions.y, SLIGHTLY_BEHIND);
|
glm::vec3 bottomRight(halfDimensions.x, halfDimensions.y, SLIGHTLY_BEHIND);
|
||||||
|
|
||||||
|
// TODO: Determine if we want these entities to have the deferred lighting effect? I think we do, so that the color
|
||||||
|
// used for a sphere, or box have the same look as those used on a text entity.
|
||||||
|
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram();
|
||||||
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, glm::vec4(toGlm(getBackgroundColorX()), alpha));
|
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, glm::vec4(toGlm(getBackgroundColorX()), alpha));
|
||||||
|
DependencyManager::get<DeferredLightingEffect>()->releaseSimpleProgram();
|
||||||
|
|
||||||
TextRenderer* textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, FIXED_FONT_POINT_SIZE / 2.0f);
|
TextRenderer* textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, FIXED_FONT_POINT_SIZE / 2.0f);
|
||||||
|
|
||||||
|
|
|
@ -481,9 +481,12 @@ glm::vec2 Font::drawString(float x, float y, const QString & str,
|
||||||
}
|
}
|
||||||
|
|
||||||
_vao->release();
|
_vao->release();
|
||||||
|
_texture->release(); // TODO: Brad & Sam, let's discuss this. Without this non-textured quads get their colors borked.
|
||||||
_program->release();
|
_program->release();
|
||||||
// FIXME, needed?
|
// FIXME, needed?
|
||||||
// glDisable(GL_TEXTURE_2D);
|
// glDisable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
|
||||||
return advance;
|
return advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue