Skip to content

Instantly share code, notes, and snippets.

@Taremin
Created February 7, 2020 04:39
Show Gist options
  • Save Taremin/1695472b5dafe7fb373f741adbd1cfd0 to your computer and use it in GitHub Desktop.
Save Taremin/1695472b5dafe7fb373f741adbd1cfd0 to your computer and use it in GitHub Desktop.
shader hue_shift (
float Hue = 0.0,
float Scale = 1.0,
output float Highlight = 0.0,
output float Shadow = 0.0
) {
float tmp = Hue * 3;
Shadow = ((round(tmp) - tmp) * Scale + tmp) / 3.0;
Highlight = ((floor(tmp) + 0.5 - tmp) * Scale + tmp) / 3.0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment