summaryrefslogtreecommitdiff
path: root/graphics/asymptote/base/three_surface.asy
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/base/three_surface.asy')
-rw-r--r--graphics/asymptote/base/three_surface.asy37
1 files changed, 11 insertions, 26 deletions
diff --git a/graphics/asymptote/base/three_surface.asy b/graphics/asymptote/base/three_surface.asy
index e993c8d713..d0d79de464 100644
--- a/graphics/asymptote/base/three_surface.asy
+++ b/graphics/asymptote/base/three_surface.asy
@@ -1380,6 +1380,7 @@ void draw3D(frame f, patch s, material m,
int digits=s.planar && !straight ? 12 : settings.digits;
if(s.colors.length > 0) {
+ primitive=false;
if(prc() && light.on())
straight=false; // PRC vertex colors (for quads only) ignore lighting
m=material(m);
@@ -1489,8 +1490,6 @@ void draw(picture pic=currentpicture, triple[] v, int[][] vi,
project(v[vii[2]],P)--cycle;
pen p=color(n[ni[i][0]],m,light);
fill(pic,g,p);
- if(prc && opacity(m.diffuse()) == 1) // Fill subdivision cracks
- draw(pic,g,p);
}
}
}
@@ -1538,8 +1537,11 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
bool prc=prc();
if(s.draw != null && (primitive() || (prc && s.PRCprimitive))) {
bool noprerender=settings.prerender == 0;
- for(int k=0; k < s.s.length; ++k)
- draw3D(f,s.s[k],surfacepen[k],light,render,primitive=noprerender);
+ for(int k=0; k < s.s.length; ++k) {
+ patch p=s.s[k];
+ draw3D(f,p,surfacepen[k],light,render,primitive=noprerender);
+ if(p.colors.length > 0) noprerender=false;
+ }
if(noprerender)
s.draw(f,s.T,surfacepen,light,render);
} else {
@@ -1851,13 +1853,8 @@ void label(frame f, Label L, triple position, align align=NoAlign,
begingroup3(f2,Render);
begingroup3(f3,Render);
}
- for(patch S : s.s) {
- S=centering*S;
- draw3D(f3,S,L.p,light,Render);
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f3,S.external(),position,L.p,light,interaction);
- }
+ for(patch S : s.s)
+ draw3D(f3,centering*S,L.p,light,Render);
endgroup3(f3);
if(L.defaulttransform3)
add(f1,T*f3);
@@ -1874,9 +1871,6 @@ void label(frame f, Label L, triple position, align align=NoAlign,
triple V=L.align.is3D ? position+L.align.dir3*labelmargin(L.p) :
position;
draw3D(f,S,L.p,light,render(interaction(interaction,center=V)));
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f,S.external(),V,L.p,light,interaction);
}
endgroup3(f);
}
@@ -1941,13 +1935,8 @@ void label(picture pic=currentpicture, Label L, triple position,
begingroup3(f2,Render);
begingroup3(f3,Render);
}
- for(patch S : s.s) {
- S=centering*S;
- draw3D(f3,S,L.p,light,Render);
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f3,S.external(),v,L.p,light,interaction);
- }
+ for(patch S : s.s)
+ draw3D(f3,centering*S,L.p,light,Render);
endgroup3(f3);
if(L.defaulttransform3)
add(f1,T*f3);
@@ -1963,11 +1952,7 @@ void label(picture pic=currentpicture, Label L, triple position,
begingroup3(f,name,render);
for(patch S : surface(L,v,bbox=P.bboxonly).s) {
triple V=L.align.is3D ? v+L.align.dir3*labelmargin(L.p) : v;
- render Render=render(render,interaction(interaction,V));
- draw3D(f,S,L.p,light,Render);
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f,S.external(),V,L.p,light,interaction);
+ draw3D(f,S,L.p,light,render(render,interaction(interaction,V)));
}
endgroup3(f);
}