p5.js | emissiveMaterial() Function
The emissiveMaterial() function in p5.js is used to create a emissive material for a geometry with the given color. The emissivity of an object gives it the appearance that the object is glowing. An emissive material would still display in full strength even if no light exists in the scene, unlike ambient or specular materials.
emissiveMaterial( v1, [v2], [v3], [a] )
emissiveMaterial( color )
Parameters: This function accept four parameters as mentioned above and described below:
- v1: It is a number which determines the gray value, or the red or hue value relative to the current color range.
- v2: It is a number which determines the green or saturation value relative to the current color range. It is an optional parameter.
- v3: It is a number which determines the blue or brightness value relative to the current color range. It is an optional parameter.
- a: It is a number which denotes the opacity of the material. It is an optional parameter.
- color: It is a p5.Color or color string which defines the color of the material.
The example below illustrates the emissiveMaterial() function in p5.js:
Example: The example below shows that the emissive material always shows regardless of the ambient light present.
Online editor: https://editor.p5js.org/
Environment Setup: https://www.geeksforgeeks.org/p5-js-soundfile-object-installation-and-methods/
Please Login to comment...