I have been looking through the shader documentation as well as the code in the built in shaders.
It is definitely something I am going to have to spend some time on. In the mean time for my immediate need I would like to know if anyone has ever tried to get the outline feature of the Toony/Basic Outlined shader and have the actual face have a simple diffuse texture instead of the solid bright toon surface.
Below is the screenshot I managed to make. It is the exact effect I want.
I was only able to get this to display by applying the Toony/Basic Outline and then in script changing the shader to Diffuse on a mouse click.
:shock:
I can’t believe I know the answer to this one. I wanted this too, and made a modified Toon shader to do it. Simple, really. Just swap out the toon shader UsePass call with one to the diffuse shader, tidy up the code, and you’re done!
Is there a possibility to write a shader which can nicely display ALL edges ?
At this moment if you look at the outer edges, then they are outlined in black, but the lines between the red/yellow , then yellow/blue and red/blue don’t have an outline.
Is this possible so they all have an outline ?
Second question, is there maybe a way to make sure that you can setup in your model (static in the model) which edges should get an outline and which not?
@EducaSoft
I’d just do textures that include a dark line where you want it. It won’t be perfect because the lines are going to taper due to perspective, but I think the only other way would be some sort of two pass thing where you draw the model and then have a second model rendered with ALL of its lines rendering (otherwise I’m not sure how you’d choose which lines are the important ones.) I only have limited knowledge of shaders, though. I could be wrong.
@ EducaSoft
The shader I posted can’t work on all the edges, since all the default toon shader it does is move the faces out along their normals (with some scaling correction), color them, then draw the normal object on top of it. This becomes visible when one turns the distance waaaaaayyyy up on a non-sphere. (Try the cube!)
To get all the lines, um, “lined” one either has to write a shader to (somehow) stroke the geometry, “stroke” the mesh with a line renderer, (but that could produce a fair amount of geometry in addition to another object), or bake it into the texture (as Aaron suggested). When going with the last one, just don’t hide the UV map texture (which I’m sure you exported from your 3d program of choice) and you’re 9/10 there.
@Aaron
Thanks! He’s Hunter the Cheetah from Spyro. That particular image I found on Wikia and touched up somewhat.
In the Shader Replacement Project there is an Edge Detection image effect which looks at the differences in normals and depth for neighbouring pixels and where the difference is big - colours the pixels black. E.g. look at the rocks here: PuzzleBloom.
This is some great stuff, I was thinking of modifying this for a sort of holographic/Tron-esque look.
EDIT: I’ve used this for a Tron-esque look. I use a single directional light, I just dropped its strength to 0.162 (1/10 of Phi, my favorite number to use), and played with the edge settings. My way of covering up the awful programmer art I made.
This thread was a life-saver for me. As a result of Omega’s script, I created a little hybrid shader that allow for highlighted object picking as in eg. Dungeon Siege – see separate thread with the new shader source.
Thank you for sharing! Great community we’ve got here. 8)
Judging by what other people have done you need some sort of cubemap to get the lighting to appear to show the light and dark sides on a character. I’m a bit lost since I’m an artist and know nothing of shaders Any help is appreciated thanks guys
How hard is it to add a bump map to this? I am looking for an outlined Bumped Specular and Bumped Diffuse Shader. I have looked into using different passes but couldn’t figure out how to do it myself. :?
Is it possible to access material’s Outline Color by script? I could change the material’s color by renderer.material.color, but could not find a way to manipulate the outline color.