ColinLeung-NiloCat / UnityURPToonLitShaderExample

A very simple toon lit shader example, for you to learn writing custom lit shader in Unity URP

Home Page:https://www.youtube.com/channel/UCsvlGOZyqjd68ZUUmgqwj0g

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how do you change the outline so it doesn't change with object scale?

laurentopia opened this issue · comments

I tried this but that doesn't work

return 10*normalize(input.positionOS + outlineNormalOSUnitVector) * _OutlineWidth; //you can replace it to your own method! Here we will use the most simple method for tutorial reason, it is not the best method!

first you convert positonOS to positionWS
and convert normalOS to normalWS,
then use positionWS + normalize(normalWS) * _OutlineWidth

I have updated the shader to use world space outline width