@@ -2569,7 +2569,7 @@ function material(p5, fn) {
25692569 /**
25702570 * Sets a normal map to add surface detail to shapes under lighting.
25712571 *
2572- * `normalTexture()` works like <a href="#/p5/texture">texture()</a>, but for a
2572+ * `normalTexture()` works like <a href="#/p5/texture">` texture()` </a>, but for a
25732573 * tangent-space normal map: an image whose red, green, and blue channels
25742574 * encode the direction of the surface normal (not brightness). Call it before
25752575 * drawing a shape and its surface normals get perturbed by the map, so lights
@@ -2591,6 +2591,8 @@ function material(p5, fn) {
25912591 * @chainable
25922592 *
25932593 * @example
2594+ * // Click and drag the mouse to view the scene from different angles.
2595+ *
25942596 * let normalMap;
25952597 *
25962598 * function setup() {
@@ -2621,6 +2623,12 @@ function material(p5, fn) {
26212623 * function draw() {
26222624 * background(0);
26232625 *
2626+ * // Enable orbiting with the mouse.
2627+ * orbitControl();
2628+ *
2629+ * // Rock the shape so the lighting shifts across it.
2630+ * rotateY(sin(millis() * 0.002) * PI * 0.1);
2631+ *
26242632 * // Light the sphere from the upper left.
26252633 * ambientLight(60);
26262634 * pointLight(255, 255, 255, -80, -80, 150);
@@ -2643,17 +2651,17 @@ function material(p5, fn) {
26432651 * Sets an image that controls where a shape looks glossy.
26442652 *
26452653 * A specular map lets one shape mix polished and worn surfaces. It works like
2646- * <a href="#/p5/texture">texture()</a>, but instead of setting the base color,
2654+ * <a href="#/p5/texture">` texture()` </a>, but instead of setting the base color,
26472655 * the map's color at each point scales the highlight set by
2648- * <a href="#/p5/specularMaterial">specularMaterial()</a>. Bright parts of the
2656+ * <a href="#/p5/specularMaterial">` specularMaterial()` </a>. Bright parts of the
26492657 * map stay shiny and dark parts look matte.
26502658 *
26512659 * The parameter, `tex`, is the image to use as the specular map. Passing
26522660 * `null` clears it, as in `specularTexture(null)`. The map can also be scoped
2653- * between <a href="#/p5/push">push()</a> and <a href="#/p5/pop">pop()</a>.
2661+ * between <a href="#/p5/push">` push()` </a> and <a href="#/p5/pop">` pop()` </a>.
26542662 *
26552663 * A light source is needed to see the effect. Models loaded with
2656- * <a href="#/p5/loadModel">loadModel()</a> apply their own specular map from
2664+ * <a href="#/p5/loadModel">` loadModel()` </a> apply their own specular map from
26572665 * the `.mtl` file's `map_Ks`.
26582666 *
26592667 * Note: `specularTexture()` can only be used in WebGL mode.
@@ -2663,6 +2671,8 @@ function material(p5, fn) {
26632671 * @chainable
26642672 *
26652673 * @example
2674+ * // Click and drag the mouse to view the scene from different angles.
2675+ *
26662676 * let specularMap;
26672677 *
26682678 * function setup() {
@@ -2691,6 +2701,12 @@ function material(p5, fn) {
26912701 * function draw() {
26922702 * background(0);
26932703 *
2704+ * // Enable orbiting with the mouse.
2705+ * orbitControl();
2706+ *
2707+ * // Rock the shape so the lighting shifts across it.
2708+ * rotateY(sin(millis() * 0.002) * PI * 0.1);
2709+ *
26942710 * // Light the surface head on so the highlight spreads across it.
26952711 * ambientLight(50);
26962712 * pointLight(255, 255, 255, 0, 0, 300);
@@ -2715,17 +2731,17 @@ function material(p5, fn) {
27152731 * Sets an image that controls the color a shape reflects from ambient light.
27162732 *
27172733 * An ambient map varies the color set by
2718- * <a href="#/p5/ambientMaterial">ambientMaterial()</a> across a surface, so
2734+ * <a href="#/p5/ambientMaterial">` ambientMaterial()` </a> across a surface, so
27192735 * different parts of one shape can pick up ambient light differently. It works
2720- * like <a href="#/p5/texture">texture()</a>, but the map's color is applied to
2736+ * like <a href="#/p5/texture">` texture()` </a>, but the map's color is applied to
27212737 * the ambient term rather than the base color.
27222738 *
27232739 * The parameter, `tex`, is the image to use as the ambient map. Passing `null`
27242740 * clears it, as in `ambientTexture(null)`. The map can also be scoped between
2725- * <a href="#/p5/push">push()</a> and <a href="#/p5/pop">pop()</a>.
2741+ * <a href="#/p5/push">` push()` </a> and <a href="#/p5/pop">` pop()` </a>.
27262742 *
2727- * An <a href="#/p5/ambientLight">ambientLight()</a> is needed to see the
2728- * effect. Models loaded with <a href="#/p5/loadModel">loadModel()</a> apply
2743+ * An <a href="#/p5/ambientLight">` ambientLight()` </a> is needed to see the
2744+ * effect. Models loaded with <a href="#/p5/loadModel">` loadModel()` </a> apply
27292745 * their own ambient map from the `.mtl` file's `map_Ka`.
27302746 *
27312747 * Note: `ambientTexture()` can only be used in WebGL mode.
@@ -2735,6 +2751,8 @@ function material(p5, fn) {
27352751 * @chainable
27362752 *
27372753 * @example
2754+ * // Click and drag the mouse to view the scene from different angles.
2755+ *
27382756 * let ambientMap;
27392757 *
27402758 * function setup() {
@@ -2761,6 +2779,12 @@ function material(p5, fn) {
27612779 * function draw() {
27622780 * background(0);
27632781 *
2782+ * // Enable orbiting with the mouse.
2783+ * orbitControl();
2784+ *
2785+ * // Rock the shape so the lighting shifts across it.
2786+ * rotateY(sin(millis() * 0.002) * PI * 0.1);
2787+ *
27642788 * // Ambient light reveals the map's colors.
27652789 * ambientLight(200);
27662790 * noStroke();
@@ -2780,18 +2804,18 @@ function material(p5, fn) {
27802804 * Sets an image that controls how tight a shape's highlights are.
27812805 *
27822806 * A shininess map varies the value set by
2783- * <a href="#/p5/shininess">shininess()</a> across a surface. Only the map's
2807+ * <a href="#/p5/shininess">` shininess()` </a> across a surface. Only the map's
27842808 * red channel is read, and it scales the base shininess, so bright areas get
27852809 * a small, sharp highlight and dark areas get a broad, soft one. This lets a
27862810 * single shape look polished in some places and dull in others.
27872811 *
27882812 * The parameter, `tex`, is the image to use as the shininess map. Passing
27892813 * `null` clears it, as in `shininessTexture(null)`. The map can also be scoped
2790- * between <a href="#/p5/push">push()</a> and <a href="#/p5/pop">pop()</a>.
2814+ * between <a href="#/p5/push">` push()` </a> and <a href="#/p5/pop">` pop()` </a>.
27912815 *
27922816 * A light source and
2793- * <a href="#/p5/specularMaterial">specularMaterial()</a> are needed to see the
2794- * effect. Models loaded with <a href="#/p5/loadModel">loadModel()</a> apply
2817+ * <a href="#/p5/specularMaterial">` specularMaterial()` </a> are needed to see the
2818+ * effect. Models loaded with <a href="#/p5/loadModel">` loadModel()` </a> apply
27952819 * their own shininess map from the `.mtl` file's `map_Ns`.
27962820 *
27972821 * Note: `shininessTexture()` can only be used in WebGL mode.
@@ -2801,6 +2825,8 @@ function material(p5, fn) {
28012825 * @chainable
28022826 *
28032827 * @example
2828+ * // Click and drag the mouse to view the scene from different angles.
2829+ *
28042830 * let shininessMap;
28052831 *
28062832 * function setup() {
@@ -2830,6 +2856,12 @@ function material(p5, fn) {
28302856 * function draw() {
28312857 * background(0);
28322858 *
2859+ * // Enable orbiting with the mouse.
2860+ * orbitControl();
2861+ *
2862+ * // Rock the shape so the lighting shifts across it.
2863+ * rotateY(sin(millis() * 0.002) * PI * 0.1);
2864+ *
28332865 * // Light the surface from the upper left.
28342866 * ambientLight(40);
28352867 * pointLight(255, 255, 255, -60, -60, 180);
0 commit comments