Cel Shading in GameMaker - Cartoon Chickens
A downloadable shader
Cel / toon shaders are an effect which manipulates lighting to give it a quantized, artistic look. It was made popular in video games by games such as The Legend of Zelda: The Wind Waker, Borderlands, Dragon Ball Fighter Z, and many others. It's used to give the games a flatter, cartoony look, as if they popped off of the page of a comic book or twentieth-century animation.
And you can use the effect for 3D games in GameMaker!
This extension is based on my Luminous Chickens 3D lighting library, so if you've used that, it sould look very similar.
- All of the stuff which Luminous Chickens includes: light types, ambient light, fog, etc.
- Adjust lighting levels using a ramp texture, allowing you to create stepwise lighting.
- Optionally use the vertical axis of the ramp texture to change lighting levels over time, i.e. to simulate a day-night cycle.
- Optional outlines, which you may set the opacity and color for (see included screenshots).
- Works on both Windows and Linux, and probably most other platforms.
- A demo project.
- This does NOT currently support colored lights. I may add this in the future, but I don't know if that's going to be a big deal for these since the light color is primarily driven by the ramp texture.
The shaders expect a 36-byte vertex format defined with a 3D position, a 3D normal, a 2D texture coordinate, and a 4D color. If your game builds vertex buffers with a different format, you will need to edit the attribute list in each shader. (If you're at a level where you know how to use this stuff, that probably won't be too hard for you.) I can't imagine you'll need anything other than position/normal/texture/color, since implementing normal mapping or something with a toon shader seems a bit counterproductive.
How They Work
I've made an extensive tutorial series on my YouTube channel about 3D lighting effects in GameMaker. This includes four videos about toon shaders, plus a large number of others.
Obviously, these are not beginner-level subjects. These (and others) would also be helpful to watch.
- 3D in GameMaker Studio 2 (full playlist)
- - - - - -
- 3D Directional Lights
- 3D Point Lights
- Fragment Shader Lighting (vs vertex shader)
- 3D Spot Lights
- 3D Spot Lights (advanced stuff)
- 3D Fog
- The High-Level Shader Language (HLSL)
- Multiple Render Targets
- Outline Detection - Sobel Filters
It's $5. If you pledge to (in past or present tense) my Patreon for a lifetime total of $5 or more, send me a message there and I'll give you a key.
If you don't want to pay, you can also learn how to write these things yourself via the YouTube links above - they're free, and probably more useful in the long run.
The demo's free.
- Noches the chicken officially has a statue built in her honor (I guess). Is this weird?
N/A this time. Documentation can be found here.
- The chicken icon, walking sprite, and the big ol' statue was created by @alemunin
- The 3D meshes in the demo were created by kenney.nl
- The skybox in the demo was created by Spiney
- The planet image maps came from somewhere on NASA's Jet Propulsion Laboratory gallery
In order to download this shader you must purchase it at or above the minimum price of $5 USD. You will get access to the following files:
- Documentation written (finally)Feb 17, 2021
Leave a comment
Log in with itch.io to leave a comment.