diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h index 8250c5631dd..2d3045fcd64 100644 --- a/source/blender/render/intern/include/shading.h +++ b/source/blender/render/intern/include/shading.h @@ -62,6 +62,7 @@ void shade_input_calc_viewco(struct ShadeInput *shi, float x, float y, float z, void shade_input_set_viewco(struct ShadeInput *shi, float x, float y, float sx, float sy, float z); void shade_input_set_uv(struct ShadeInput *shi); void shade_input_set_normals(struct ShadeInput *shi); +void shade_input_set_vertex_normals(struct ShadeInput *shi); void shade_input_flip_normals(struct ShadeInput *shi); void shade_input_set_shade_texco(struct ShadeInput *shi); void shade_input_set_strand(struct ShadeInput *shi, struct StrandRen *strand, struct StrandPoint *spoint); diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 81b2203cbcf..f32b1046228 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -841,7 +841,7 @@ void shade_input_set_normals(ShadeInput *shi) } /* XXX shi->flippednor messes up otherwise */ -static void shade_input_set_vertex_normals(ShadeInput *shi) +void shade_input_set_vertex_normals(ShadeInput *shi) { float u= shi->u, v= shi->v; float l= 1.0f+u+v; diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index a3d3a65cccc..f6ccb025fe7 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3766,7 +3766,10 @@ static void shade_tra_samples_fill(ShadeSample *ssamp, int x, int y, int z, int shi->samplenr= R.shadowsamplenr[shi->thread]++; shade_input_set_viewco(shi, x, y, xs, ys, (float)z); shade_input_set_uv(shi); - shade_input_set_normals(shi); + if(shi_inc==0) + shade_input_set_normals(shi); + else /* XXX shi->flippednor messes up otherwise */ + shade_input_set_vertex_normals(shi); shi_inc= 1; }