diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-21 15:37:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-21 15:37:51 +0400 |
commit | 3d1cdfbb3833f2869dc73fb18b3305e78ab608db (patch) | |
tree | 60dc6da4978b4f9e696065e542c2e8a44a763bfb /source/blender/render/intern | |
parent | f9467d28b99a620631ed1c2d249532b2dba46f67 (diff) |
remove sticky coords from blender and the internal render engine.
Diffstat (limited to 'source/blender/render/intern')
5 files changed, 2 insertions, 115 deletions
diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h index 584e56836fa..d116dfe7b17 100644 --- a/source/blender/render/intern/include/renderdatabase.h +++ b/source/blender/render/intern/include/renderdatabase.h @@ -55,7 +55,6 @@ struct RadFace; typedef struct VertTableNode { struct VertRen *vert; float *rad; - float *sticky; float *strand; float *tangent; float *stress; @@ -110,7 +109,6 @@ struct ObjectRen *RE_addRenderObject(struct Render *re, struct Object *ob, struc struct ObjectInstanceRen *RE_addRenderInstance(struct Render *re, struct ObjectRen *obr, struct Object *ob, struct Object *par, int index, int psysindex, float mat[][4], int lay); void RE_makeRenderInstances(struct Render *re); -float *RE_vertren_get_sticky(struct ObjectRen *obr, struct VertRen *ver, int verify); float *RE_vertren_get_stress(struct ObjectRen *obr, struct VertRen *ver, int verify); float *RE_vertren_get_rad(struct ObjectRen *obr, struct VertRen *ver, int verify); float *RE_vertren_get_strand(struct ObjectRen *obr, struct VertRen *ver, int verify); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index da1c40ba714..f344da9725f 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -2261,14 +2261,6 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve if ((texco & TEXCO_ORCO) && (vr->orco)) { copy_v3_v3(shi->lo, vr->orco); } - if (texco & TEXCO_STICKY) { - float *sticky= RE_vertren_get_sticky(obr, vr, 0); - if (sticky) { - shi->sticky[0]= sticky[0]; - shi->sticky[1]= sticky[1]; - shi->sticky[2]= 0.0f; - } - } if (texco & TEXCO_GLOB) { copy_v3_v3(shi->gl, shi->co); mul_m4_v3(re->viewinv, shi->gl); @@ -3250,7 +3242,6 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) VlakRen *vlr; //, *vlr1; VertRen *ver; Material *ma; - MSticky *ms = NULL; DerivedMesh *dm; CustomDataMask mask; float xn, yn, zn, imat[3][3], mat[4][4]; //nor[3], @@ -3335,8 +3326,6 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if (do_autosmooth && me->totvert==totvert && me->totface==dm->getNumTessFaces(dm)) use_original_normals= TRUE; - ms = NULL; /* STICKY_TODO */ - ma= give_render_material(re, ob, 1); @@ -3355,16 +3344,11 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) normalize_v3(ver->n); negate_v3(ver->n); } - + if (orco) { ver->orco= orco; orco+=3; } - if (ms) { - float *sticky= RE_vertren_get_sticky(obr, ver, 1); - copy_v2_v2(sticky, ms->co); - ms++; - } } if (!timeoffset) { diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index cbf2a37eeb7..982f7e7d824 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -2153,9 +2153,6 @@ void do_material_tex(ShadeInput *shi, Render *re) co= shi->lo; dx= shi->dxlo; dy= shi->dylo; } } - else if (mtex->texco==TEXCO_STICKY) { - co= shi->sticky; dx= shi->dxsticky; dy= shi->dysticky; - } else if (mtex->texco==TEXCO_OBJECT) { Object *ob= mtex->object; if (ob) { diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 4a490467804..6395a04b534 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -97,8 +97,6 @@ * the index */ /* NOTE! the hardcoded table size 256 is used still in code for going quickly over vertices/faces */ - -#define RE_STICKY_ELEMS 2 #define RE_STRESS_ELEMS 1 #define RE_RAD_ELEMS 4 #define RE_STRAND_ELEMS 1 @@ -113,21 +111,6 @@ #define RE_FACE_ELEMS 1 #define RE_NMAP_TANGENT_ELEMS 16 -float *RE_vertren_get_sticky(ObjectRen *obr, VertRen *ver, int verify) -{ - float *sticky; - int nr= ver->index>>8; - - sticky= obr->vertnodes[nr].sticky; - if (sticky==NULL) { - if (verify) - sticky= obr->vertnodes[nr].sticky= MEM_mallocN(256*RE_STICKY_ELEMS*sizeof(float), "sticky table"); - else - return NULL; - } - return sticky + (ver->index & 255)*RE_STICKY_ELEMS; -} - float *RE_vertren_get_stress(ObjectRen *obr, VertRen *ver, int verify) { float *stress; @@ -217,12 +200,7 @@ VertRen *RE_vertren_copy(ObjectRen *obr, VertRen *ver) *v1= *ver; v1->index= index; - - fp1= RE_vertren_get_sticky(obr, ver, 0); - if (fp1) { - fp2= RE_vertren_get_sticky(obr, v1, 1); - memcpy(fp2, fp1, RE_STICKY_ELEMS*sizeof(float)); - } + fp1= RE_vertren_get_stress(obr, ver, 0); if (fp1) { fp2= RE_vertren_get_stress(obr, v1, 1); @@ -739,8 +717,6 @@ void free_renderdata_vertnodes(VertTableNode *vertnodes) if (vertnodes[a].rad) MEM_freeN(vertnodes[a].rad); - if (vertnodes[a].sticky) - MEM_freeN(vertnodes[a].sticky); if (vertnodes[a].strand) MEM_freeN(vertnodes[a].strand); if (vertnodes[a].tangent) diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index d1d2c66985e..7ef72b7bb79 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -574,10 +574,6 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert shi->dywin[1] = 0.0f; } } - - if (texco & TEXCO_STICKY) { - /* not supported */ - } } if (shi->do_manage) { @@ -1236,70 +1232,6 @@ void shade_input_set_shade_texco(ShadeInput *shi) shi->dywin[0] = shi->dywin[2] = 0.0f; } } - - if (texco & TEXCO_STICKY) { - float *s1, *s2, *s3; - - s1 = RE_vertren_get_sticky(obr, v1, 0); - s2 = RE_vertren_get_sticky(obr, v2, 0); - s3 = RE_vertren_get_sticky(obr, v3, 0); - - if (s1 && s2 && s3) { - float obwinmat[4][4], winmat[4][4], ho1[4], ho2[4], ho3[4]; - float Zmulx, Zmuly; - float hox, hoy, l, dl, u, v; - float s00, s01, s10, s11, detsh; - - /* old globals, localized now */ - Zmulx = ((float)R.winx) / 2.0f; Zmuly = ((float)R.winy) / 2.0f; - - zbuf_make_winmat(&R, winmat); - if (shi->obi->flag & R_TRANSFORMED) - mult_m4_m4m4(obwinmat, winmat, obi->mat); - else - copy_m4_m4(obwinmat, winmat); - - zbuf_render_project(obwinmat, v1->co, ho1); - zbuf_render_project(obwinmat, v2->co, ho2); - zbuf_render_project(obwinmat, v3->co, ho3); - - s00 = ho3[0] / ho3[3] - ho1[0] / ho1[3]; - s01 = ho3[1] / ho3[3] - ho1[1] / ho1[3]; - s10 = ho3[0] / ho3[3] - ho2[0] / ho2[3]; - s11 = ho3[1] / ho3[3] - ho2[1] / ho2[3]; - - detsh = s00 * s11 - s10 * s01; - detsh = (detsh != 0.0f) ? 1.0f / detsh : 0.0f; - s00 *= detsh; s01 *= detsh; - s10 *= detsh; s11 *= detsh; - - /* recalc u and v again */ - hox = x / Zmulx - 1.0f; - hoy = y / Zmuly - 1.0f; - u = (hox - ho3[0] / ho3[3]) * s11 - (hoy - ho3[1] / ho3[3]) * s10; - v = (hoy - ho3[1] / ho3[3]) * s00 - (hox - ho3[0] / ho3[3]) * s01; - l = 1.0f + u + v; - - shi->sticky[0] = l * s3[0] - u * s1[0] - v * s2[0]; - shi->sticky[1] = l * s3[1] - u * s1[1] - v * s2[1]; - shi->sticky[2] = 0.0f; - - if (shi->osatex) { - float dxuv[2], dyuv[2]; - dxuv[0] = s11 / Zmulx; - dxuv[1] = -s01 / Zmulx; - dyuv[0] = -s10 / Zmuly; - dyuv[1] = s00 / Zmuly; - - dl = dxuv[0] + dxuv[1]; - shi->dxsticky[0] = dl * s3[0] - dxuv[0] * s1[0] - dxuv[1] * s2[0]; - shi->dxsticky[1] = dl * s3[1] - dxuv[0] * s1[1] - dxuv[1] * s2[1]; - dl = dyuv[0] + dyuv[1]; - shi->dysticky[0] = dl * s3[0] - dyuv[0] * s1[0] - dyuv[1] * s2[0]; - shi->dysticky[1] = dl * s3[1] - dyuv[0] * s1[1] - dyuv[1] * s2[1]; - } - } - } } /* else { * Note! For raytracing winco is not set, |