fragment
fragment: string
The GLSL implementation of the fragment shader. Instead of main, it implements vec4 effectMain() returning the color to be output.
effectMain should sample u_diffuse directly using TEXTURE() or TEXTURE_PROJ() instead of texture2D(), texture2DProj(), or texture();
or, if sampleSourcePixel is defined, it can use sampleSourcePixel() instead.
It should not assign to gl_FragColor.
The alpha component of the output color is ignored as there is nothing with which to blend.
Defined in
Last Updated: 29 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.