Toon Filter is a pixel filter cel shader that can be added to a scene using Editors > More Windows > Image Processing or Ctrl-F8 to open the Image Processing window, where you can add the Toon Filter Pixel Filter. Before you start, turn off Affect Diffuse and Affect Specular in your Env Light.
The Camera viewport with Toon Filter active. The camera's focal length has been changed to 30 mm to match the Perspective viewport
The same scene in the Perspective viewport
The Toon Filter window
Renders are very fast; here with Cel Shader skin and Toon Filter overlay
Top Section
The Toon Filter window is divided in four sections. The top section contains elements that are universal to Toon Filter operation.
Resolution Multiplier
To increase visual quality and because cel shading renderings are usually rapid, you can increase the resolution at which Toon Filter edges are rendered before being applied to a final image.
Apply to Final Render
Toggle to apply Toon Filter edges to the Final_Render buffer. If you are using a compositing workflow, you may wish to uncheck this and use the buffers that have your layer names in the Render Properties Panel on the buffers tab. Buffers will be named the same as you choose in the Toon Filter window.
Layer Options
Dropdown containing nine options:
Add Layer - Adds a new layer to the Toon Filter list window. You need a layer before you can add items. By default, items will take on the settings for the layer.
Add Object - Dropdown containing all scene objects. As usual, this list can be reduced by starting to type the name or using Regular Expressions as shown here. You can also use the Add Selected item just under this one. You need a layer selected before you can add an object and an item can only be added once to a layer. If you have an item selected you can add an item to it.
Add Selected - This adds all selected objects. You need to have a layer highlighted for it to work.
Add Surfaces - Instead of adding an object, as was always necessary in the past if you wanted to create rendered edges, Toon Filter lets you create layers with surfaces. When you click Add Surfaces, this window appears showing every surface in a scene.
Rename Layer(s) - Lets you rename one or more layers
Delete Item(s) - Deletes the currently-selected item or items. This can be layers, which will also delete all sub-items
Copy Settings - This item copies the selected layer or item's settings so that you can use:
Paste Settings - Pastes copied settings
Presets - Opens a dropdown with the following settings related to Presets
Load From Disk - Loads a preset directly from disk instead of using the preset shelf
Save to Disk - Saves a preset directly to disk, rather than the preset shelf
Save to Preset Shelf - Saves a preset to the Preset Shelf. These are still stored on disk, but are not so easily accessible. If you wish to share a preset, it might be easier to save it to disk
Open Preset Shelf - Opens the preset shelf for Toon Filter presets
Second Section
The second section is dominated by a listview showing your objects and surfaces; the render modes for a layer, a button for the Node Editor for this filter and lastly a field for the Shading Difference value.
Once you add a layer and objects or surfaces within a layer, you can start to customise the way your edges render. Edges can be seen in VPR and update rapidly. An item you've added can exist in multiple layers to give more flexibility over the final look.
The unitprims:ball object is in Layer(1) with a thick cyan line. It's also in Layer(2) with a thin black line. By playing with the priority we can choose which is on top.
Columns
The listview window has four columns:
Layers
Tick
Eye
Color
The name of the layer or item
The tick or check only applies to the whole layer and activates Toon Filter
The eye icon denotes independence. If this is unchecked, items will use the values set on the Layer line
Shows the color chosen in Base > Color
Render Mode
Dropdown with three choices
Solid - The default choice
Reflective - This edge will reflect
Transparent - This will make the object somewhat transparent, showing the edges, but allowing scene items behind to show through. Particularly interesting for items like eyebrows or frames for glasses you want showing through hair.
In this example, we have two layers and two objects. Notice the Buddha isn't even in Toon Filter; it's just using the cel shader in the Surface Editor, but there's a box that intersects the Buddha. It's set to Transparent, and we can see "laser" lines crossing the Buddha's belly.
Buddha is in Toon Filter this time as the red outline shows. Note how the sphere has a blue outline, but in the reflection the outline is green. This is because it's on a separate layer and has its own settings. Note that the New Sphere Object is inside the New Cube Object inside Layer (2). This means that the sphere's edge can be green, yellow or even dark blue depending on how its independence is set.
Node Editor
You can have independent node editor control of each layer or item. The destination node has four inputs to control Scale, Color, Alpha and Shading. The Surface Evaluator node allows you to select specific elements from surfaces to apply to your edge.
Third Section
There are three tabs in the third section.
The main controls for your edges are here
Size Mode
Two choices, Absolute and Relative. In the Size field that follows you will either enter a measurement in pixels or a thickness based on the size of the object.
Priority
How far up in the stack of edges for this layer this specific edge is. The default of 0 is effectively the bottom of the stack and if all elements of a layer are 0, ordering depends on the order of the elements in the layer.
Color
A click on the swatch opens the color picker, you can also change colors following this guide.
Alpha
Reducing this value will reduce the opacity of the edge affected. If you set the Alpha to over 100 %, you will increase the brightness of the edge.
The Depth Scaling tab is how you can control the overall thickness of your edge depending on distance between edges.
Depth Scaling
Toggle to apply the scaling measures.
Scale Distance
The nominal distance for the base Size measurement
Scale Start
How thick the line is at its thinnest. This is expressed as a percentage of the base Size measurement.
Scale End
How thick the line is at its thickest. This is expressed as a percentage of the base Size measurement.
This toggle makes no difference to how your edges are rendered if the Render Mode above is set to Solid. If your item is set to Reflective or Transparent, it changes the way the surface below that which is reflective or transparent is seen.
Exclusive
Off - Means a mix of the surfaces between foreground and background edges
Overwrite - The foreground edge properties override the background edge properties
Copy - Copies settings from a parent item in the same layer.
Set to infinite by default, this determines how many intersections the ray traverses.
Start Distance
A z-depth offset for the start of the ray is possible.
Distance
The maximum distance for the ray to travel - starting at the first intersection, not from the camera
They can be used for creating strange effects like this with just one model.
Fourth Section
Now we have seven options tabs. Remember, these settings could apply to whole layers or individual items.
Use Depth
A toggle for setting a depth to ray trace through any polygons behind. Think of it like an absorption scale. Defaults to Off.
Distance
The default is 100 mm
Scale
Individually scales edges based on depth. You can make edges thinner with this, but not thicker.
Mode
Uses the normals for an item to control whether there'll be an edge per polygon or not. With Use Normals off, edges will only be drawn for the boundaries of a surface or object. Defaults to Scaled.
Angle
The minimum difference between normals to show an edge. Edges on the same planes won't show with this, but you can make the edge angle small to capture more edges.
Scale
Individually scales edges based on normals. You can make edges thinner with this, but not thicker.
Use Outline
Defaults to on and is roughly equivalent to the old Silhouette Edges setting in Object Properties. The Outline created will only outline the parts of the object with nothing behind. Once an object intersects something else, even just in perspective, the outline will cease.
Scale
Scales outline edges. You can make edges thinner or thicker with this.
Mode
This option bases edges on Item ID. This will result in an edge around an item, even if Use Normals and Use Depth are unchecked. When items intersect, an edge will be drawn at the intersection.
Scale
The maximum scale is 100 %
Mode
Show edges based on the ID for their materials.
Scale
Change the edge size of material edges
Mode
Show edges based on the primitive. A single polygon counts as a primitive, but so do Procedural Geometry and Null object shapes.
Scale
If you set the Mode to Scaled, values here will change the thickness of the edge
Mode
Three choices, Off, On and Scaled. On uses the size set in the Base > Size field and Scaled allows you to play with that thickness using the Scale field below.
Shading Difference
The default value is 0.1. The amount of difference in color between pixels to create an edge, when a node is connected to "Shading" input. This is a little difficult to understand on the face of it, but an example shows it clearly.
Scale
A field allowing you to play with the scale of the edges.
Presets
Toon Filter supports LightWave's preset system and Layers (groups) or individual items can be added.
Examples
Example - Shading Difference
Add NodeFilter to your scene with an object. A cube will be enough to show what this does.
Click the Node Editor button in the Toon Filter window and make sure you have your cube object selected. Add a Flakes 3D texture.
Hook the colour output from the Flakes node into the Shading input and you should see lines on your cube coming from the Flakes texture.
You can change the Shading Difference value up and down to see more or less of the flakes, but you can equally change the values in the Flakes texture, or whatever else you've used. This gives you added detail without needing to add more geometry.
Example - Ray Tracing Overwrite and Copy
To start, we have several layers and items set up and we are concentrating on the ball and toroid for this example. Layer (1) has green edges, which will be used by any item that doesn't have the independence icon checked (the eyeball icon). The ball has black edges at 1.5 instead of the default 1. There's a second instance of the toroid parented to the ball and it has edges set to rusty red. Our first image shows our scene with a Solid, Solid Off setup, a fairly standard approach.
Where things get interesting in this scene is if we use the Transparent render mode for the Ball with Solid checked and Exclusive Off. We can see the red edges from the toroid item through the ball. The toroid outside the ball is still being overwritten by the parent layer because it doesn't have independent checked. Through the ball, we are seeing the second instance of the toroid, the one that is independent and red.
If we change the mode to Overwrite, we see the same red, but this time it looks strange. What you're seeing is the other side of the toroid. Its status as a solid object is overwritten by the ball, a transparent object.
If we switch the Render mode to Copy, the toroid takes on the properties of the ball - 1.5 black edges.
If we now go through the same modes, but with the Solid toggle off. We are still in the Transparent Render Mode and we can see there are no longer edges on the ball and we can see the red edges of the toroid through the ball.
Switching to Overwrite mode, we can see the toroid has become transparent and because it is in the Solid render mode, we can see edges on the far side of the toroid.
Our last mode, Copy, shows how the toroid has taken the thickness and colour of the ball's edges.
Example - Depth Scaling
We've exaggerated the Scale Start and End setting here to make things more obvious. Even with Scale Start at 0 %, a faint edge still shows. The GIF below steps down a magnitude each time to show the effect and the edges at the equator of the sphere are about 130 mm apart. You'll note that the edges at the left side of the sphere start getting thicker first as we step down in scaling. When we hit 1 mm, all of the polygons are at the Scale End size.