Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- half3 HueShift01(half3 c, half shift)
- {
- half3 result = c;
- half u = cos(shift*3.14/180);
- half w = sin(shift*3.14/180);
- result.r = (0.29 + 0.701*u + 0.168*w)*c.r +
- (0.587 - 0.587*u + 0.330*w)*c.g +
- (0.114 - 0.114*u - 0.497*w)*c.b;
- result.g = (0.299 - 0.299*u - 0.328*w)*c.r +
- (0.587 + 0.413*u + 0.035*w)*c.g +
- (0.114 - 0.114*u + 0.292*w)*c.b;
- result.b = (0.299 - 0.3*u + 1.25*w)*c.r +
- (0.587 - 0.588*u - 1.05*w)*c.g +
- (0.114 + 0.886*u - 0.203*w)*c.b;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement