Firstly I know very little about shaders, I am looking to learn but I need to find a quick solution to my problem.
I’m working on a project where I want to make it really obvious what objects can and can’t be interacted with. The toon outline shader seemed like the obvious option, but when applied I get this effect…
The gaps on the corner and above and below aren’t acceptable. I need the outline to be quite thick like this dodgy photoshop…
Does anyone know of such a shader? I only want this to work on certain objects, not the whole scene.
No joy I’m afraid. The original “door” was a cube created inside Unity, so I created a “door” in Max and imported by FBX so I could change the smoothing angle, but it did nothing to a cube.
I agree with Daniel. The normals need to be perfectly smooth for the toon shader to give good results. Try setting the smoothing angle to 1 or 0 (and enable “Calculate Normals”).
i also discovered another problem with the toon shader and that is that the outlines always ramain the same thickness.
I think the best way to solve this is to write a post proccessing effect for the outline but I first have to figure out how to do that.
See the problem here:
Normally, you need to set up your iOS project to use ‘OpenGL ES 2.0’ instead of OpenGL ES 1.x or earlier versions. This is because only 2.0 properly supports shaders.
Unfortunately, due to not knowing overly much about Unity, I can’t really help you with how to do it, but I hope it helps either way.
I know this is an old thread, but you can do this in your modelling package without having to delve in to shaders.
simply duplicate your mesh, apply a black material to it, use whatever function your modelling package has to push the mesh outwards based on normal angle, and reverse the normals.
Now when you bring it in to unity, you’ll have a perfect outline that’s whatever size you wanted it to be when you were in maya/max/blender/whatever