Merge pull request #5404 from ZappoMan/renderBug

Fix rendering of primitive objects on Windows
This commit is contained in:
Brad Davis 2015-07-23 19:10:54 -04:00
commit 2ac6304752
5 changed files with 10 additions and 6 deletions

View file

@ -21,6 +21,9 @@ float evalOpaqueFinalAlpha(float alpha, float mapAlpha) {
return mix(alpha * glowIntensity, 1.0 - alpha * glowIntensity, step(mapAlpha, alphaThreshold));
}
const vec3 DEFAULT_SPECULAR = vec3(0.1);
const float DEFAULT_SHININESS = 10;
void packDeferredFragment(vec3 normal, float alpha, vec3 diffuse, vec3 specular, float shininess) {
if (alpha != glowIntensity) {
discard;

View file

@ -142,6 +142,10 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch, bool textured,
bool emmisive, bool depthBias) {
SimpleProgramKey config{textured, culled, emmisive, depthBias};
batch.setPipeline(getPipeline(config));
gpu::ShaderPointer program = (config.isEmissive()) ? _emissiveShader : _simpleShader;
int glowIntensity = program->getUniforms().findLocation("glowIntensity");
batch._glUniform1f(glowIntensity, 1.0f);
if (!config.isTextured()) {
// If it is not textured, bind white texture and keep using textured pipeline

View file

@ -22,6 +22,5 @@ void main(void) {
normalize(interpolatedNormal.xyz),
glowIntensity,
gl_Color.rgb,
gl_FrontMaterial.specular.rgb,
gl_FrontMaterial.shininess);
DEFAULT_SPECULAR, DEFAULT_SHININESS);
}

View file

@ -27,6 +27,5 @@ void main(void) {
normalize(interpolatedNormal.xyz),
glowIntensity * texel.a,
gl_Color.rgb * texel.rgb,
gl_FrontMaterial.specular.rgb,
gl_FrontMaterial.shininess);
DEFAULT_SPECULAR, DEFAULT_SHININESS);
}

View file

@ -27,7 +27,6 @@ void main(void) {
normalize(interpolatedNormal.xyz),
glowIntensity * texel.a,
gl_Color.rgb,
gl_FrontMaterial.specular.rgb,
gl_FrontMaterial.shininess,
DEFAULT_SPECULAR, DEFAULT_SHININESS,
texel.rgb);
}