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:
authorClément Foucault <foucault.clem@gmail.com>2018-11-17 16:55:53 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-17 16:56:18 +0300
commitc599aeaee577611f8faa1c537642ff23a87d2190 (patch)
tree723edaf70c2178b8791c061ccf1db67c12a43ff5 /source/blender/gpu
parent735ad525a6e72a7a52bf4e81ca03a7b1c435a857 (diff)
GPU: Cleanup / Opti : Vectorize + MADD and remove unused function
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl16
1 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index ae6ea7eefa2..0d54f7fa69d 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -141,26 +141,16 @@ void linearrgb_to_srgb(vec4 col_from, out vec4 col_to)
col_to.a = col_from.a;
}
-void color_to_normal(vec3 color, out vec3 normal)
-{
- normal.x = 2.0 * ((color.r) - 0.5);
- normal.y = -2.0 * ((color.g) - 0.5);
- normal.z = 2.0 * ((color.b) - 0.5);
-}
-
void color_to_normal_new_shading(vec3 color, out vec3 normal)
{
- normal.x = 2.0 * ((color.r) - 0.5);
- normal.y = 2.0 * ((color.g) - 0.5);
- normal.z = 2.0 * ((color.b) - 0.5);
+ normal = vec3(2.0) * color - vec3(1.0);
}
void color_to_blender_normal_new_shading(vec3 color, out vec3 normal)
{
- normal.x = 2.0 * ((color.r) - 0.5);
- normal.y = -2.0 * ((color.g) - 0.5);
- normal.z = -2.0 * ((color.b) - 0.5);
+ normal = vec3(2.0, -2.0, -2.0) * color - vec3(1.0);
}
+
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif