Fragment Shaders
Common GLSL Variables and Functions:
These functions could be specific to Shadertoy or OpenGL ES
fragCoord.xy
: Current pixel coordinates (in pixels).iResolution.xy
: Screen resolution, used for normalization.iTime
: Time since shader started, useful for animation.iMouse
: Mouse position, used for interaction.iChannel0
,iChannel1
, etc.: Texture samplers for loading images or videos.gl_FragCoord
: Built-in pixel coordinates in GLSL.dot
,cross
,normalize
: Vector math functions for lighting and geometric operations.- Transformations: Rotation, scaling, and translation toanipulate coordinates.
mod
,fract
: Useful for creating repeating or tiled patterns.