diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-06 21:36:03 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-07 02:19:14 +0300 |
commit | c6c3d2e0f006f990cdb5365a6966877c1d813644 (patch) | |
tree | ccb7119105d8413784b41e2301ca54d0809e7d20 /source/blender/gpu/shaders | |
parent | fac2cfdfa776e0829c4d89b28392b1404edda5d6 (diff) |
GPU: Cleanup: Vectorize operations and use MADD
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 3ddf1aefe4d..865fd85e2a9 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -1703,17 +1703,17 @@ void node_uvmap(vec3 attr_uv, out vec3 outvec) void tangent_orco_x(vec3 orco_in, out vec3 orco_out) { - orco_out = vec3(0.0, (orco_in.z - 0.5) * -0.5, (orco_in.y - 0.5) * 0.5); + orco_out = orco_in.xzy * vec3(0.0, -0.5, 0.5) + vec3(0.0, 0.25, -0.25); } void tangent_orco_y(vec3 orco_in, out vec3 orco_out) { - orco_out = vec3((orco_in.z - 0.5) * -0.5, 0.0, (orco_in.x - 0.5) * 0.5); + orco_out = orco_in.zyx * vec3(-0.5, 0.0, 0.5) + vec3(0.25, 0.0, -0.25); } void tangent_orco_z(vec3 orco_in, out vec3 orco_out) { - orco_out = vec3((orco_in.y - 0.5) * -0.5, (orco_in.x - 0.5) * 0.5, 0.0); + orco_out = orco_in.yxz * vec3(-0.5, 0.5, 0.0) + vec3(0.25, -0.25, 0.0); } void node_tangentmap(vec4 attr_tangent, mat4 toworld, out vec3 tangent) |