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>2017-05-14 17:13:00 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-05-15 17:14:17 +0300
commit38125d04996ac475affa9bb1cc19b126009d43a8 (patch)
treecb10af4a75e8c2688555e23014a409ba0520696b /source/blender/blenlib/intern/math_vector_inline.c
parentf83a24474967170a0a5323abe0e987f3a392f793 (diff)
Mesh Batch Cache: Define Compressed format for shading data.
Deactivated by default. All shading attribs can be packed to take less VRAM at the cost of precision (not noticable in this case). UVs can be packed into I16 but that limits their positions into the [-1, +1] range. This could be a setting option in the future.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 4389cd29034..75bbfda3f5b 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -960,6 +960,12 @@ MINLINE float normalize_v3(float n[3])
return normalize_v3_v3(n, n);
}
+MINLINE void normal_float_to_short_v2(short out[2], const float in[2])
+{
+ out[0] = (short) (in[0] * 32767.0f);
+ out[1] = (short) (in[1] * 32767.0f);
+}
+
MINLINE void normal_short_to_float_v3(float out[3], const short in[3])
{
out[0] = in[0] * (1.0f / 32767.0f);