OpenGl Hue Rotation???

    Aug 24 2016 | 12:36 pm
    Hey everyone,
    I'm working on an RGB shift video mixer, I've already got one working well with the normal Jitter objects but am working on an OpenGL version. One thing I have not been able to find a substitute for is the jit.hue object to be able to rotate the overall hue of the image, does any one have a or worked up that performs this function? If not, does anyone have any ideas on how to develop one? Thank you!

    • Aug 24 2016 | 3:14 pm
      One way to do this is to do a matrix rotation of RGB cube space along the grayscale axis (cube diagonal) to change hue while maintaining constant luminance. [] also has rgb2hsl and hsl2rgb operators.
    • Aug 25 2016 | 8:47 pm
      Sounds like your first idea may be a bit beyond my level, how could I implement the rgb2hsl operator to do the job? I'm trying to figure it out, simply running a video through the operator and outputting it changes all the colors, and I can't figure out how to parse just the hue information and alter it...any ideas?
    • Aug 25 2016 | 9:56 pm
      gl.pix is tricky to get the hang of, but once you do your jitter-gl world opens up significantly.
      for hue shifting, you send the input through rgb2hsl, swiz the hue value (component 0, or 'r', or 'x'), modify with your hue parameter, concat back with the other components, send back to hsl2rgb and out the outlet.
    • Aug 27 2016 | 12:53 pm
      Sounds like your first idea may be a bit beyond my level, how could I implement the rgb2hsl operator to do the job?
      Yeah, it's kinda beyond my level too. However, today... today is a good day - for me and you and any other hue-rotating yahoos in maxspace. I managed to create a drop-in [jit.hue] replacement in genexpr that actually does a better job at maintaining constant color-brightness with smoother hue transitions + saturation adjustments that also maintain constant luma... yee haw.
      The issue is that certain colors are brighter than others. If hue is changed without adjusting for that difference, there is a secondary shift in brightness. That's the idea behind [jit.hue] which does a better job at maintaining constant luma than the quick and easy HSL breakout.
      For example, you might map amplitude to brightness and pitch to hue. But as hue is adjusted, amplitude gets affected. Maybe you want that, maybe you don't. To keep the secondary param from fluctuating, the space can be rotated and sheared so that changes to the hue-angle map to the same luma plane. The visual difference is very obvious with less banding and distortion. Of course you might want those artifacts, so be sure to test using different gradients and textures. Either way, this is as close to [jit.hue] on the GPU as I have seen in Max.
    • Feb 18 2017 | 4:05 pm
      Hello guys, i experience some strange problems with hue adjustment and the problem is that i cant open the help file of [where a hue example is integrated] in max7.3 64bit the software crashes.
      if i use max7.3 in 32bit mode i can open the help file but the result is always black and white. its the same with and cc.hsl2rgb.jxs file loaded. its black/white only.
      maybe you can confirm this or you can give me a hint what i can do. i'm using Windows 10 [with anniversary update] and max7.3 64bit and 32bit
      thank you in advance.
    • Feb 18 2017 | 4:21 pm
      The first issue with 64 bit vs 32 bit is that (at least on windows) 64 bit does not do video. You have to do it in 32-bit Max.
      With the second issue, do you mean there is an image and the image is black and white or that you can only see two colors, all black and all white? Either way I am not sure what the answer is there.
    • Feb 18 2017 | 5:35 pm
      Hi Andrew, thanks for you answer. yes. i just open the helpfile , start the default movie [] and if i change the hue_shift nothing happens. i see the movie in black and white only. i attached a screenshot.
      and concerning the the first issue. if i change to viddll engine it shouldl work [and i think it worked before] also in 64bit max. but the second issue is more important.
      thanks again in advance. matthias
    • Feb 18 2017 | 6:06 pm
      You are correct about viddll engine, I was thinking of the qt limitation. Anyways I the example I have is working in color, the one thing I was thinking of was that the range of hue rotation is from 0. to 1. but it looks like you already know that since you're set to 0.2 in your screenshot. So I am not sure what is causing it to only be in black and white.
    • Feb 20 2017 | 5:51 pm
      hi MH77, we've seen this reported a few times, where the rgb2hsl gen object is broken on certain Windows machines. this would most likely be the cause of your problem. we are looking into this, and will hopefully have a fix for it soon.
    • Feb 22 2017 | 5:16 pm
      hi rob, thank you for your comment. somehow i believe it has to do with nvidia drivers. i had one success in deinstalling the newest driver and install an nvidia driver from september 2016.
      it worked, but not for long. so. i hope you find a solution.
      best m
    • Jul 21 2017 | 8:04 am
      I have the same problem. Nvidia gtx1070 windows 10 max 32 and 64 bit the same
    • Jul 21 2017 | 10:03 am
      Solved after update Nvidia drivers