summaryrefslogtreecommitdiff
path: root/graphics/asymptote/bezierpatch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/bezierpatch.cc')
-rw-r--r--graphics/asymptote/bezierpatch.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/graphics/asymptote/bezierpatch.cc b/graphics/asymptote/bezierpatch.cc
index 775c282e0c..29ef5c28c5 100644
--- a/graphics/asymptote/bezierpatch.cc
+++ b/graphics/asymptote/bezierpatch.cc
@@ -800,7 +800,6 @@ void Triangles::queue(size_t nP, const triple* P, size_t nN, const triple* N,
notRendered();
data.Vertices.resize(nP);
- data.indices.resize(3*nI);
MaterialIndex=nC ? -1-materialIndex : 1+materialIndex;
@@ -824,7 +823,7 @@ void Triangles::queue(size_t nP, const triple* P, size_t nN, const triple* N,
(GLfloat) C1.A};
GLfloat c2[]={(GLfloat) C2.R,(GLfloat) C2.G,(GLfloat) C2.B,
(GLfloat) C2.A};
- transparent |= c0[3]+c1[3]+c2[3] < 765;
+ transparent |= c0[3]+c1[3]+c2[3] < 3.0;
data.Vertices[PI0]=VertexData(P0,N[NI[0]],c0);
data.Vertices[PI1]=VertexData(P1,N[NI[1]],c1);
data.Vertices[PI2]=VertexData(P2,N[NI[2]],c2);
@@ -834,11 +833,11 @@ void Triangles::queue(size_t nP, const triple* P, size_t nN, const triple* N,
data.Vertices[PI2]=VertexData(P2,N[NI[2]]);
}
triple Q[]={P0,P1,P2};
+ std::vector<GLuint> &q=data.indices;
if(!offscreen(3,Q)) {
- size_t i3=3*i;
- data.indices[i3]=PI0;
- data.indices[i3+1]=PI1;
- data.indices[i3+2]=PI2;
+ q.push_back(PI0);
+ q.push_back(PI1);
+ q.push_back(PI2);
}
}
append();