diff options
author | Craig Robbins <kde.psych@gmail.com> | 2015-01-16 01:30:03 +1000 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-01-16 01:30:03 +1000 |
commit | 516f1bcd1625d41c33ad2056220db072349c52c9 (patch) | |
tree | f99f01610652ba452afead4e8adf52ab74a60f65 /client/shaders/nodes_shader/opengl_fragment.glsl | |
parent | 5cf911ffe140e447e6ec3791e2244ae5dd0361d8 (diff) | |
download | minetest-516f1bcd1625d41c33ad2056220db072349c52c9.tar.gz minetest-516f1bcd1625d41c33ad2056220db072349c52c9.tar.bz2 minetest-516f1bcd1625d41c33ad2056220db072349c52c9.zip |
Revert "Optimize bumpmapping mathematics"
This reverts commit 148fffb0f23fa437c67639ff3cc69177fb71d76a.
Diffstat (limited to 'client/shaders/nodes_shader/opengl_fragment.glsl')
-rw-r--r-- | client/shaders/nodes_shader/opengl_fragment.glsl | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/client/shaders/nodes_shader/opengl_fragment.glsl b/client/shaders/nodes_shader/opengl_fragment.glsl index 7ef30cc52..2a1cbc568 100644 --- a/client/shaders/nodes_shader/opengl_fragment.glsl +++ b/client/shaders/nodes_shader/opengl_fragment.glsl @@ -87,12 +87,7 @@ vec4 base = texture2D(baseTexture, uv).rgba; vec3 E = normalize(eyeVec); float specular = pow(clamp(dot(reflect(L, bump.xyz), E), 0.0, 1.0),0.5); float diffuse = dot(E,bump.xyz); - /* Mathematic optimization - * Original: color = 0.05*base.rgb + diffuse*base.rgb + 0.2*specular*base.rgb; - * This optimization save 2 multiplications (orig: 4 multiplications + 3 additions - * end: 2 multiplications + 3 additions) - */ - color = (0.05 + diffuse + 0.2 * specular) * base.rgb + color = 0.05*base.rgb + diffuse*base.rgb + 0.2*specular*base.rgb; } else { color = base.rgb; } |