Advanced Outline/Toon Post Process Shader

Hello guys. I am looking for some help about creating a solid outline around my objects as well as drawing in their inline edges as well to create a drawn like effect.

I have tried the Unreal live-stream post process tutorial and the Toon shader that is included in the Unreal Toon Project. However, the results were not yet satisfying for my needs. ( Unreal Engine Livestream - Post Processing in UE4: Cel-Shading - Jan 4 - Live from Epic HQ - Announcements - Epic Developer Community Forums )

I am looking for a consistent outline in and out of the meshes because I have found especially difficult to get the inside lines working properly. I have recreated this project about edge detection ( Edge Detection PostProcess Feedbacks - Rendering - Epic Developer Community Forums ). And its almost working but still gives some weird result in certain angles and shapes. It uses world normals and scene depth to detect the edges.

I have some experience in Unreal but far from professional and I mostly do the ART part. However is there a way to achieve a consistent “in” and “out” lines around my visible edges? If yes is this the right approach or I should use a different technique? I am uploading a screenshot of where the line breaks.

https://attachments.office.net/owa/DD200782@falmouth.ac.uk/service.svc/s/GetFileAttachment?id=AAMkADc3YWE5Y2IyLTA5ODQtNDAzMy04ZTg1LWY1MjM3N2RlNTM3ZABGAAAAAAAW3kBMzD2BQKAizsUHCaobBwDmoyYnMhKwRJMzhvl6GwdTAAAAAAEJAADmoyYnMhKwRJMzhvl6GwdTAAFioTHAAAABEgAQABt2HPETbz1GsDElO2Sx0Go%3D&X-OWA-CANARY=eRX3du3dtkmRiXQhS0GAoMAGkl6XoNYYQ2W4rwFeanJjsK61zGvL9dax74IGE3thxDmKg0eGpd8.&token=eyJhbGciOiJSUzI1NiIsImtpZCI6IjA2MDBGOUY2NzQ2MjA3MzdFNzM0MDRFMjg3QzQ1QTgxOENCN0NFQjgiLCJ4NXQiOiJCZ0Q1OW5SaUJ6Zm5OQVRpaDhSYWdZeTN6cmciLCJ0eXAiOiJKV1QifQ.eyJ2ZXIiOiJFeGNoYW5nZS5DYWxsYmFjay5WMSIsImFwcGN0eHNlbmRlciI6Ik93YURvd25sb2FkQDU1MGJlZWIzLTZhM2QtNDY0Ni1hMTExLWY4OWQwMTc3NzkyZSIsImFwcGN0eCI6IntcIm1zZXhjaHByb3RcIjpcIm93YVwiLFwicHJpbWFyeXNpZFwiOlwiUy0xLTUtMjEtNDIwODM3Mjg5Ny0xODM4Njg5ODYyLTMwNTc0MTI5NTUtNTk0MTg3OVwiLFwicHVpZFwiOlwiMTE1Mzk3NzAyNTY0MDg5OTE3OVwiLFwib2lkXCI6XCJjNmQ1OWEzYS01MDA4LTRkNWItOTM1Yy02YTU4Mzc4MDlmOTdcIixcInNjb3BlXCI6XCJPd2FEb3dubG9hZFwifSIsIm5iZiI6MTU1MTcwMDAyNCwiZXhwIjoxNTUxNzAwNjI0LCJpc3MiOiIwMDAwMDAwMi0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDBANTUwYmVlYjMtNmEzZC00NjQ2LWExMTEtZjg5ZDAxNzc3OTJlIiwiYXVkIjoiMDAwMDAwMDItMDAwMC0wZmYxLWNlMDAtMDAwMDAwMDAwMDAwL2F0dGFjaG1lbnRzLm9mZmljZS5uZXRANTUwYmVlYjMtNmEzZC00NjQ2LWExMTEtZjg5ZDAxNzc3OTJlIn0.nfHOufw4APwVrHTY3j3DWCeM1fyzB3GKlqhfM3WxlmVXHvxPwnh7BZri6RK-Gwoh9Wt-YXdLFjUzXCEDygCj1K4-zJZNEpNXIXNt-vBP42JX4tEiZ3rDksZQ0afXj2vTPpqxQ6rcPv1ZBJypE3IqyDf05YRbmSd3KrTokSDnK2Ol_H564smz3SXUlVsL7cUnYijWnu9wirJyQk3tVnInWK_CekZqTMgPaueWELu5bZIeNl0tw4r7WLWTVx59u00sqSN0LXb9b9BZoMZS9ZWRN1YKUa7m0Fx99RwNMcVGYp3TBLHGz-weuIaLCEDudrPaV0H4Uwmg9KXn76m89O0syg&owa=outlook.office.com&isImagePreview=True

I am using Unreal 4.20
Thanks in advance,
Excuse my grammar if there are any mistakes :slight_smile:

Somewhere in this video it covers a way to make inlines by tweeking the uv map.

Doing pp toon shading is nice for lighting from multiple angles. You could cel shading in each material that would give you a bit more control of the appearance.

​​​​​

Hi. Thanks for the answer. It looks like a great technique and I will dive more into it. However, the width of the line will be lost in long distance and since I want to create a scene that the player will be able to walk around it will lose consistency. I have already tried outlining through the textures and I have this particular issue. With post-processing, however, lines keep their size the same throughout the whole scene. That’s why I abandoned the texture approach.

Thanks again