Don't cull text background/Text is emissive

This commit is contained in:
Atlante45 2015-06-26 16:16:27 -07:00
parent efd805bea7
commit 27a1a55275
2 changed files with 12 additions and 5 deletions

View file

@ -56,7 +56,8 @@ void RenderableTextEntityItem::render(RenderArgs* args) {
batch.setModelTransform(transformToTopLeft);
}
DependencyManager::get<DeferredLightingEffect>()->renderQuad(batch, minCorner, maxCorner, backgroundColor);
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, false, false);
DependencyManager::get<GeometryCache>()->renderQuad(batch, minCorner, maxCorner, backgroundColor);
float scale = _lineHeight / _textRenderer->getFontSize();
transformToTopLeft.setScale(scale); // Scale to have the correct line height

View file

@ -10,6 +10,8 @@
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
<@include DeferredBufferWrite.slh@>
uniform sampler2D Font;
uniform bool Outline;
uniform vec4 Color;
@ -44,9 +46,13 @@ void main() {
if (a < 0.01) {
discard;
}
// final color
gl_FragData[0] = vec4(Color.rgb, Color.a * a);
gl_FragData[1] = vec4(interpolatedNormal.xyz, 0.0) * 0.5 + vec4(0.5, 0.5, 0.5, 1.0);
gl_FragData[2] = vec4(0.0);
packDeferredFragmentLightmap(
normalize(interpolatedNormal.xyz),
glowIntensity * texel.a,
gl_Color.rgb,
gl_FrontMaterial.specular.rgb,
gl_FrontMaterial.shininess,
Color.rgb);
}