Bugfix #25967
authorTon Roosendaal <ton@blender.org>
Tue, 22 Feb 2011 17:19:02 +0000 (17:19 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 22 Feb 2011 17:19:02 +0000 (17:19 +0000)
Node Materials: option "Front/Back" in geometry node failed for
"full osa" case in ZTransp.

source/blender/render/intern/include/shading.h
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/zbuf.c

index 8250c5631dd22c1a1cb35a0a7d3afa5ad012937c..2d3045fcd641d65b48972d45321ca1d7324a4961 100644 (file)
@@ -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);
index 81b2203cbcf45b64fbd7df151ae8dcaa0ce8de87..f32b10462283371462bd61769d93cd51cf0fa20f 100644 (file)
@@ -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;
index a3d3a65ccccbf7c0924dfe7cd3fb9668a43d063d..f6ccb025fe798ef126570abbaa687f8f25a18f88 100644 (file)
@@ -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;
                                }