svn merge -r 16866:17042 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorDaniel Genrich <daniel.genrich@gmx.net>
Sun, 12 Oct 2008 12:17:57 +0000 (12:17 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Sun, 12 Oct 2008 12:17:57 +0000 (12:17 +0000)
1  2 
source/blender/blenloader/intern/readfile.c
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/include/shading.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/shadeinput.c
source/blender/src/buttons_shading.c

index 13dabb2a1db68d33c60749b810e78bef089245ac,476330152ecd47dbf90f67ff1dc55fa6dd2df9a3..aa11e3d75ddaf2e23d5a9cb101f906ed3f7d3ec0
@@@ -680,12 -667,34 +674,38 @@@ void shade_input_calc_viewco(ShadeInpu
                }
        }
        
 +      /* set camera coords - for scanline, it's always 0.0,0.0,0.0 (render is in camera space)
 +       * however for raytrace it can be different - the position of the last intersection */
 +      shi->camera_co[0] = shi->camera_co[1] = shi->camera_co[2] = 0.0f;
 +      
        /* cannot normalize earlier, code above needs it at viewplane level */
-       Normalize(shi->view);
+       Normalize(view);
+ }
+ /* from scanline pixel coordinates to 3d coordinates, requires set_triangle */
+ void shade_input_set_viewco(ShadeInput *shi, float x, float y, float xs, float ys, float z)
+ {
+       float *dxyview= NULL, *dxco= NULL, *dyco= NULL;
+       
+       /* currently in use for dithering (soft shadow), node preview, irregular shad */
+       shi->xs= (int)xs;
+       shi->ys= (int)ys;
+       /* original scanline coordinate without jitter */
+       shi->scanco[0]= x;
+       shi->scanco[1]= y;
+       shi->scanco[2]= z;
+       /* check if we need derivatives */
+       if(shi->osatex || (R.r.mode & R_SHADOW)) {
+               dxco= shi->dxco;
+               dyco= shi->dyco;
+               if((shi->mat->texco & TEXCO_REFL))
+                       dxyview= &shi->dxview;
+       }
+       shade_input_calc_viewco(shi, xs, ys, z, shi->view, dxyview, shi->co, dxco, dyco);
  }
  
  /* calculate U and V, for scanline (silly render face u and v are in range -1 to 0) */
Simple merge