The textureMode() function in p5.js is uses to set the coordinate space for texture mapping. This function works on the WEBGL mode. The IMAGE mode refers to the mapping the actual coordinates of the image. The NORMAL mode refers to the mapping of the normalized space of values ranging from 0 to 1.
Parameters: This function accepts a single parameter as mentioned above and described below:
- mode: This is a constant that sets the mode of the texture mapping. It can have two values, IMAGE or NORMAL. The default is the IMAGE mode.
The below example illustrates the textureMode() function in p5.js: