Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-08-04 12:04:27 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-08-04 12:04:27 +0300
commitb50916d172522c5911cc02eff0857057dfaee2a9 (patch)
tree3b4bde5cc6054b4f97b6845ebe9d9262ba1f2c62 /intern/opensubdiv
parentabb976ae889985a973d322bd7f3a792495553ff3 (diff)
OpenSubdiv: forgot this in the previous commit
Need to find better approach for dealing with shadeless materials.
Diffstat (limited to 'intern/opensubdiv')
-rw-r--r--intern/opensubdiv/gpu_shader_opensubd_display.glsl7
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/opensubdiv/gpu_shader_opensubd_display.glsl b/intern/opensubdiv/gpu_shader_opensubd_display.glsl
index e343c952944..7acde19ce5e 100644
--- a/intern/opensubdiv/gpu_shader_opensubd_display.glsl
+++ b/intern/opensubdiv/gpu_shader_opensubd_display.glsl
@@ -248,7 +248,7 @@ void main()
#endif /* USE_DIRECTIONAL_LIGHT */
vec3 h = normalize(l + vec3(0, 0, 1));
float d = max(0.0, dot(N, l));
- float s = pow(max(0.0, dot(N, h)), 500.0f);
+ float s = pow(max(0.0, dot(N, h)), shininess);
L_diffuse += d * lightSource[i].diffuse;
L_specular += s * lightSource[i].specular;
}
@@ -313,7 +313,10 @@ void main()
#endif
/* Sum lighting. */
- vec3 L = L_diffuse + L_specular * specular.rgb;
+ vec3 L = L_diffuse;
+ if (shininess != 0) {
+ L += L_specular * specular.rgb;
+ }
/* Write out fragment color. */
gl_FragColor = vec4(L, diffuse.a);