Does Cocos2d-x support hue and saturation for sprites?

Does cocos2d-x 3.x support hue and saturation for sprites like this?

1 Like

up this.

Is there an easy way to do this?

been awhile, still haven’t find any easy way to do this. Do you have one already?

cocos2d-x recently added a material system with support for multiple passes. Cocos2d (objC) uses this approach to implement a set of ‘CCEffect’ derivatives from hue and brightness to reflections and drop shadowing.

@ricardo are there any plans to port these effects over to cocos2d-x? They would be a great showcase for the new material system.

@jvfiel As for right now, I think your best bet would be to port the CCSpriteWithHue implementation to c++.

A chinese guy ported to cocos2d-x

3 Likes

wow great! thanks, will try it

@chpax

The SpriteWithHue ported by @fusijie is working great with Cocos2d-JS v3.8.1.

@fusijie
Why it is not included in the Cocos2d-X engine? It is very useful.
Besides hue, is there anyway to adjust saturation and brightness of sprite like hue?

Thank you.

Hi, I tidy a glslutils for cocos2d-x to implement HSV, you just call glslutils::enableNodeIntelliShading to do this
cocos2d-x-glslutils.zip (99.5 KB)

showcase:

1 Like