The default shader is the shader that the P2D and P3D renderers in Processing use when no custom shaders are set with the shader() function. All the drawing in P2D/P3D is done internally through a set of default GLSL shaders, which are automatically loaded and set by the renderers, depending on the type of geometry that is being handled (shapes without lights or textures, lit but non-textured shapes, stroke lines, etc). The default shaders are included in the core package of Processing as glsl files, you can take a look at them in the
source repo, for example.
If your custom shader cannot be used to render the geometry after the shader() call, then Processing wil use the appropriate default shader. The reason for this mismatch is that different types of geometry require a specific set of uniform and attribute variables in the shader. Processing expects certain names for these variables, so if you use different names for them then Processing won't be able to send the geometry data to the shader.
For example, if you want to write a custom shader to handle textured, non-lit shapes in Processing, then you need to have at least the following variables in the vertex shader:
- uniform mat4 projmodelviewMatrix;
- attribute vec4 inVertex;
- attribute vec4 inColor;
- attribute vec2 inTexcoord;
projmodelviewMatrix is the modelview matrix calculated from the camera and projection configuration in the sketch, while the inVertex, inColor and inTexcoord attributes correspond to the vertex coordinates, fill color and texture coordinates set with the fill() and vertex() functions.
Because in this example the shader defines the vec2 attribute inTexcoord, then Processing will assume that this shader is meant to handle textured shapes. If you try to use it to render shapes without textures, then you will get the warning message you mentioned before, but drawing will still work because the renderer will use its own internal shader to handle textured geometry.
I hope this clarify things a bit, unfortunately a comprehensive tutorial about shaders in Processing 2.0 is still missing.