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:
authorMatt Ebb <matt@mke3.net>2007-11-15 09:07:02 +0300
committerMatt Ebb <matt@mke3.net>2007-11-15 09:07:02 +0300
commitcbceb9bf66df5b6b5ebe598ec5334be9ea0f8a7d (patch)
treeba7541137cbbb847c4b9302b6706055d8180874c /source/blender/render/intern
parentd273ae05712901ef7619219db9864a3734bf4f22 (diff)
* Fixed own bug: glossy reflections was erroneously giving a
distorted copy of the original face normal, meaning that on smooth shaded faces, sometimes the check to keep rays reflected out away from the face wasn't working, and the ray would intersect when it shouldn't.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/source/rayshade.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 49448f2d727..e7345c106a6 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -988,7 +988,7 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f
int samp_type;
float samp3d[3], orthx[3], orthy[3];
- float v_nor_new[3], v_facenor_new[3], v_reflect[3];
+ float v_nor_new[3], v_reflect[3];
float sampcol[4], colsq[4];
float blur = pow(1.0 - shi->mat->gloss_mir, 3);
@@ -1011,8 +1011,6 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f
} else
max_samples = 1;
- VECCOPY(v_facenor_new, shi->facenor);
-
while (samples < max_samples) {
if (max_samples > 1) {
@@ -1035,17 +1033,14 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f
/* and perturb the normal in it */
VecAddf(v_nor_new, shi->vn, orthx);
VecAddf(v_nor_new, v_nor_new, orthy);
- VecAddf(v_facenor_new, shi->facenor, orthx);
- VecAddf(v_facenor_new, v_facenor_new, orthy);
Normalize(v_nor_new);
- Normalize(v_facenor_new);
} else {
/* no blurriness, use the original normal */
VECCOPY(v_nor_new, shi->vn);
}
if((shi->vlr->flag & R_SMOOTH))
- reflection(v_reflect, v_nor_new, shi->view, v_facenor_new);
+ reflection(v_reflect, v_nor_new, shi->view, shi->facenor);
else
reflection(v_reflect, v_nor_new, shi->view, NULL);