Merge branch 'master' of https://github.com/highfidelity/hifi into rig

This commit is contained in:
Howard Stearns 2015-07-23 16:12:42 -07:00
commit 05fae0e977
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)); 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) { void packDeferredFragment(vec3 normal, float alpha, vec3 diffuse, vec3 specular, float shininess) {
if (alpha != glowIntensity) { if (alpha != glowIntensity) {
discard; discard;

View file

@ -142,6 +142,10 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch, bool textured,
bool emmisive, bool depthBias) { bool emmisive, bool depthBias) {
SimpleProgramKey config{textured, culled, emmisive, depthBias}; SimpleProgramKey config{textured, culled, emmisive, depthBias};
batch.setPipeline(getPipeline(config)); 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 (!config.isTextured()) {
// If it is not textured, bind white texture and keep using textured pipeline // 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), normalize(interpolatedNormal.xyz),
glowIntensity, glowIntensity,
gl_Color.rgb, gl_Color.rgb,
gl_FrontMaterial.specular.rgb, DEFAULT_SPECULAR, DEFAULT_SHININESS);
gl_FrontMaterial.shininess);
} }

View file

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

View file

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