Advertisement

Cel Shading for Games

Started by March 22, 2022 03:06 AM
5 comments, last by Komatsu 2 years, 8 months ago

Good Day,

I have been starting to get back into some game developing, I was thinking of having a simple cartoon look to the game I'm working on. Just a simple question, if I want my game to have a cartoony, cel shaded look to it, is this done in the 3d application such as blender when im texturing my objects, or do i have to do the Cel Shaded look inside the game engine itself, unity?

Much appreciated for all your time.

It might depend on the visual perspective of your game, on whether you intend 3D objects or 2D sprites, and on the specific style that you have in mind.

If you apply the shading when texturing your objects, then it (presumably) won't change as they move or turn--if they do move or turn in your game. Whether that's desirable or undesirable will, I imagine, depend on the things that I mentioned above (and perhaps more).

For example, if you intend to have 3D objects, but that never rotate and that are seen from an isometric, unchanging perspective, then applying your shading in your textures might be easier, and further make it easier to achieve good results.

Conversely, if you intend to have 3D objects that are explored from a first-person perspective, and don't want a static art-style, then applying your shading in your textures may not work--applying them in your code (via a shader, I imagine) might be called for.

(All this presumes that the artist doing this (whether you or someone else) is familiar with the technique in question.)

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Advertisement

Uncharted_Artist said:
is this done in the 3d application such as blender when im texturing my objects, or do i have to do the Cel Shaded look inside the game engine itself, unity?

Technically it is ‘wrong’ to apply line art to textures, because such lines are view dependent. It's a similar mistake than painting lighting into textures. In Borderlines they did it anyway, for example.

The ‘correct’ way is to make lines appear on silhouettes, usually where face normals are normal to the viewing direction. The standard way to do this is to render black back faces of a slightly extruded version of the mesh, then render normally, which gives black outlines. A similar effect can be achieved in pixel shader, using a threshold on V dot N, which can be also used to quantize to two shades like light and dark. There is also the option to detect depth or material discontinuities (Sable for example). Usually multiple techniques are combined, and there should be many tutorials. This gives the expected anime look.

Some games also use wireframe rendering to get soemthing like this: https://www.youtube.com/watch?v=vLt4ZXcDdIQ

A difficult effect would cross hatch shading. It would work e.g. by precomputing a curvature aligned line field on geometry, turning this into a wave field in screenspace, finally extract hatches. But i never saw this in a game yet.
An easier way is half tone rendering, like shown in this game: https://www.youtube.com/watch?v=ILolesm8kFY

@Thaumaturge Thanks for the info good sir! Yeah I'm still messing around to see which direction I want to go. The view will be an orthographic, but the player will be able to rotate the camera from this view, so not sure if your method of baking the textures will have a less than desirable result because of this. I was just wondering because I was studying some great tutorials on how to have a cartoony look in Blender, but I started to wonder if all this work done in blender with the shaders and what not would transfer over into unity when its all done, or if I would have to achieve this effect through the unity game engine instead. I will mess around and see what I find. Appreciate your time.

@JoeJ Thanks Joe for the info. That wireframe style looks awesome, not sure it will work for what I'm going for however.

I think there are a few games that are using watercolor like textures on the model then use a shader to put a black silhouette around the player. This seems to work well depending on the look you're going for. It is discussed many places online how to put a silhouette around the player people sometimes use this to show a character selection but you can change it to be there all the time with a black line.

This topic is closed to new replies.

Advertisement