diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-03-30 13:57:58 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-03-30 13:57:58 +0400 |
commit | bdea39c809c606cb19641757db8bf0efe67ce11c (patch) | |
tree | 00a950f205061a92374467c17d30398e9164b670 /source | |
parent | c36e00cd5284721a87e49cc2e24bb4dcf445c636 (diff) |
Fix #21827: Outer portions of extruded 2D curves do not render correctly
DispList->rt is used by render stuff to set vlak flags. This rt field is setting
to nurbs's flags in displist creation function. Possible flags for nurbs are
CU_SMOOTH and CU_2D. CU_SMOOTH is ok, but CU_2D conflicts with R_NOPUNOFLIP.
I cleared rt's CU_2D flag. Don't forget about possible conflicts if new
nurbs flags will be added.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 487ecb810d4..29ee8aeab45 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1580,21 +1580,24 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase, if(forRender || nu->hide==0) { if(nu->pntsv==1) { len= SEGMENTSU(nu)*nu->resolu; - + dl= MEM_callocN(sizeof(DispList), "makeDispListsurf"); dl->verts= MEM_callocN(len*3*sizeof(float), "dlverts"); - + BLI_addtail(dispbase, dl); dl->parts= 1; dl->nr= len; dl->col= nu->mat_nr; dl->charidx= nu->charidx; - dl->rt= nu->flag; - + + /* dl->rt will be used as flag for render face and */ + /* CU_2D conflicts with R_NOPUNOFLIP */ + dl->rt= nu->flag & ~CU_2D; + data= dl->verts; if(nu->flagu & CU_NURB_CYCLIC) dl->type= DL_POLY; else dl->type= DL_SEGM; - + makeNurbcurve(nu, data, NULL, NULL, nu->resolu, 3*sizeof(float)); } else { @@ -1606,11 +1609,14 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase, dl->col= nu->mat_nr; dl->charidx= nu->charidx; - dl->rt= nu->flag; - + + /* dl->rt will be used as flag for render face and */ + /* CU_2D conflicts with R_NOPUNOFLIP */ + dl->rt= nu->flag & ~CU_2D; + data= dl->verts; dl->type= DL_SURF; - + dl->parts= (nu->pntsu*nu->resolu); /* in reverse, because makeNurbfaces works that way */ dl->nr= (nu->pntsv*nu->resolv); if(nu->flagv & CU_NURB_CYCLIC) dl->flag|= DL_CYCL_U; /* reverse too! */ @@ -1683,26 +1689,29 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba float *fp1, *data; BevPoint *bevp; int a,b; - + if (bl->nr) { /* blank bevel lists can happen */ - + /* exception handling; curve without bevel or extrude, with width correction */ if(dlbev.first==NULL) { dl= MEM_callocN(sizeof(DispList), "makeDispListbev"); dl->verts= MEM_callocN(3*sizeof(float)*bl->nr, "dlverts"); BLI_addtail(dispbase, dl); - + if(bl->poly!= -1) dl->type= DL_POLY; else dl->type= DL_SEGM; - + if(dl->type==DL_SEGM) dl->flag = (DL_FRONT_CURVE|DL_BACK_CURVE); - + dl->parts= 1; dl->nr= bl->nr; dl->col= nu->mat_nr; dl->charidx= nu->charidx; - dl->rt= nu->flag; - + + /* dl->rt will be used as flag for render face and */ + /* CU_2D conflicts with R_NOPUNOFLIP */ + dl->rt= nu->flag & ~CU_2D; + a= dl->nr; bevp= (BevPoint *)(bl+1); data= dl->verts; @@ -1716,10 +1725,10 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba } else { DispList *dlb; - + for (dlb=dlbev.first; dlb; dlb=dlb->next) { - /* for each part of the bevel use a separate displblock */ + /* for each part of the bevel use a separate displblock */ dl= MEM_callocN(sizeof(DispList), "makeDispListbev1"); dl->verts= data= MEM_callocN(3*sizeof(float)*dlb->nr*bl->nr, "dlverts"); BLI_addtail(dispbase, dl); @@ -1734,11 +1743,15 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba dl->nr= dlb->nr; dl->col= nu->mat_nr; dl->charidx= nu->charidx; - dl->rt= nu->flag; + + /* dl->rt will be used as flag for render face and */ + /* CU_2D conflicts with R_NOPUNOFLIP */ + dl->rt= nu->flag & ~CU_2D; + dl->bevelSplitFlag= MEM_callocN(sizeof(*dl->col2)*((bl->nr+0x1F)>>5), "col2"); bevp= (BevPoint *)(bl+1); - /* for each point of poly make a bevel piece */ + /* for each point of poly make a bevel piece */ bevp= (BevPoint *)(bl+1); for(a=0; a<bl->nr; a++,bevp++) { float fac=1.0; @@ -1748,7 +1761,7 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba } else { fac = calc_taper(scene, cu->taperobj, a, bl->nr); } - + if (bevp->split_tag) { dl->bevelSplitFlag[a>>5] |= 1<<(a&0x1F); } @@ -1762,9 +1775,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba vec[0]= fp1[1]+widfac; vec[1]= fp1[2]; vec[2]= 0.0; - + mul_qt_v3(bevp->quat, vec); - + data[0]= bevp->vec[0] + fac*vec[0]; data[1]= bevp->vec[1] + fac*vec[1]; data[2]= bevp->vec[2] + fac*vec[2]; |