diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-29 18:10:42 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-29 18:10:42 +0300 |
commit | 58d6cbba6da31db8dc8a2b42d528b9a353081904 (patch) | |
tree | 04b57a2f809c6f08d84a082edf061f3ece631860 /source/blender/render/intern/source/shadeinput.c | |
parent | 94549adec4b6857fb6ec4cf77606da51ff7c26b7 (diff) | |
parent | 295d0c52a26730edc6d4ed1276e4051cce006be5 (diff) |
Merge branch 'master' into temp-ghash-setopstemp-ghash-setops
Diffstat (limited to 'source/blender/render/intern/source/shadeinput.c')
-rw-r--r-- | source/blender/render/intern/source/shadeinput.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 01055d87a38..5a5e67e1e43 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -423,14 +423,11 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert } if (texco & TEXCO_GLOB) { - copy_v3_v3(shi->gl, shi->co); - mul_m4_v3(R.viewinv, shi->gl); + mul_v3_m4v3(shi->gl, R.viewinv, shi->co); if (shi->osatex) { - copy_v3_v3(shi->dxgl, shi->dxco); - mul_mat3_m4_v3(R.viewinv, shi->dxgl); - copy_v3_v3(shi->dygl, shi->dyco); - mul_mat3_m4_v3(R.viewinv, shi->dygl); + mul_v3_mat3_m4v3(shi->dxgl, R.viewinv, shi->dxco); + mul_v3_mat3_m4v3(shi->dygl, R.viewinv, shi->dyco); } } @@ -633,7 +630,7 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v dyco[2] = 0.0f; if (dxyview) { - if (co[2] != 0.0f) fac = 1.0f / co[2]; else fac = 0.0f; + fac = (co[2] != 0.0f) ? (1.0f / co[2]) : 0.0f; dxyview[0] = -R.viewdx * fac; dxyview[1] = -R.viewdy * fac; } |