diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-03 16:54:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-03 16:54:09 +0300 |
commit | 1f3e277121795aaa37b7b719a0b5d0b8185b0d1c (patch) | |
tree | 7883344a327b59165497e2420acbef576fd9c242 /source/blender/render | |
parent | 116a52ee21e834a471be21f7691a449afe0cb115 (diff) |
bugfix [#20709] Strange rendering artifacts in raytraced refraction
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/rayshade.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index d35521e92ac..f54ef09e79f 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -699,7 +699,8 @@ static void ray_fadeout(Isect *is, ShadeInput *shi, float *col, float *blendcol, col[2] = col[2]*blendfac + (1.0 - blendfac)*blendcol[2]; } -/* the main recursive tracer itself */ +/* the main recursive tracer itself + * note: 'col' must be initialized */ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, float *start, float *vec, float *col, ObjectInstanceRen *obi, VlakRen *vlr, int traflag) { ShadeInput shi; @@ -1316,7 +1317,9 @@ static void trace_refract(float *col, ShadeInput *shi, ShadeResult *shr) /* no blurriness, use the original normal */ VECCOPY(v_refract_new, v_refract); } - + + sampcol[0]= sampcol[1]= sampcol[2]= sampcol[3]= 0.0f; + traceray(shi, shr, shi->mat->ray_depth_tra, shi->co, v_refract_new, sampcol, shi->obi, shi->vlr, RAY_TRA|RAY_TRAFLIP); col[0] += sampcol[0]; @@ -1414,6 +1417,8 @@ static void trace_reflect(float *col, ShadeInput *shi, ShadeResult *shr, float f else reflection(v_reflect, v_nor_new, shi->view, NULL); + sampcol[0]= sampcol[1]= sampcol[2]= sampcol[3]= 0.0f; + traceray(shi, shr, shi->mat->ray_depth, shi->co, v_reflect, sampcol, shi->obi, shi->vlr, 0); |