ToonShading
com.zzamjak.toonshading is an OpenUPM Unity package. Cartoon shading for Unity URP, designed mobile-first. The ToonLit shader splits half-Lambert diffuse into two tones (optionally three) with a tinted shade color, stepped toon specular, view-based rim light, and screen-space sketch hatching that cross-hatches in the darkest band. A full-screen outline renderer feature runs Roberts cross edge detection over the camera depth and normals textures; depth edges are normalized by center depth so line weight stays constant with distance, normal edges catch interior creases, and a grazing-angle suppressor removes false lines on floors and walls. The outline composites by blending only, without copying scene color, so it needs no extra render target, and its thickness is converted against a reference height so line weight survives viewport resizes. Turning normal edges off avoids the URP DepthNormals prepass entirely and detects silhouettes from depth alone. Color, thickness, and sketch jitter can be overridden at runtime through a static API or a scene component with a hit-flash helper.
Install this package from the OpenUPM scoped registry with the instructions on this page, or use openupm-cli to update Packages/manifest.json.
Repository: https://github.com/zzamjak-cloud/ToonShading.
Owner: zzamjak-cloud.
Topics
Related Unity Packages
- OceanFlow com.zzamjak.oceanflow
- CATSprite com.zzamjak.catsprite
- ColorReplace com.zzamjak.colorreplace
- UIShining com.zzamjak.uishining
- UVPatternFlow com.zzamjak.uvpatternflow
- Water2D com.zzamjak.water2d
For registry setup problems, see Unity scoped registry troubleshooting.