James ÅkessonTechnical Artist

Moebius Shader

A shader that uses diffuse colours to make line art and gradients to simulate the Moebius art style.

Year
2023
Kind
Shaders
Made with
Unreal Engine, HLSL
Live
Re-created on the landing page
Hooded character in blue armour walking through tall grass towards a large sandstone rock formation drawn with ink-style line art, red hatching and yellow speckles, in the Moebius shader.

The final appearance using lighting and all the different methods discussed below.

This project has been going on for a while now. I've worked on it from time to time when I learnt more about Unreal and its features.

My first attempt at outlines was to use an inverted hull. It gives the desired effect of giving objects outlines, but it doubles the mesh of all objects, and since I was the 2D, 3D and VFX artist on this project I didn't want to have to model specifically for getting good inverted outlines.

I tried out the same methods I had been using for outlines when working in Blender, trying to extract the angles on objects and adding lines based on that. But I quickly noticed it doesn't work in a living and moving environment, so I scrapped it quickly.

(Tried making hatching with textures, also scrapped)

Edge detection from normals, an early attempt

Hatching with textures, also scrapped

I tried making outlines by simply adding a small zone between the different shades in the cel shader to make lines within shapes. My idea was to combine this with my edge detection to get good line art for my shader. This did not work out so well...

Here you can see why it didn't work. It only works for specific shapes. When the shadow becomes low contrast, the outlines can become huge and no longer feel like outlines.

The material graph behind the cel-band line art: extract lighting data, map gradients to cel shades, line art, defining colours

I looked at a lot of Moebius artworks to help me in the search for simplified ways of giving the impression of lighting and line weight. I ended up using a gradient based on world position to give the impression of top-down lighting without the actual use of any lighting, and then I use the diffuse colour of the objects to define the line art in the shader.

I base the line art on the actual screen. I did it this way because line art is often done to adhere to the viewer's ability to read the lines. If the viewer will not be able to perceive a line then there does not need to be a line there. So by using the view of the player, I can add the line work where it actually matters. And in the process of doing so, we also get distance-scaled lines for free.

This process also gives the artist a lot of room for artistic expression since the shader takes into consideration both texture and modeling work.

The final method uses convolution written in HLSL and takes the inputs shown in the image. The scene textures can be any scene texture since they are just connected to access scene texture components in the HLSL code.

The final method: convolution in HLSL on scene textures

  1. Edge detection / line art
  2. Shadow edge

The full material graph

  1. Speckle details
  2. Extract lighting data
  3. Mapping gradients to cel shade
  4. Line art
  5. Hatch textures
  6. Gradient mapping
  7. Remove sky
  8. Distance scaling
  9. Outline
  10. Edge detection / line art
  11. Shadow edge
  12. Paper texture
  13. Adding colours
  14. Adding back the sky

I added shadow edge detection and a paper texture onto the camera to make this final appearance.