diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-12 08:14:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-12 08:14:12 +0400 |
commit | 4bd0a2ba2dadee66d52f9a1101ee918f1327eec4 (patch) | |
tree | b567b077039e78467e21548c5e03fa8b94fc2b6c /source/blender/render/intern | |
parent | 471a86bf9ccae23b63cb1a05c9525ef99987581d (diff) |
replace VECCOPY -> copy_v3_v3, added copy_v*_v*_short too for typesafe copying, some parts of the code are copying float -> short normals without scaling. fix coming next.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r-- | source/blender/render/intern/source/occlusion.c | 20 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 82 | ||||
-rw-r--r-- | source/blender/render/intern/source/renderdatabase.c | 27 | ||||
-rw-r--r-- | source/blender/render/intern/source/shadeinput.c | 92 | ||||
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 24 |
5 files changed, 121 insertions, 124 deletions
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 54137c62d22..36dd4eb9708 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1777,11 +1777,11 @@ void sample_occ(Render *re, ShadeInput *shi) if(cache->sample && cache->step) { sample= &cache->sample[(shi->ys-cache->y)*cache->w + (shi->xs-cache->x)]; - VECCOPY(sample->co, shi->co); - VECCOPY(sample->n, shi->vno); - VECCOPY(sample->ao, shi->ao); - VECCOPY(sample->env, shi->env); - VECCOPY(sample->indirect, shi->indirect); + copy_v3_v3(sample->co, shi->co); + copy_v3_v3(sample->n, shi->vno); + copy_v3_v3(sample->ao, shi->ao); + copy_v3_v3(sample->env, shi->env); + copy_v3_v3(sample->indirect, shi->indirect); sample->intensity= MAX3(sample->ao[0], sample->ao[1], sample->ao[2]); sample->intensity= MAX2(sample->intensity, MAX3(sample->env[0], sample->env[1], sample->env[2])); sample->intensity= MAX2(sample->intensity, MAX3(sample->indirect[0], sample->indirect[1], sample->indirect[2])); @@ -1872,11 +1872,11 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp) exclude.facenr= shi->vlr->index; sample_occ_tree(re, tree, &exclude, shi->co, shi->vno, shi->thread, onlyshadow, shi->ao, shi->env, shi->indirect); - VECCOPY(sample->co, shi->co); - VECCOPY(sample->n, shi->vno); - VECCOPY(sample->ao, shi->ao); - VECCOPY(sample->env, shi->env); - VECCOPY(sample->indirect, shi->indirect); + copy_v3_v3(sample->co, shi->co); + copy_v3_v3(sample->n, shi->vno); + copy_v3_v3(sample->ao, shi->ao); + copy_v3_v3(sample->env, shi->env); + copy_v3_v3(sample->indirect, shi->indirect); sample->intensity= MAX3(sample->ao[0], sample->ao[1], sample->ao[2]); sample->intensity= MAX2(sample->intensity, MAX3(sample->env[0], sample->env[1], sample->env[2])); sample->intensity= MAX2(sample->intensity, MAX3(sample->indirect[0], sample->indirect[1], sample->indirect[2])); diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 4a8db693b76..d94074725a0 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -505,7 +505,7 @@ static int stucci(Tex *tex, float *texvec, TexResult *texres) if(texres->nor) { - VECCOPY(texres->nor, nor); + copy_v3_v3(texres->nor, nor); tex_normal_derivate(tex, texres); if(tex->stype==TEX_WALLOUT) { @@ -755,9 +755,9 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex if(pit && pit->doit) { if(texres->nor) { if (pit->version < 6) { - VECCOPY(pit->result+5, texres->nor); + copy_v3_v3(pit->result+5, texres->nor); } else { - VECCOPY(result+5, texres->nor); + copy_v3_v3(result+5, texres->nor); } } if (pit->version < 6) { @@ -781,9 +781,9 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex if(rgbnor & TEX_NOR) { if(texres->nor) { if (pit->version < 6) { - VECCOPY(texres->nor, pit->result+5); + copy_v3_v3(texres->nor, pit->result+5); } else { - VECCOPY(texres->nor, result+5); + copy_v3_v3(texres->nor, result+5); } } } @@ -820,7 +820,7 @@ static int cubemap_glob(float *n, float x, float y, float z, float *adr1, float nor[0]= x; nor[1]= y; nor[2]= z; // use local render coord } else { - VECCOPY(nor, n); + copy_v3_v3(nor, n); } mul_mat3_m4_v3(R.viewinv, nor); @@ -914,7 +914,7 @@ static int cubemap_ob(Object *ob, float *n, float x, float y, float z, float *ad if(n==NULL) return 0; - VECCOPY(nor, n); + copy_v3_v3(nor, n); if(ob) mul_mat3_m4_v3(ob->imat, nor); x1= fabs(nor[0]); @@ -1219,7 +1219,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, /* ton: added this, for Blender convention reason. * artificer: added the use of tmpvec to avoid scaling texvec */ - VECCOPY(tmpvec, texvec); + copy_v3_v3(tmpvec, texvec); mul_v3_fl(tmpvec, 1.0f/tex->noisesize); switch(tex->stype) { @@ -1241,7 +1241,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, /* ton: added this, for Blender convention reason. * artificer: added the use of tmpvec to avoid scaling texvec */ - VECCOPY(tmpvec, texvec); + copy_v3_v3(tmpvec, texvec); mul_v3_fl(tmpvec, 1.0f/tex->noisesize); retval= voronoiTex(tex, tmpvec, texres); @@ -1250,7 +1250,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, /* ton: added this, for Blender convention reason. * artificer: added the use of tmpvec to avoid scaling texvec */ - VECCOPY(tmpvec, texvec); + copy_v3_v3(tmpvec, texvec); mul_v3_fl(tmpvec, 1.0f/tex->noisesize); retval= mg_distNoiseTex(tex, tmpvec, texres); @@ -1477,32 +1477,32 @@ void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg case MTEX_BLEND_HUE: fact*= facg; - VECCOPY(in, out); + copy_v3_v3(in, out); ramp_blend(MA_RAMP_HUE, in, in+1, in+2, fact, tex); break; case MTEX_BLEND_SAT: fact*= facg; - VECCOPY(in, out); + copy_v3_v3(in, out); ramp_blend(MA_RAMP_SAT, in, in+1, in+2, fact, tex); break; case MTEX_BLEND_VAL: fact*= facg; - VECCOPY(in, out); + copy_v3_v3(in, out); ramp_blend(MA_RAMP_VAL, in, in+1, in+2, fact, tex); break; case MTEX_BLEND_COLOR: fact*= facg; - VECCOPY(in, out); + copy_v3_v3(in, out); ramp_blend(MA_RAMP_COLOR, in, in+1, in+2, fact, tex); break; case MTEX_SOFT_LIGHT: fact*= facg; - VECCOPY(in, out); + copy_v3_v3(in, out); ramp_blend(MA_RAMP_SOFT, in, in+1, in+2, fact, tex); break; case MTEX_LIN_LIGHT: fact*= facg; - VECCOPY(in, out); + copy_v3_v3(in, out); ramp_blend(MA_RAMP_LINEAR, in, in+1, in+2, fact, tex); break; } @@ -1924,8 +1924,8 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T Hscale *= 0.1f; // factor 0.1 proved to look like the previous bump code if( !ntap_bump->init_done ) { - VECCOPY(ntap_bump->vNacc, shi->vn); - VECCOPY(ntap_bump->vNorg, shi->vn); + copy_v3_v3(ntap_bump->vNacc, shi->vn); + copy_v3_v3(ntap_bump->vNorg, shi->vn); ntap_bump->fPrevMagnitude = 1.0f; ntap_bump->iPrevBumpSpace = 0; @@ -2056,9 +2056,9 @@ static int ntap_bump_compute(NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, T float obj2view[3][3], view2obj[3][3], tmp[4][4]; // local copies of derivatives and normal float dPdx[3], dPdy[3], vN[3]; - VECCOPY(dPdx, shi->dxco); - VECCOPY(dPdy, shi->dyco); - VECCOPY(vN, ntap_bump->vNorg); + copy_v3_v3(dPdx, shi->dxco); + copy_v3_v3(dPdy, shi->dyco); + copy_v3_v3(vN, ntap_bump->vNorg); if( mtex->texflag & MTEX_BUMP_OBJECTSPACE ) { // TODO: these calculations happen for every pixel! @@ -2200,14 +2200,14 @@ void do_material_tex(ShadeInput *shi) co= tempvec; dx= dxt; dy= dyt; - VECCOPY(tempvec, shi->co); + copy_v3_v3(tempvec, shi->co); if(mtex->texflag & MTEX_OB_DUPLI_ORIG) if(shi->obi && shi->obi->duplitexmat) mul_m4_v3(shi->obi->duplitexmat, tempvec); mul_m4_v3(ob->imat_ren, tempvec); if(shi->osatex) { - VECCOPY(dxt, shi->dxco); - VECCOPY(dyt, shi->dyco); + copy_v3_v3(dxt, shi->dxco); + copy_v3_v3(dyt, shi->dyco); mul_mat3_m4_v3(ob->imat_ren, dxt); mul_mat3_m4_v3(ob->imat_ren, dyt); } @@ -2369,7 +2369,7 @@ void do_material_tex(ShadeInput *shi) float *warpnor= texres.nor, warpnor_[3]; if(use_ntap_bump) { - VECCOPY(warpnor_, texres.nor); + copy_v3_v3(warpnor_, texres.nor); warpnor= warpnor_; normalize_v3(warpnor_); } @@ -2485,7 +2485,7 @@ void do_material_tex(ShadeInput *shi) else { float nor[3]; - VECCOPY(nor, texres.nor); + copy_v3_v3(nor, texres.nor); if(mtex->normapspace == MTEX_NSPACE_CAMERA); else if(mtex->normapspace == MTEX_NSPACE_WORLD) { @@ -2687,7 +2687,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa if(mtex->texco==TEXCO_OBJECT) { Object *ob= mtex->object; if(ob) { - VECCOPY(co, xyz); + copy_v3_v3(co, xyz); if(mtex->texflag & MTEX_OB_DUPLI_ORIG) { if(shi->obi && shi->obi->duplitexmat) mul_m4_v3(shi->obi->duplitexmat, co); @@ -2699,16 +2699,16 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa else if(mtex->texco==TEXCO_ORCO) { if(mtex->texflag & MTEX_DUPLI_MAPTO) { - VECCOPY(co, shi->duplilo); + copy_v3_v3(co, shi->duplilo); } else { Object *ob= shi->obi->ob; - VECCOPY(co, xyz); + copy_v3_v3(co, xyz); mul_m4_v3(ob->imat_ren, co); } } else if(mtex->texco==TEXCO_GLOB) { - VECCOPY(co, xyz); + copy_v3_v3(co, xyz); mul_m4_v3(R.viewinv, co); } else continue; // can happen when texco defines disappear and it renders old files @@ -3054,7 +3054,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f break; case TEXCO_OBJECT: if(mtex->object) { - VECCOPY(tempvec, lo); + copy_v3_v3(tempvec, lo); mul_m4_v3(mtex->object->imat_ren, tempvec); co= tempvec; } @@ -3062,16 +3062,16 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f case TEXCO_GLOB: if(rco) { - VECCOPY(tempvec, rco); + copy_v3_v3(tempvec, rco); mul_m4_v3(R.viewinv, tempvec); co= tempvec; } else co= lo; -// VECCOPY(shi->dxgl, shi->dxco); +// copy_v3_v3(shi->dxgl, shi->dxco); // mul_m3_v3(R.imat, shi->dxco); -// VECCOPY(shi->dygl, shi->dyco); +// copy_v3_v3(shi->dygl, shi->dyco); // mul_m3_v3(R.imat, shi->dyco); break; } @@ -3203,11 +3203,11 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef co= tempvec; dx= dxt; dy= dyt; - VECCOPY(tempvec, shi->co); + copy_v3_v3(tempvec, shi->co); mul_m4_v3(ob->imat_ren, tempvec); if(shi->osatex) { - VECCOPY(dxt, shi->dxco); - VECCOPY(dyt, shi->dyco); + copy_v3_v3(dxt, shi->dxco); + copy_v3_v3(dyt, shi->dyco); mul_mat3_m4_v3(ob->imat_ren, dxt); mul_mat3_m4_v3(ob->imat_ren, dyt); } @@ -3219,12 +3219,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef } else if(mtex->texco==TEXCO_GLOB) { co= shi->gl; dx= shi->dxco; dy= shi->dyco; - VECCOPY(shi->gl, shi->co); + copy_v3_v3(shi->gl, shi->co); mul_m4_v3(R.viewinv, shi->gl); } else if(mtex->texco==TEXCO_VIEW) { - VECCOPY(tempvec, lavec); + copy_v3_v3(tempvec, lavec); mul_m3_v3(la->imat, tempvec); if(la->type==LA_SPOT) { @@ -3238,8 +3238,8 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef dx= dxt; dy= dyt; if(shi->osatex) { - VECCOPY(dxt, shi->dxlv); - VECCOPY(dyt, shi->dylv); + copy_v3_v3(dxt, shi->dxlv); + copy_v3_v3(dyt, shi->dylv); /* need some matrix conversion here? la->imat is a [3][3] matrix!!! **/ mul_m3_v3(la->imat, dxt); mul_m3_v3(la->imat, dyt); diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 644360520ad..7a39342ac8d 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -428,7 +428,7 @@ VlakRen *RE_vlakren_copy(ObjectRen *obr, VlakRen *vlr) surfnor= RE_vlakren_get_surfnor(obr, vlr, 0); if(surfnor) { surfnor1= RE_vlakren_get_surfnor(obr, vlr1, 1); - VECCOPY(surfnor1, surfnor); + copy_v3_v3(surfnor1, surfnor); } tangent= RE_vlakren_get_nmap_tangent(obr, vlr, 0); @@ -451,13 +451,12 @@ void RE_vlakren_get_normal(Render *UNUSED(re), ObjectInstanceRen *obi, VlakRen * float (*nmat)[3]= obi->nmat; if(obi->flag & R_TRANSFORMED) { - VECCOPY(nor, vlr->n); - - mul_m3_v3(nmat, nor); + mul_v3_m3v3(nor, nmat, vlr->n); normalize_v3(nor); } - else - VECCOPY(nor, vlr->n); + else { + copy_v3_v3(nor, vlr->n); + } } void RE_set_customdata_names(ObjectRen *obr, CustomData *data) @@ -953,7 +952,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f } har= RE_findOrAddHalo(obr, obr->tothalo++); - VECCOPY(har->co, vec); + copy_v3_v3(har->co, vec); har->hasize= hasize; /* actual projectvert is done in function project_renderdata() because of parts/border/pano */ @@ -1009,7 +1008,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f else { mtex= ma->mtex[0]; - VECCOPY(texvec, vec); + copy_v3_v3(texvec, vec); if(mtex->texco & TEXCO_NORM) { ; @@ -1022,7 +1021,7 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f } else { if(orco) { - VECCOPY(texvec, orco); + copy_v3_v3(texvec, orco); } } @@ -1067,7 +1066,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater } har= RE_findOrAddHalo(obr, obr->tothalo++); - VECCOPY(har->co, vec); + copy_v3_v3(har->co, vec); har->hasize= hasize; /* actual projectvert is done in function project_renderdata() because of parts/border/pano */ @@ -1123,7 +1122,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater for(i=0; i<MAX_MTEX; i++) if(ma->mtex[i] && (ma->septex & (1<<i))==0) { mtex= ma->mtex[i]; - VECCOPY(texvec, vec); + copy_v3_v3(texvec, vec); if(mtex->texco & TEXCO_NORM) { ; @@ -1133,7 +1132,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater mul_m4_v3(mtex->object->imat_ren,texvec); } else if(mtex->texco & TEXCO_GLOB){ - VECCOPY(texvec,vec); + copy_v3_v3(texvec,vec); } else if(mtex->texco & TEXCO_UV && uvco){ int uv_index=CustomData_get_named_layer_index(&dm->faceData,CD_MTFACE,mtex->uvname); @@ -1153,7 +1152,7 @@ HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mater texvec[2] = pa_co[2]; } else if(orco) { - VECCOPY(texvec, orco); + copy_v3_v3(texvec, orco); } hasrgb = externtex(mtex, texvec, &tin, &tr, &tg, &tb, &ta, 0); @@ -1264,7 +1263,7 @@ void project_renderdata(Render *re, void (*projectfunc)(const float *, float mat vec[2]= -re->panosi*har->co[0] + re->panoco*har->co[2]; } else { - VECCOPY(vec, har->co); + copy_v3_v3(vec, har->co); } projectfunc(vec, re->winmat, hoco); diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index a75bf5e14fd..128900d1fd2 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -114,10 +114,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) float fac= shi->translucency; shade_input_init_material(shi); - - VECCOPY(shi->vn, shi->vno); - VECMUL(shi->vn, -1.0f); - VECMUL(shi->facenor, -1.0f); + negate_v3_v3(shi->vn, shi->vno); + negate_v3(shi->facenor); shi->depth++; /* hack to get real shadow now */ shade_lamp_loop(shi, &shr_t); shi->depth--; @@ -184,8 +182,8 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) /* copy additional passes */ if(shi->passflag & (SCE_PASS_VECTOR|SCE_PASS_NORMAL)) { - QUATCOPY(shr->winspeed, shi->winspeed); - VECCOPY(shr->nor, shi->vn); + copy_v4_v4(shr->winspeed, shi->winspeed); + copy_v3_v3(shr->nor, shi->vn); } /* MIST */ @@ -286,9 +284,9 @@ void shade_input_set_triangle_i(ShadeInput *shi, ObjectInstanceRen *obi, VlakRen /* calculate vertexnormals */ if(vlr->flag & R_SMOOTH) { - VECCOPY(shi->n1, shi->v1->n); - VECCOPY(shi->n2, shi->v2->n); - VECCOPY(shi->n3, shi->v3->n); + copy_v3_v3(shi->n1, shi->v1->n); + copy_v3_v3(shi->n2, shi->v2->n); + copy_v3_v3(shi->n3, shi->v3->n); if(obi->flag & R_TRANSFORMED) { mul_m3_v3(obi->nmat, shi->n1); normalize_v3(shi->n1); @@ -341,26 +339,26 @@ void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spo shi->mode= shi->mat->mode_l; /* or-ed result for all nodes */ /* shade_input_set_viewco equivalent */ - VECCOPY(shi->co, spoint->co); - VECCOPY(shi->view, shi->co); + copy_v3_v3(shi->co, spoint->co); + copy_v3_v3(shi->view, shi->co); normalize_v3(shi->view); shi->xs= (int)spoint->x; shi->ys= (int)spoint->y; if(shi->osatex || (R.r.mode & R_SHADOW)) { - VECCOPY(shi->dxco, spoint->dtco); - VECCOPY(shi->dyco, spoint->dsco); + copy_v3_v3(shi->dxco, spoint->dtco); + copy_v3_v3(shi->dyco, spoint->dsco); } /* dxview, dyview, not supported */ /* facenormal, simply viewco flipped */ - VECCOPY(shi->facenor, spoint->nor); + copy_v3_v3(shi->facenor, spoint->nor); /* shade_input_set_normals equivalent */ if(shi->mat->mode & MA_TANGENT_STR) { - VECCOPY(shi->vn, spoint->tan) + copy_v3_v3(shi->vn, spoint->tan); } else { float cross[3]; @@ -373,7 +371,7 @@ void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spo negate_v3(shi->vn); } - VECCOPY(shi->vno, shi->vn); + copy_v3_v3(shi->vno, shi->vn); } void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert *svert, StrandPoint *spoint) @@ -393,17 +391,17 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert } if(mode & (MA_TANGENT_V|MA_NORMAP_TANG)) { - VECCOPY(shi->tang, spoint->tan); - VECCOPY(shi->nmaptang, spoint->tan); + copy_v3_v3(shi->tang, spoint->tan); + copy_v3_v3(shi->nmaptang, spoint->tan); } if(mode & MA_STR_SURFDIFF) { float *surfnor= RE_strandren_get_surfnor(obr, strand, 0); if(surfnor) - VECCOPY(shi->surfnor, surfnor) + copy_v3_v3(shi->surfnor, surfnor); else - VECCOPY(shi->surfnor, shi->vn) + copy_v3_v3(shi->surfnor, shi->vn); if(shi->mat->strand_surfnor > 0.0f) { shi->surfdist= 0.0f; @@ -418,7 +416,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert speed= RE_strandren_get_winspeed(shi->obi, strand, 0); if(speed) - QUATCOPY(shi->winspeed, speed) + copy_v4_v4(shi->winspeed, speed); else shi->winspeed[0]= shi->winspeed[1]= shi->winspeed[2]= shi->winspeed[3]= 0.0f; } @@ -426,18 +424,18 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert /* shade_input_set_shade_texco equivalent */ if(texco & NEED_UV) { if(texco & TEXCO_ORCO) { - VECCOPY(shi->lo, strand->orco); + copy_v3_v3(shi->lo, strand->orco); /* no shi->osatex, orco derivatives are zero */ } if(texco & TEXCO_GLOB) { - VECCOPY(shi->gl, shi->co); + copy_v3_v3(shi->gl, shi->co); mul_m4_v3(R.viewinv, shi->gl); if(shi->osatex) { - VECCOPY(shi->dxgl, shi->dxco); + copy_v3_v3(shi->dxgl, shi->dxco); mul_mat3_m4_v3(R.viewinv, shi->dxgl); - VECCOPY(shi->dygl, shi->dyco); + copy_v3_v3(shi->dygl, shi->dyco); mul_mat3_m4_v3(R.viewinv, shi->dygl); } } @@ -603,7 +601,7 @@ void shade_input_calc_viewco(ShadeInput *shi, float x, float y, float z, float v /* for non-wire, intersect with the triangle to get the exact coord */ float fac, dface, v1[3]; - VECCOPY(v1, shi->v1->co); + copy_v3_v3(v1, shi->v1->co); if(shi->obi->flag & R_TRANSFORMED) mul_m4_v3(shi->obi->mat, v1); @@ -721,9 +719,9 @@ void shade_input_set_uv(ShadeInput *shi) if((vlr->flag & R_SMOOTH) || (shi->mat->texco & NEED_UV) || (shi->passflag & SCE_PASS_UV)) { float v1[3], v2[3], v3[3]; - VECCOPY(v1, shi->v1->co); - VECCOPY(v2, shi->v2->co); - VECCOPY(v3, shi->v3->co); + copy_v3_v3(v1, shi->v1->co); + copy_v3_v3(v2, shi->v2->co); + copy_v3_v3(v3, shi->v3->co); if(shi->obi->flag & R_TRANSFORMED) { mul_m4_v3(shi->obi->mat, v1); @@ -822,18 +820,18 @@ void shade_input_set_normals(ShadeInput *shi) shi->vn[2]= l*n3[2]-u*n1[2]-v*n2[2]; // use unnormalized normal (closer to games) - VECCOPY(shi->nmapnorm, shi->vn); + copy_v3_v3(shi->nmapnorm, shi->vn); normalize_v3(shi->vn); } else { - VECCOPY(shi->vn, shi->facenor); - VECCOPY(shi->nmapnorm, shi->vn); + copy_v3_v3(shi->vn, shi->facenor); + copy_v3_v3(shi->nmapnorm, shi->vn); } /* used in nodes */ - VECCOPY(shi->vno, shi->vn); + copy_v3_v3(shi->vno, shi->vn); /* flip normals to viewing direction */ if(!(shi->vlr->flag & R_TANGENT)) @@ -856,18 +854,18 @@ void shade_input_set_vertex_normals(ShadeInput *shi) shi->vn[2]= l*n3[2]-u*n1[2]-v*n2[2]; // use unnormalized normal (closer to games) - VECCOPY(shi->nmapnorm, shi->vn); + copy_v3_v3(shi->nmapnorm, shi->vn); normalize_v3(shi->vn); } else { - VECCOPY(shi->vn, shi->facenor); - VECCOPY(shi->nmapnorm, shi->vn); + copy_v3_v3(shi->vn, shi->facenor); + copy_v3_v3(shi->nmapnorm, shi->vn); } /* used in nodes */ - VECCOPY(shi->vno, shi->vn); + copy_v3_v3(shi->vno, shi->vn); } @@ -956,7 +954,7 @@ void shade_input_set_shade_texco(ShadeInput *shi) mul_m3_v3(obi->nmat, shi->tang); normalize_v3(shi->tang); - VECCOPY(shi->nmaptang, shi->tang); + copy_v3_v3(shi->nmaptang, shi->tang); } } @@ -969,9 +967,9 @@ void shade_input_set_shade_texco(ShadeInput *shi) vlr_set_uv_indices(shi->vlr, &j1, &j2, &j3); - VECCOPY(c0, &tangent[j1*4]); - VECCOPY(c1, &tangent[j2*4]); - VECCOPY(c2, &tangent[j3*4]); + copy_v3_v3(c0, &tangent[j1*4]); + copy_v3_v3(c1, &tangent[j2*4]); + copy_v3_v3(c2, &tangent[j3*4]); // keeping tangents normalized at vertex level // corresponds better to how it's done in game engines @@ -999,12 +997,12 @@ void shade_input_set_shade_texco(ShadeInput *shi) float *surfnor= RE_vlakren_get_surfnor(obr, shi->vlr, 0); if(surfnor) { - VECCOPY(shi->surfnor, surfnor) + copy_v3_v3(shi->surfnor, surfnor); if(obi->flag & R_TRANSFORMED) mul_m3_v3(obi->nmat, shi->surfnor); } else - VECCOPY(shi->surfnor, shi->vn) + copy_v3_v3(shi->surfnor, shi->vn); shi->surfdist= 0.0f; } @@ -1057,16 +1055,16 @@ void shade_input_set_shade_texco(ShadeInput *shi) } } - VECCOPY(shi->duplilo, obi->dupliorco); + copy_v3_v3(shi->duplilo, obi->dupliorco); } if(texco & TEXCO_GLOB) { - VECCOPY(shi->gl, shi->co); + copy_v3_v3(shi->gl, shi->co); mul_m4_v3(R.viewinv, shi->gl); if(shi->osatex) { - VECCOPY(shi->dxgl, shi->dxco); + copy_v3_v3(shi->dxgl, shi->dxco); mul_mat3_m4_v3(R.viewinv, shi->dxgl); - VECCOPY(shi->dygl, shi->dyco); + copy_v3_v3(shi->dygl, shi->dyco); mul_mat3_m4_v3(R.viewinv, shi->dygl); } } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index ab8a1934fde..431b2839c25 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -85,7 +85,7 @@ static void fogcolor(float *colf, float *rco, float *view) hor[0]= R.wrld.horr; hor[1]= R.wrld.horg; hor[2]= R.wrld.horb; zen[0]= R.wrld.zenr; zen[1]= R.wrld.zeng; zen[2]= R.wrld.zenb; - VECCOPY(vec, rco); + copy_v3_v3(vec, rco); /* we loop from cur coord to mist start in steps */ stepsize= 1.0f; @@ -1119,7 +1119,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist) { if(lar->type==LA_SUN || lar->type==LA_HEMI) { *dist= 1.0f; - VECCOPY(lv, lar->vec); + copy_v3_v3(lv, lar->vec); return 1.0f; } else { @@ -1183,7 +1183,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist) float lvrot[3], x; /* rotate view to lampspace */ - VECCOPY(lvrot, lv); + copy_v3_v3(lvrot, lv); mul_m3_v3(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); @@ -1425,7 +1425,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int add_to_diffuse(shr->diff, shi, is, i_noshad*lacol[0], i_noshad*lacol[1], i_noshad*lacol[2]); } else - VECCOPY(shr->diff, shr->shad); + copy_v3_v3(shr->diff, shr->shad); } } @@ -1712,9 +1712,9 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) /* AO was calculated for scanline already */ if(shi->depth || shi->volume_depth) ambient_occlusion(shi); - VECCOPY(shr->ao, shi->ao); - VECCOPY(shr->env, shi->env); // XXX multiply - VECCOPY(shr->indirect, shi->indirect); // XXX multiply + copy_v3_v3(shr->ao, shi->ao); + copy_v3_v3(shr->env, shi->env); // XXX multiply + copy_v3_v3(shr->indirect, shi->indirect); // XXX multiply } } } @@ -1759,7 +1759,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) invalpha= (shr->col[3] > FLT_EPSILON)? 1.0f/shr->col[3]: 1.0f; if(texfac==0.0f) { - VECCOPY(col, shr->col); + copy_v3_v3(col, shr->col); mul_v3_fl(col, invalpha); } else if(texfac==1.0f) { @@ -1767,7 +1767,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) mul_v3_fl(col, invalpha); } else { - VECCOPY(col, shr->col); + copy_v3_v3(col, shr->col); mul_v3_fl(col, invalpha); col[0]= pow(col[0], 1.0f-texfac); col[1]= pow(col[1], 1.0f-texfac); @@ -1787,9 +1787,9 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) } if(shi->combinedflag & SCE_PASS_SHADOW) - VECCOPY(shr->combined, shr->shad) /* note, no ';' ! */ + copy_v3_v3(shr->combined, shr->shad); /* note, no ';' ! */ else - VECCOPY(shr->combined, shr->diff); + copy_v3_v3(shr->combined, shr->diff); /* calculate shadow pass, we use a multiplication mask */ /* if diff = 0,0,0 it doesn't matter what the shadow pass is, so leave it as is */ @@ -1867,7 +1867,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr) sub_v3_v3v3(shr->refl, result, shr->combined); if(shi->combinedflag & SCE_PASS_REFLECT) - VECCOPY(shr->combined, result); + copy_v3_v3(shr->combined, result); } |