Tint
Task
Create a shader program that applies a yellow tint to an original image.
Here you can recall how to access the texture that is attached to a shader program: texture
Theory
Tinting an image is a fundamental technique in shader programming, often used to dynamically adjust colors for visual effects. This is achieved through color multiplication, where each pixel (texel) of the image is multiplied by a tint color vector:
$ \mathbf{result}{\text{rgb}} = \mathbf{frag}{\text{rgb}} * \mathbf{tint}_{\text{rgb}} $
This process preserves the original image details while modifying the overall color tone.
Applications of Tinting
- Character customization - changing an outfit's color dynamically.
- Scene adjustments - modifying the environment's hue based on time of day.
- UI feedback effects - highlighting elements (e.g., when hovering over a button).
- Stylized rendering - creating artistic effects such as monochrome filters.