- Particle system distribution wasn't flushed properly for non-edited hair.
- For instances in the renderer, also count their verts and faces in the stats.
- Fix for error in the "surface diffuse" formula for strand shading.
This commit is contained in:
2008-01-21 14:18:24 +00:00
parent 91e5b638c6
commit 14241f8349
6 changed files with 33 additions and 5 deletions

View File

@@ -3894,6 +3894,7 @@ static void find_dupli_instances(Render *re, ObjectRen *obr)
{
ObjectInstanceRen *obi;
float imat[4][4], obmat[4][4], obimat[4][4], nmat[3][3];
int first = 1;
Mat4MulMat4(obmat, obr->ob->obmat, re->viewmat);
Mat4Invert(imat, obmat);
@@ -3909,6 +3910,15 @@ static void find_dupli_instances(Render *re, ObjectRen *obr)
Mat3CpyMat4(nmat, obi->mat);
Mat3Inv(obi->imat, nmat);
if(!first) {
re->totvert += obr->totvert;
re->totvlak += obr->totvlak;
re->tothalo += obr->tothalo;
re->totstrand += obr->totstrand;
}
else
first= 0;
}
}
}

View File

@@ -288,7 +288,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
Material *ma= NULL;
float minz, maxz, vec[3], viewmat[4][4], obviewmat[4][4];
unsigned int lay = -1;
int i, a, ok= 1;
int i, a, maxtotvert, ok= 1;
char *clipflag;
minz= 1.0e30f; maxz= -1.0e30f;
@@ -296,7 +296,11 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
if(lar->mode & LA_LAYER) lay= lar->lay;
clipflag= MEM_callocN(sizeof(char)*re->totvert, "autoclipflag");
maxtotvert= 0;
for(obr=re->objecttable.first; obr; obr=obr->next)
maxtotvert= MAX2(obr->totvert, maxtotvert);
clipflag= MEM_callocN(sizeof(char)*maxtotvert, "autoclipflag");
/* set clip in vertices when face visible */
for(i=0, obi=re->instancetable.first; obi; i++, obi=obi->next) {

View File

@@ -1228,6 +1228,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
Crossf(nstrand, vn, cross);
blend= INPR(nstrand, shi->surfnor);
blend= 1.0f - blend;
CLAMP(blend, 0.0f, 1.0f);
VecLerpf(vnor, nstrand, shi->surfnor, blend);