top of page

Painterly Shader

As part of my third year capstone project, I developed a painterly shader intended to quickly and easily unify the art style of our animated short film.

The animated short film this shader was developed for, had a team of 12 people. With so many people creating assets, each in their own dcc, creating a consistent art style was going to be a challenge. I decided the easiest way to handle this was to create a post process shader to aid the art style, without any setup needed on the asset side, allowing the other artists to focus on their own work without additional requirements. Alongside this I made a simple UI to control the variables of the shader, as well as basic camera controls and sun positioning.

Many of the team members had never used Unreal Engine before, so I wanted to move the most common camera controls to the UI, letting our DOP to setup shots with minimal experience with Unreal.

The shader has three main parts, world normal manipulation, image filtering, and object masking to account for objects in the scene that move or need different shading applied. The shader starts by taking the World Normal Buffer and using this to align the chosen distortion textures with the surface of the objects in the scene. These surface aligned textures are used to distort the Scene UVs, this moves where each pixel should be rendered, causing shapes to bleed into each other as if they had been painted. By significantly turning up the strength of this effect we can see the different align these textures has, instead of being applied flat across the screen.

World Normal Buffer

           Left: Using screen space distortion the effect is horizontally aligned.                       Right: Using world aligned distortion the effect follows the orientation of objects.

Two different textures are used to distort the, one to add a brush stroke effect, and the other adding larger scale distortion to gently break up straight lines and edges. The two textures can have their rotation, scale, and intensity controlled from the UI to quickly adjust the stylisation.

The second part of the shader is a Kuwahara filter which uses the brightest pixel in a given area to replace it's neighbors. This gives the effect of having patches or strokes of color, rather than each pixel having different colors. This filter also uses a Sobel filter to determine edges within the scene, and align the pixel filtering along these edges. With separate x and y radius control we can scale the affect of the filtering to match the stroke-like distortion of the rest of the shader. These two elements working together produce the desired painterly style.

bottom of page