t1k:unity:rendering:mk-toon-shader
| Field | Value |
|---|---|
| Module | rendering |
| Version | 3.1.7 |
| Effort | high |
| Tools | — |
Keywords: cel shading, rendering, stylized, toon shader
How to invoke
Section titled “How to invoke”/t1k:unity:rendering:mk-toon-shaderMK Toon Shader
Section titled “MK Toon Shader”MK Toon v5.x by Michael Kremmel — comprehensive toon/stylized shader for Unity URP.
URP ONLY — Always use
MK/Toon/URP/shader paths. Never use Built-in RP variants. Related:unity-urp(pipeline config),dots-graphics(ECS rendering),amplify-impostors(impostor baking)
Shader Variants
Section titled “Shader Variants”| Shader Path | Use Case |
|---|---|
MK/Toon/URP/Standard/Physically Based | Full PBR + all stylize features |
MK/Toon/URP/Standard/Simple | Simpler — no anisotropic specular |
MK/Toon/URP/Standard/Unlit | No lighting, stylize only |
MK/Toon/URP/Standard/Simple + Outline | Simple + per-object outlines |
MK/Toon/URP/Standard/Physically Based + Outline | PBS + outlines |
MK/Toon/URP/Standard/Physically Based + Refraction | Glass/crystal effects |
Performance-first: use Simple (no outline) or Simple + Outline.
Per-Object Outlines Setup (URP)
Section titled “Per-Object Outlines Setup (URP)”Outline variants require MKToonPerObjectOutlines ScriptableRendererFeature:
- Select your URP Renderer Asset (
Assets/Settings/ForwardRenderer.asset) - Add Renderer Feature:
MKToonPerObjectOutlines - Set Layer Mask to include outlined layers
Menu helpers: Window/MK/Toon/Select Default URP Renderer Asset
Quick Material Setup (C#)
Section titled “Quick Material Setup (C#)”var mat = new Material(Shader.Find("MK/Toon/URP/Standard/Simple"));mat.SetColor("_AlbedoColor", Color.white);mat.SetTexture("_AlbedoMap", albedoTex);mat.EnableKeyword("_MK_ALBEDO_MAP");mat.SetInt("_Light", 1); // Cel modemat.SetFloat("_LightBands", 3);mat.SetFloat("_DiffuseSmoothness", 0.05f);mat.SetFloat("_LightThreshold", 0.5f);mat.EnableKeyword("_MK_LIGHT_CEL");// REQUIRED after setting albedo/alpha properties:MK.Toon.Properties.UpdateSystemProperties(mat);Integration Checklist
Section titled “Integration Checklist”- Run Install Wizard:
Window/MK/Toon/Install Wizard→ select Universal - Add
MKToonPerObjectOutlinestoForwardRenderer.asset(if using outlines) - Create material using
MK/Toon/URP/Standard/Simple - Set
_Light= Cel(1),_LightBands= 3,_DiffuseSmoothness= 0.05 - Copy Synty
_Albedo_Map→_AlbedoMap(rename only) - Update impostor baking code to handle
_AlbedoMap→_BaseMapmapping - Call
MK.Toon.Properties.UpdateSystemProperties(mat)after property changes
Gotchas
Section titled “Gotchas”- Outline requires RendererFeature — Outline variants do nothing without
MKToonPerObjectOutlinesadded to URP Renderer Asset _AlbedoMapNOT_BaseMap— MK Toon uses different property name from URP standard; update all migration code_AlbedoColorNOT_BaseColor— same naming difference- Keywords are
_MK_*— mustEnableKeyword("_MK_ALBEDO_MAP")etc. when setting properties programmatically UpdateSystemProperties()required — after changing_AlbedoMap/_AlphaCutoff, copies to Unity system properties for shadow/SRP compat- ECS/Entities Graphics — works with per-instance
MaterialPropertyOverridefor_AlbedoColor,_DissolveAmount, etc.
Reference Files
Section titled “Reference Files”| File | Contents |
|---|---|
references/material-property-mapping.md | Full property tables (Input, Stylize, Outline, Dissolve, Rim, Gooch, Iridescence), Synty→MK migration, workflow enums |
references/artistic-styles-guide.md | Drawn/Hatching/Sketch modes, Gooch ramp, iridescence, global shader features, dissolve animation |