Jump to content
  • Advertisement
Sign in to follow this  
Heinz Drache

Color cycling effect in RGB

This topic is 4486 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i'm trying to implement a color cycle effect for a glow shader. The glow effect is achieved by just bluring the incoming image, so the glowing (i.e. blured) regions have nearly the same color (with different intensity) than the blured object on the incoming image (suppose the background to be completely black). This works fine, but now i'm trying to implement a way to change the base color of the glow. My first idea was to convert every (glowing) fragment to HSI color space, change the H value to the desired value and then convert it back to RGB. I'm now wondering if there is a better (faster) way to do the effect, perhaps to do it in directly in RGB without converting to HSI. greetings Heinz

Share this post


Link to post
Share on other sites
Advertisement
I came up with an idea - do something conceptually similar to rotating vectors with the color value. Rotation is defined to be an operation that doesn't change the absolute value of the vector, but changes it's direction - just what you are looking for. A 3x3 rotation matrix to multiply the RGB part of the color value would do just fine and would be easily derived to get the effect you are looking for.

Share this post


Link to post
Share on other sites
You could also simply use the RGB as texture coordinates, and add an offset to animate, to sample a 3D texture so as to map the RGB to an arbitrary color space.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!