diff options
author | Määttä Antti <antti.maatta@theqtcompany.com> | 2016-04-18 14:53:12 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@theqtcompany.com> | 2016-04-18 12:16:19 +0000 |
commit | 22fc2e750d88708691a33a54798a665b0c05a32f (patch) | |
tree | ae1d61fa628725bf440e827158ba43d0565865a4 | |
parent | 4e4762a55288a1650cd79f28046506ebb397bbf3 (diff) |
Make light color affect specular hightlights
Apply light color to the specular color in the ads models
Task-number: QTBUG-52499
Change-Id: Ie3c5ebb9dd3703123e1c1f596e0686087ef3b532
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/shaders/es2/light.inc.frag | 4 | ||||
-rw-r--r-- | src/render/shaders/gl3/light.inc.frag | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/render/shaders/es2/light.inc.frag b/src/render/shaders/es2/light.inc.frag index 33714afc2..cdec536cf 100644 --- a/src/render/shaders/es2/light.inc.frag +++ b/src/render/shaders/es2/light.inc.frag @@ -53,7 +53,7 @@ void adsModelNormalMapped(const in FP vec3 vpos, const in FP vec3 vnormal, const } diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; - specularColor += att * specular; + specularColor += att * lights[i].intensity * specular * lights[i].color; } } @@ -95,7 +95,7 @@ void adsModel(const in FP vec3 vpos, const in FP vec3 vnormal, const in FP vec3 } diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; - specularColor += att * specular; + specularColor += att * lights[i].intensity * specular * lights[i].color; } } diff --git a/src/render/shaders/gl3/light.inc.frag b/src/render/shaders/gl3/light.inc.frag index d3cce2edc..8cee315c1 100644 --- a/src/render/shaders/gl3/light.inc.frag +++ b/src/render/shaders/gl3/light.inc.frag @@ -53,7 +53,7 @@ void adsModelNormalMapped(const in vec3 vpos, const in vec3 vnormal, const in ve } diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; - specularColor += att * specular; + specularColor += att * lights[i].intensity * specular * lights[i].color; } } @@ -95,7 +95,7 @@ void adsModel(const in vec3 vpos, const in vec3 vnormal, const in vec3 eye, cons } diffuseColor += att * lights[i].intensity * diffuse * lights[i].color; - specularColor += att * specular; + specularColor += att * lights[i].intensity * specular * lights[i].color; } } |