โ† All examples

godot shaders

Hue, saturation, value and sepia adjustment

Adjust a sprite's colours in HSV space (hue rotation, saturation, value), then optionally fade it toward greyscale or sepia, with contrast control, for variants, status effects and old-photo looks.

Recorded render of Hue, saturation, value and sepia adjustment

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • demo.tscn
  • inspect_shader.py
  • material.tres
  • preview.png
  • sprite_hsv_adjust.gdshader
  • test_package.py
  • verification/native.json

How it works

Shader type
canvas_item
Parameters
hue_shift_degrees (float = 0), saturation (float = 1), value (float = 1), contrast (float = 1), grayscale (float = 0), sepia (float = 0)
Use it on
A Sprite2D (or other textured CanvasItem) with transparent space around its shape, assigned to the node as usual.
Result
The orange sprite rotated to cool blue and green hues with a little more saturation.
Renderers
compatibility: compiled and rendered, forward plus: not verified, mobile: not verified
Placement
res://baltor/godot_shaders/sprite_hsv_adjust/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • contract_static
  • engine_run
  • engine_log_clean
  • shader_in_scene
  • capture_written
  • render_not_uniform
  • shader_changes_pixels

Limits to consider

Hue rotation in HSV is not perceptually uniform, so some hues change brightness as they rotate. Greys have no hue to rotate.