Github C++ Hue Saturation Sprite

Github C++ Hue Saturation Sprite
0

I just uploaded my first public code ever to GitHub…

I have built a lot of custom nodes for Fleets of Heroes in the last several years to meet my needs, and I figured I will slowly release some custom nodes that other people can use. It is hard to sometimes find easy to use custom nodes with specific applications, and a lot of examples / public code can be in different languages, outdated software, or need to be ported from objective-C.

The first node I decided to release is my HSV Sprite class. It is a very simple but powerful sprite subclass with full hue saturation and light control.

I will do more over time.

5 Likes

Thank you for sharing. This is useful.

1 Like

Is your Hue Staturation Sprite class similar to this link ?

1 Like

You know I actually tried that repo to do what I was trying to do in the past. We needed to be able to have full HSV changes on textures out of photoshop via just the 3 numeric values.

Mine is not just a hue shift, it is a full HSV with more control, and works a lot simpler. Although, I will say that class has more functionality to be created and initialized in more contexts, I did not expand that as it was not needed for my applications, but can be easily added by others.

Take a look at the code comparisons on both.

Also… I believe leaving the hue shift math to the shader and not the CPU is more optimal as well.

Sorry I’m not good in English ! I think I used the wrong word ! I edited my comment !
Thank you for contributing this feature to everyone ! I will use it in my game !
Thanks

1 Like

No problem!

The cocos2d-x community has saved me so much time and headache in my endeavors, I figured the least I can do for now is to help save other people time on some things I have worked on. I will likely do the Gaussian Sprite class next I worked on. I just need to clean up that node to be a bit more generic than I have it currently for public use whenever I get some time.

Video example using the class… The explosion animations of differing color (green and blue) are using the HueSatSpriteNode class

3 Likes

Awesome! This things can be really helpful. I remember how much I struggled with a simple shader I needed.

1 Like