summaryrefslogtreecommitdiff
path: root/Master/texmf/asymptote/three_light.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf/asymptote/three_light.asy')
-rw-r--r--Master/texmf/asymptote/three_light.asy17
1 files changed, 6 insertions, 11 deletions
diff --git a/Master/texmf/asymptote/three_light.asy b/Master/texmf/asymptote/three_light.asy
index 36ba9a34c19..eb85ed0c3e5 100644
--- a/Master/texmf/asymptote/three_light.asy
+++ b/Master/texmf/asymptote/three_light.asy
@@ -2,27 +2,24 @@ struct material {
pen[] p; // diffusepen,ambientpen,emissivepen,specularpen
real opacity;
real shininess;
- real granularity;
void operator init(pen diffusepen=black, pen ambientpen=black,
pen emissivepen=black, pen specularpen=mediumgray,
real opacity=opacity(diffusepen),
- real shininess=defaultshininess,
- real granularity=-1) {
+ real shininess=defaultshininess) {
p=new pen[] {diffusepen,ambientpen,emissivepen,specularpen};
this.opacity=opacity;
this.shininess=shininess;
- this.granularity=granularity;
}
- void operator init(material m, real granularity=m.granularity) {
+ void operator init(material m) {
p=copy(m.p);
opacity=m.opacity;
shininess=m.shininess;
- this.granularity=granularity;
}
pen diffuse() {return p[0];}
pen ambient() {return p[1];}
pen emissive() {return p[2];}
pen specular() {return p[3];}
+
void diffuse(pen q) {p[0]=q;}
void ambient(pen q) {p[1]=q;}
void emissive(pen q) {p[2]=q;}
@@ -39,7 +36,6 @@ void write(file file, string s="", material x, suffix suffix=none)
write(file,", specular=",x.specular());
write(file,", opacity=",x.opacity);
write(file,", shininess=",x.shininess);
- write(file,", granularity=",x.granularity);
write(file,"}",suffix);
}
@@ -51,7 +47,7 @@ void write(string s="", material x, suffix suffix=endl)
bool operator == (material m, material n)
{
return all(m.p == n.p) && m.opacity == n.opacity &&
- m.shininess == n.shininess && m.granularity == n.granularity;
+ m.shininess == n.shininess;
}
material operator cast(pen p)
@@ -69,10 +65,9 @@ pen operator ecast(material m)
return m.p.length > 0 ? m.diffuse() : nullpen;
}
-material emissive(material m, real granularity=m.granularity)
+material emissive(material m)
{
- return material(black+opacity(m.opacity),black,m.diffuse(),black,m.opacity,1,
- granularity);
+ return material(black+opacity(m.opacity),black,m.diffuse(),black,m.opacity,1);
}
pen color(triple normal, material m, light light, transform3 T=light.T) {