I searched in the Asymptote documentation and found that material is handled as a structure in three_light.asy that has the following definition:
struct material {
pen[] p; // diffusepen,ambientpen,emissivepen,specularpen
real opacity;
real shininess;
void operator init(pen diffusepen=black, pen ambientpen=black,
pen emissivepen=black, pen specularpen=mediumgray,
real opacity=opacity(diffusepen),
real shininess=defaultshininess) {
p=new pen[] {diffusepen,ambientpen,emissivepen,specularpen};
this.opacity=opacity;
this.shininess=shininess;
}
The document says these are used to
implement OpenGL-style lighting, based on the Phong-Blinn specular model.
Where do I get information/examples of how to define the parameters? For example, how do I take advantage of this to define a glass material and draw a glass cup/cube that has a certain amount of deflection/transparency? Or are there available material definitions that I can start with?