- Home /
Outlining simple objects without artifacts
Hello all,
I am trying to make a 3D Cartoon styled game wherein all of the objects, character, etc are very straight edged(not a lot of round edges). I am trying to create a shader that will merely outline the objects (Much in the way unity gives you an orange outline on the selected object in the scene view). I have already tried two separate methods to achieve this, but both have failed and I am out of Ideas. The methods I have tried are as follows:
1 drawing the outline from the object vertices by translating the vertices along their normals. this however resulted in loads of artifacts on the simple square shapes in my scene and looked awful
2 Drawing the outline by scaling up the object and coloring it black This however did not work as many of my objects do not have their pivot in the center and thus the outline is off center
I am not very familiar with how to code shaders so any help would be appriciated.
This is the unity orange outline shader:
I took the two files(shader and cginc) and compiled them in my game, but all it seems to do is invert the normals on the object...
Your answer
Follow this Question
Related Questions
How to do an outline shader?,How to do an outline? 0 Answers
3D Outline [ShaderGraph URP] 2 Answers
Outline shader not working 0 Answers
Need help with outline shader 0 Answers