let newFont;
function preload() {
newFont = loadFont('fonts/Montserrat.otf');
}
function setup() {
createCanvas(600, 300, WEBGL);
textFont(newFont, 18);
redColorSlider = createSlider(0, 255, 128, 1);
redColorSlider.position(20, 50);
blueColorSlider = createSlider(0, 255, 128, 1);
blueColorSlider.position(20, 80);
}
function draw() {
background('green');
text("Move the sliders to change the red and"
+ " blue specular highlights", -285, -125);
noStroke();
shininess(15);
redSpecularIntensity = redColorSlider.value();
blueSpecularIntensity = blueColorSlider.value();
specularColor(redSpecularIntensity, 0, 0);
pointLight(255, 0, 0, -width / 2, -height / 2, 250);
specularColor(0, 0, blueSpecularIntensity);
pointLight(0, 0, 255, width / 2, height / 2, 250);
specularMaterial(250);
sphere(100);
}