Wood Cut Markmaking

Summary

For our final major project in college, we were tasked with getting into groups and making a game. I was the group leader of 5 students and as my specific production role, I decided to focus on making shaders to bring the 3d and 2d specialist's work together.

Here I'm going to talk through the work I'm most proud of from the project, the shader that recreates wood cut markmaking.

System

The shader is based off basic 1-bit dithering principles, where we compare the darkness of the current pixel to a dithering texture to decide whether to use the dithered colour or the base colour. The difference here is that the 'darkness' the shader looks at is not the literal colour or lighting data, but instead a value computed based on the camera data. It's also done in the material colour, not as a post-process effect.

A screenshot of Unity Shader Graph. The nodes pictured left to right are Normal, Camera Direction, Dot Product, Remap and Add.

One of the influences on the 'darkness' value is the dot product between the camera direction and the normal vector, which is then increased by a nudge control. This creates shading on more sharply angled faces, dulling or even blacking them out, which helps show the contour of a model. The control is also very important so users can push this influence to be more or less significant on different materials.


A screenshot of Unity Shader Graph. The nodes pictured left to right are World Position, Camera Position, Subtract, Length and Remap.

A similar thing is done with the distance between the camera and the section of the model. The controls here are in a remap node, which translates to an effect on the range of distances the shader reacts to. This is useful for objects of different sizes, after all, a difference of 1m for a chair is going to be much more significant than for a castle.

Controls

Screenshot of a Unity Material options panel. Options pictured are Color, Noise texture, Texture Size, Dither colour, Dither Nudge, Distance Influence, Distance Range, Darken Amount, Auto Darken and Texture Rotate.

The controls exposed to artists look like this, and I was able to explain them to the rest of the team quite easily. One significant feature here is the auto-darken button, which is useful for more colourful scenes. We generally decided on using darker versions of the surface colour for the dithering in the coloured scenes, so the auto-darken generates that automatically. However, there's also cases where more control over the colour is desired, so you can set the dithering colour manually as well.

Screenshot of a game scene. A small collection of houses is clustered in the background, with some bushes and flowers in a garden. The game is rendered with flat colours and simple models but there's colour crosshatching and outlines over the models, especially the further away ones. Screenshot of a game scene. A small collection of houses is clustered in the background, with some bushes and flowers in a garden. The game is rendered with flat colours and simple models and no shader effects.

I think it turned out well in the final game, though I'm still partial to the black-and-white style myself.