mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 18:33:01 +02:00
Don't try to set invalid uniforms
This commit is contained in:
parent
d10d7026c5
commit
17e9c3d00c
1 changed files with 6 additions and 2 deletions
|
@ -369,11 +369,15 @@ void Font::drawString(gpu::Batch& batch, float x, float y, const QString& str, c
|
||||||
|
|
||||||
batch.setPipeline(((*color).a < 1.0f || layered) ? _transparentPipeline : _pipeline);
|
batch.setPipeline(((*color).a < 1.0f || layered) ? _transparentPipeline : _pipeline);
|
||||||
batch.setResourceTexture(_fontLoc, _texture);
|
batch.setResourceTexture(_fontLoc, _texture);
|
||||||
batch._glUniform1i(_outlineLoc, (effectType == OUTLINE_EFFECT));
|
if (_outlineLoc >= 0) {
|
||||||
|
batch._glUniform1i(_outlineLoc, (effectType == OUTLINE_EFFECT));
|
||||||
|
}
|
||||||
|
|
||||||
// need the gamma corrected color here
|
// need the gamma corrected color here
|
||||||
glm::vec4 lrgba = ColorUtils::sRGBToLinearVec4(*color);
|
glm::vec4 lrgba = ColorUtils::sRGBToLinearVec4(*color);
|
||||||
batch._glUniform4fv(_colorLoc, 1, (const float*)&lrgba);
|
if (_colorLoc >= 0) {
|
||||||
|
batch._glUniform4fv(_colorLoc, 1, (const float*)&lrgba);
|
||||||
|
}
|
||||||
|
|
||||||
batch.setInputFormat(_format);
|
batch.setInputFormat(_format);
|
||||||
batch.setInputBuffer(0, _verticesBuffer, 0, _format->getChannels().at(0)._stride);
|
batch.setInputBuffer(0, _verticesBuffer, 0, _format->getChannels().at(0)._stride);
|
||||||
|
|
Loading…
Reference in a new issue