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:
Diffstat (limited to 'source/blender/render/intern/source/shadeinput.c')
-rw-r--r--source/blender/render/intern/source/shadeinput.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 51157cb83f4..ca661469b36 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -259,6 +259,11 @@ void shade_input_set_triangle_i(ShadeInput *shi, VlakRen *vlr, short i1, short i
/* facenormal copy, can get flipped */
VECCOPY(shi->facenor, vlr->n);
+ /* copy of original pre-flipped normal, for geometry->front/back node output */
+ VECCOPY(shi->orignor, vlr->n);
+ if (vlr->noflag & R_FLIPPED_NO) {
+ VECMUL(shi->orignor, -1.0f);
+ }
}
/* note, facenr declared volatile due to over-eager -O2 optimizations