-
Notifications
You must be signed in to change notification settings - Fork 0
ChickenToonFunctions
The following are the list of functions used with Cartoon Chickens. It's designed to be very similar to the base Luminous Chickens extension.
Cartoon Chickens adds another shader to the mix, shd_cluck_toon. Thanks to some advances in GameMaker since I originally wrote this, only one shader is needed (although you'll have to make a small change to get it to work on HTML5).
For documentation on the outlines, see this page.
Returns: N/A
| Parameter | Type | Description |
|---|---|---|
| shader | shader | The Luminous Chicken shader you wish to enable |
This is the same function as exists in Luminous Chickens, but I'm reiterating it here 'cause it's important.
Returns: N/A
| Parameter | Type | Description |
|---|---|---|
| sprite | sprite | A sprite resource to use as the toon shader's ramp texture |
Use this function to set the ramp texture used by the toon shader. See the About Toon Shaders page for a series of videos on how these work.
Normally, that would be a small, stepwise sprite like this:

(Make sure that the sprite is stored on its own texture page in GameMaker.)
You can use other ramp textures to adjust the lighting, though. I'm a fan of using both dimensions of the toon shader sampler to simulate effects like day/night color adjustment.

Returns: N/A
| Parameter | Type | Description |
|---|---|---|
| time | number (0 to 1) | A number between 0 and 1, used to determine which vertical scan line on the toon shader ramp texture to sample from |
Determine where on the vertical axis of the ramp texture to sample from. Cycling a value between 0 and 1 on the second image shown above will create something akin to a day/night lighting effect. You can also use this value for other in-game effects, not only time.
Formerly cluck_set_toon_time but I changed the name because I don't want to make it sound like it's only for day-night colorization.
Returns: N/A
| Parameter | Type | Description |
|---|---|---|
| simple_mode | boolean | Whether or not to enable Simple Mode (off by default) |
By default each light will have the toon shader effect(s) applied to it. On dedicated graphics cards this is only a minor hit to performance, but on integrated/mobile GPUs this may be more of a problem. Turning on Simple Mode will prevent the toon effect from being applied to every light in the scene, but instead to the light level as a whole.
Returns: N/A
| Parameter | Type | Description |
|---|---|---|
| tex_filter | boolean | Whether or not to enable texture filtering on the ramp texture |
If you want a smooth gradient on your ramp texture, you might want to enable linear texture filtering on it. This has a minor smoothing effect on the banding.