From: Daniel Genrich Date: Sun, 12 Oct 2008 12:17:57 +0000 (+0000) Subject: svn merge -r 16866:17042 https://svn.blender.org/svnroot/bf-blender/trunk/blender X-Git-Url: https://git.blender.org/gitweb/gitweb.cgi/blender-staging.git/commitdiff_plain/2211b46084f4dc965f66649f01fcda69150225e8 svn merge -r 16866:17042 https://svn.blender.org/svnroot/bf-blender/trunk/blender --- 2211b46084f4dc965f66649f01fcda69150225e8 diff --cc source/blender/render/intern/source/shadeinput.c index 13dabb2a1db,476330152ec..aa11e3d75dd --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@@ -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) */