@@ -719,7 +719,7 @@ p5.prototype.normalMaterial = function(...args) {
719719} ;
720720
721721/**
722- * Sets the current material as an ambient material of the given color .
722+ * Sets the ambient color of the material .
723723 *
724724 * The ambientMaterial() color is the color the object will reflect
725725 * under **any** lighting.
@@ -823,9 +823,7 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) {
823823 p5 . _validateParameters ( 'ambientMaterial' , arguments ) ;
824824
825825 const color = p5 . prototype . color . apply ( this , arguments ) ;
826- this . _renderer . curFillColor = color . _array ;
827- this . _renderer . _useSpecularMaterial = false ;
828- this . _renderer . _useEmissiveMaterial = false ;
826+ this . _renderer . curAmbientColor = color . _array ;
829827 this . _renderer . _useNormalMaterial = false ;
830828 this . _renderer . _enableLighting = true ;
831829 this . _renderer . _tex = null ;
@@ -834,8 +832,7 @@ p5.prototype.ambientMaterial = function(v1, v2, v3) {
834832} ;
835833
836834/**
837- * Sets the current material as an emissive material of
838- * the given color.
835+ * Sets the emissive color of the material.
839836 *
840837 * An emissive material will display the emissive color at
841838 * full strength regardless of lighting. This can give the
@@ -897,8 +894,7 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) {
897894 p5 . _validateParameters ( 'emissiveMaterial' , arguments ) ;
898895
899896 const color = p5 . prototype . color . apply ( this , arguments ) ;
900- this . _renderer . curFillColor = color . _array ;
901- this . _renderer . _useSpecularMaterial = false ;
897+ this . _renderer . curEmissiveColor = color . _array ;
902898 this . _renderer . _useEmissiveMaterial = true ;
903899 this . _renderer . _useNormalMaterial = false ;
904900 this . _renderer . _enableLighting = true ;
@@ -908,7 +904,7 @@ p5.prototype.emissiveMaterial = function(v1, v2, v3, a) {
908904} ;
909905
910906/**
911- * Sets the current material as a specular material of the given color .
907+ * Sets the specular color of the material .
912908 *
913909 * A specular material is reflective (shiny). The shininess can be
914910 * controlled by the <a href="#/p5/shininess">shininess()</a> function.
@@ -985,9 +981,8 @@ p5.prototype.specularMaterial = function(v1, v2, v3, alpha) {
985981 p5 . _validateParameters ( 'specularMaterial' , arguments ) ;
986982
987983 const color = p5 . prototype . color . apply ( this , arguments ) ;
988- this . _renderer . curFillColor = color . _array ;
984+ this . _renderer . curSpecularColor = color . _array ;
989985 this . _renderer . _useSpecularMaterial = true ;
990- this . _renderer . _useEmissiveMaterial = false ;
991986 this . _renderer . _useNormalMaterial = false ;
992987 this . _renderer . _enableLighting = true ;
993988 this . _renderer . _tex = null ;
0 commit comments