diff --git a/Shaders/default.frag b/Shaders/default.frag index a50f8f497..c3c15e598 100644 --- a/Shaders/default.frag +++ b/Shaders/default.frag @@ -10,7 +10,7 @@ void main() { vec3 n, halfV; float NdotL, NdotHV, fogFactor; - vec4 color = ambient; + vec4 color = ambient + gl_FrontMaterial.emission; vec4 texel; vec4 fragColor; @@ -20,8 +20,9 @@ void main() color += diffuse * NdotL; halfV = normalize(halfVector); NdotHV = max(dot(n, halfV), 0.0); - color += gl_FrontMaterial.specular * gl_LightSource[0].specular - * pow(NdotHV, gl_FrontMaterial.shininess); + if (gl_FrontMaterial.shininess > 0.0) + color += gl_FrontMaterial.specular * gl_LightSource[0].specular + * pow(NdotHV, gl_FrontMaterial.shininess); } texel = texture2D(texture, gl_TexCoord[0].st); fragColor = color * texel; diff --git a/Shaders/default.vert b/Shaders/default.vert index 3e73c3bb7..49eb2aea7 100644 --- a/Shaders/default.vert +++ b/Shaders/default.vert @@ -22,5 +22,6 @@ void main() halfVector = normalize(gl_LightSource[0].halfVector.xyz); diffuse = gl_Color * gl_LightSource[0].diffuse; ambient = gl_Color * gl_LightSource[0].ambient; + ambient += gl_Color * gl_LightModel.ambient; fogCoord = abs(ecPosition.z); }