Sign in to follow this  
Heinz Drache

Color cycling effect in RGB

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this