About this repository
This repository is NOT the full version NiloToonURP. This repository only contains a very simple and short URP toon shader example, only for tutorial purposes, it is under MIT license so you can do whatever you want with the code. If you want to keep the current tutorial shader, please fork it or download a copy now since it may be removed in the future.
NiloToonURP(full version)'s rendering
shader ON shader OFF shader ON shader OFF shader ON shader OFF shader ON shader OFF
Outline options(1/2/3)
shader ON
shader OFF
We are now developing an "easy-to-use + high-performance + cross-platform(include mobile)" Closed source toon shader package - NiloToonURP, to meet the toon shading needs of Unity URP user.
NiloToonURP is supporting:
- Unity 2021.3LTS(URP 12.x)
- Unity 2022.3LTS(URP 14.x)
Download NiloToonURP PC .exe demo (2021.3.17LTS build):
Download NiloToonURP Android .apk demo (2021.3.17LTS build):
NiloToonURP's demo runtime video:
NiloToonURP's UI preview:
How to get NiloToonURP full source code?
If you or your company/organization/team needs:
- latest full source code (with all detail comments and notes, NOT Obfuscated code, NOT .dll)
- latest user document
- perpetual royalty-free commercial license
- every future update
- (optional) we set up your character models's rendering in the best way possible for you, using NiloToonURP
- (optional) tech support
- (optional) your project-specific customization and support
of NiloToonURP for your URP project, please send the following info to [email protected]
- name (your personal name or your company/organization/team's name)
- a google account email for gaining permission to download all NiloToonURP files in google drive
- any public website that shows your/your company/organization/team's work or public media
NiloToonURP user's creations (public media, not NDA contents)
*we only provided NiloToonURP's download permission + tech support, we didn't work on these creations directly
http://genshin.hoyoverse.com)
Genshin Impact MV - When The Stars Align (Genshin Impact website ->- 【原神生日会】When The Stars Align -> https://www.bilibili.com/video/BV1vT411T79n
https://www.youtube.com/@KagaSumire)
VSPO!(ぶいすぽっ!) - 花芽すみれ (- #花芽すみれ3D うおおおおお!!【 ぶいすぽ / 花芽すみれ 】 -> https://www.youtube.com/live/g-bN6gisi3g?feature=share
https://space.bilibili.com/282994)
VirtuaReal Star - 泠鸢yousa (- 《我的故事未写完》【原创曲-泠鸢词曲】-> https://www.bilibili.com/video/BV1JG4y1W7ub?share_source=copy_web&vd_source=833e89d3d9a150b0feba26e590fd09ce
https://www.youtube.com/@Vspo77)
VSPO!(ぶいすぽっ!【公式】) (- 【3D企画】ぶいすぽ公式音楽番組「ぶいすPOP!」【#ぶいすぽ3D】-> https://www.youtube.com/live/9GaGcoDiULw?feature=share
https://space.bilibili.com/434334701)
VirtuaReal / Nijisanji CN - 七海Nana7mi (- 【恋愛偏差値上昇中!】 https://www.bilibili.com/video/BV1v84y1K74A
- 【情人节当一天恋爱脑也可以吧!】 https://www.bilibili.com/video/BV1wv4y1x7NZ
- 【这次是全身版!!】 https://www.bilibili.com/video/BV1QM411b7pe
https://hololive.hololivepro.com/en/talents?gp=english):
hololive-EN (- 【3D BIRTHDAY】PARTY TIME!
🌊 #gawrgura -> https://youtu.be/lsFr7NzVVM8?t=2042
- DO U - Takanashi Kiara (Official Music Video) -> https://youtu.be/QI96hnhcr2E
https://space.bilibili.com/11073)
VirtuaReal Star - hanser (https://www.youtube.com/@Vspo77)
VSPO!(ぶいすぽっ!【公式】) (- 【協力脱出】ぶいすぽデスゲーム【#ぶいすぽ3D】 -> https://www.youtube.com/live/nMTQyZ70TCQ?feature=share
https://www.youtube.com/@hololive)
hololive ホロライブ - VTuber Group (- 『ホロライブ・サマー2023 3DLIVE Splash Party!』ティザーPV【#hololivesummer2023】-> https://youtu.be/8aKFN2YbGLQ
https://www.youtube.com/@Vspo77)
VSPO!(ぶいすぽっ!【公式】) (- 【3D企画】ぶいすぽ公式音楽番組「ぶいすPOP!」第2弾【#ぶいすぽ3D】-> https://www.youtube.com/live/97_o-WI4ihc?feature=share
https://www.youtube.com/@MurasakiShion)
hololive - Shion Ch. 紫咲シオン (- 【holo27 MV】紫咲シオン x ラプラス・ダークネス - リップシンク【ホロライブ x DECO27】-> https://youtu.be/NjtIAuZQN_E
https://www.youtube.com/@yakumo_beni)
VSPO!(ぶいすぽっ!) - 八雲べに (- 【#八雲べに3D】ついにキタ!耐えろYouTube!【ぶいすぽ/八雲べに】 -> https://www.youtube.com/live/WZ2zvy_gxtM?feature=share
https://www.youtube.com/user/kanauru):
Kanauru (- Hoshimachi Suisei - TRUE GIRL SHOW | Kanauru PV -> https://youtu.be/FhtabnK3kso
https://www.youtube.com/@MoonaHoshinova):
Moona Hoshinova hololive-ID (- 【Original Song】Who’s Toxic ? It’s You! - Moona Hoshinova【3DMV】-> https://youtu.be/PFoGNZ05CJw
https://space.bilibili.com/484322035)
AIChannel中国绊爱 (- 小 看 我 了 吧
✨ 【BDF2023聚光】-> https://www.bilibili.com/video/BV1FL411Y7Zc
https://space.bilibili.com/282994)
VirtuaReal Star - 泠鸢yousa (- 【高清回放】泠鸢个人演唱会【时光标记】十周年纪念-高清全程回放 -> https://www.bilibili.com/video/BV1D24y1B7FA
- 【泠鸢时光标记演唱会】 一镜到底4K纯享版】-> https://space.bilibili.com/434021034/channel/collectiondetail?sid=1082531
https://www.nijisanji.jp/talents?filter=virtuareal):
Nijisanji & bilibili - VirtuaReal (- VirtuaReal 夏日合唱(2022) -> https://www.bilibili.com/festival/VRSummerSuper
https://www.youtube.com/@viichan116)
ISEGYE IDOL (이세계아이돌) - 비챤 VIichan (- Tot Musica - Cover by 비챤 | MV Teaser -> https://youtu.be/OrXUERKzILg
- [MV] Tot Musica - Cover by 비챤 -> https://youtu.be/sP0E6y0gWxA
https://space.bilibili.com/133934):
崩坏学园2-灵依娘desu (- 【崩坏学园2】「启晨之星」菲米莉丝印象曲 -> https://www.bilibili.com/video/BV1Z64y1b7BW?share_source=copy_web
- 「始まりの星」 PV制作花絮 - 角色篇 -> https://www.bilibili.com/video/BV1kU4y1c7AG?share_source=copy_web
懶貓子 & 杏仁ミル
- 【Cute Dance】一起跳了超可愛的體操!! #shorts #さくゆいたいそう -> https://youtube.com/shorts/c4bXwAXbv1o?feature=share
https://youtu.be/Zlef92wDMnA):
Rumi ch. 懶貓子 (- 【#Rumi3D】3D首次亮相
✨ 生日LIVE🍰 🎤 |Rumi/懶貓子 -> https://youtu.be/Zlef92wDMnA - 【3Ddance ver.】笑顔はここにある【#Rumi3D】 -> https://youtu.be/ugTNvBA3-So
- 【3D cover】未知未踏アルスハイル【#Rumi3D】 -> https://youtu.be/X1T4tqdlrZQ
- 【3Ddance ver.】NON STOP SOUL!!!【#Rumi3D】 -> https://youtu.be/10TDfSzRnp8
- 【#Rumi3D】Jugemu Jugemu dance! -> https://youtube.com/shorts/dU-t123n7q8?feature=share
- 【#原神】#提納里 #柯萊 登場!抽卡PK!!!ft.BOSS #19 -> https://youtu.be/R3qM8CwUED8
- 歌ってみた】トウキョウ・シャンディ・ランデヴ - MAISONdes feat. 花譜, ツミキ -> https://youtu.be/XK10jQIaA7s
https://www.youtube.com/@AnninMiru):
杏仁ミル (- 【3D Live】ニャタタリズム - 杏仁ミル【#杏仁ミル3D】-> https://youtu.be/vICHoj4d_jE
- 【3D Live】アスミルキミヘ - 杏仁ミル【#杏仁ミル3D】-> https://youtu.be/ujcUdrf7YBg
- 【3D動補試跳】I’m Your Treasure Box / マリ箱ダンス #マリ箱チャレンジ -> https://youtube.com/shorts/dvjXjd_RSRs?feature=share
https://space.bilibili.com/43272050)
穆小泠Official (- 【【国风原创曲】弹指醉|精美歌舞MMD【穆小泠】】 -> https://www.bilibili.com/video/BV1WG4y1t7o1
https://www.youtube.com/user/kanauru):
Kanauru (- Takane Lui - Overd ( オーバード ) | Kanauru Dance -> https://youtu.be/9qHbGbK8YnU
- Laplus - 濁雨 Cover | Kanauru Dance -> https://youtu.be/psrZ-l8ZWOE
- Nanashi Mumei - The Forgotten Song | Kanauru MV -> https://youtu.be/nHUqPZfaXyI
- Kureiji Ollie Boba Shop Rap MV | Avilon - Speed | Kanauru Original -> https://youtu.be/2CTSe6Q5-xI
- VSHOJO Mahou Idols - Nyanners Ironmouse Silvervale | VILLS -> https://youtu.be/-OultaM3TMg
https://store.steampowered.com/app/2079120/Warudo/)
Warudo on Steam(supporting NiloToonURP) (- 【超高可玩性!全新3D虚拟主播软件【Warudo】】-> https://www.bilibili.com/video/BV198411D7Ui/?share_source=copy_web&vd_source=833e89d3d9a150b0feba26e590fd09ce
https://www.youtube.com/@VShojoHighlights)
VShojo Highlights (- Celebrating 2 Years of VShojo -> https://youtu.be/QxvTqRzwmW4
https://www.youtube.com/user/kanauru):
Kanauru (- Kanauru MV | CapSule - Mori Calliope x Hoshimachi Suisei -> https://youtu.be/4uss_EDzT_M
- Ninomae Ina'nis - VIOLET | Kanauru MV -> https://youtu.be/vpS0Or-PHqs
- Suisei humming and playing Tetris at the train station -> https://youtu.be/qZn2qtov6Bo
https://www.youtube.com/@mya./featured)
米亞 Mya (- 【#米亞兩週年】
🎉 兩週年🌸 新房間攝影大會!補讀SC & 雜談 -> https://youtu.be/eC1djsRKSjY - 【#米亞兩週年】
🎉 跟大家一起慶祝🎈 回饋粉絲向、紀念活動發表!-> https://youtu.be/1acQeY5hsgg?t=3480 🔴 讀觀眾投稿的爛GAG…笑場即懲罰?!🎃 -> https://youtu.be/-p4KDJC9Xeg🔴 週年活動來入坑!玩玩彈射世界🐼 <有好多免費抽抽喔...我能抽到好東西嗎✨ ! -> https://youtu.be/z3pQR7wgCdc
https://www.youtube.com/@lisahanabusa)
VSPO!(ぶいすぽっ!) - 英リサ.Hanabusa Lisa (- 【#英リサ3Dお披露目】3次元、お邪魔します【ぶいすぽっ!/英リサ】 -> https://www.youtube.com/live/ey9KCNzSALQ?feature=share
https://www.youtube.com/@963Noah)
VSPO!(ぶいすぽっ!) - 胡桃のあ (- #胡桃のあ3D
✨ あざとい女は3Dになってもあざといのか❓ -> https://www.youtube.com/live/ZpAJBxTsuTE?feature=share
https://www.artstation.com/myergugu)
myer gugu(崩坏的栗子_108番) (https://space.bilibili.com/282994)
VirtuaReal Star - 泠鸢yousa (https://www.nijisanji.jp/talents?filter=virtuareal):
Nijisanji & bilibili - VirtuaReal (- https://www.bilibili.com/video/BV1G3411q7un?share_source=copy_web
- https://www.bilibili.com/video/BV1QL411b78T?share_source=copy_web
(after clicking the link below, it will require you to press enter on the link again in your browser)
- https://www.bilibili.com/video/BV1Ba411d7dc?share_source=copy_web&vd_source=833e89d3d9a150b0feba26e590fd09ce
- https://www.bilibili.com/video/BV18T411c7XM?share_source=copy_web&vd_source=833e89d3d9a150b0feba26e590fd09ce
(after clicking the link below, it will require you to press enter on the link again in your browser)
- https://www.bilibili.com/video/BV1Sg411V7HU?share_source=copy_web
- https://www.bilibili.com/video/BV1X64y1a7go?share_source=copy_web
- https://www.bilibili.com/video/BV12h411W7Sm?share_source=copy_web
- https://www.bilibili.com/video/BV1764y1Y7MD?p=2&share_source=copy_web
-
https://www.bilibili.com/video/BV1Cg411V7qm?share_source=copy_web
-
https://www.bilibili.com/video/BV1ef4y1H7h9?share_source=copy_web
-
https://www.bilibili.com/video/BV1Jh411W7RQ?share_source=copy_web
-
https://www.bilibili.com/video/BV1q3411B74t?share_source=copy_web
- https://www.bilibili.com/video/BV1ha411q7dY?share_source=copy_web
- https://www.bilibili.com/video/BV1SZ4y1677A?share_source=copy_web
- https://www.bilibili.com/video/BV1eY411g78R?share_source=copy_web (you need to enter the link to the browser again in order to play it)
https://www.youtube.com/user/kanauru):
Kanauru (- Pastel Tea Time by Omaru Polka | Kanauru Dance -> https://youtu.be/fri5IKzKDf4
- Mumei and Kronii walking in the rain -> https://youtube.com/shorts/X3kQZ85N-hE?feature=share
https://space.bilibili.com/11073)
VirtuaReal Star - hanser (- 是小天使2021年百大up主的获奖感言呀~ -> https://www.bilibili.com/video/BV1pF411v7gu
- (4K画质)hanser个人演唱会《海上油菜花》-> https://www.bilibili.com/video/BV1Bq4y1r7bn (part of the rendering is NiloToonURP)
https://space.bilibili.com/282994)
VirtuaReal Star - 泠鸢yousa (- https://www.bilibili.com/video/BV1BF41177Wa?share_source=copy_web
- https://www.bilibili.com/video/BV11Z4y1h7hA?share_source=copy_web
- https://www.bilibili.com/video/BV16v4y1N7wy?share_source=copy_web
- https://www.bilibili.com/video/BV1e44y137BL (you need to enter the link to the browser again in order to play it)
- https://www.bilibili.com/video/BV1Ng411X7e8?share_source=copy_web (you need to enter the link to the browser again in order to play it)
https://hololive.hololivepro.com/en/talents?gp=english):
hololive-EN (https://space.bilibili.com/745493 & https://space.bilibili.com/617459493):
咩栗&呜米 ((you need to enter the link to the browser again in order to play it)
- https://www.bilibili.com/video/BV1Ya411X7sZ?share_source=copy_web&vd_source=833e89d3d9a150b0feba26e590fd09ce
- https://www.bilibili.com/video/BV1pN4y1V7KU?share_source=copy_web&vd_source=833e89d3d9a150b0feba26e590fd09ce
Other NiloToonURP's images (gallery)
shader ON normal debug shader OFF
SHADER ON BEFORE AFTER: see it in motion-> https://youtu.be/D9ocVzGJfI8
see it in motion-> https://youtu.be/GcW0pNo-zus
3D enviroment model TESTsee it in motion-> https://youtu.be/7zICgzdxuGg
湊 あくあ(みなと あくあ,Minato Aqua) model TESThttps://youtu.be/X3XoYMTleJ0
see it in motion->Auto Phong tessellation
(shader on, no tessellation) (shader on, enable tessellation! Phong tessellation can make your model smooth without changing your .fbx) see it in motion-> https://youtu.be/D-MxyBa0nJE
(shader off, no tessellation)Kawaii model TEST (@ganbaru_sisters)
Upgraded to Unity2020.2 (URP 10.2.1) SHADER ON SHADER OFF HD
AFTER see it in motion-> https://youtu.be/KpRkxPnHuK0
BEFOREAFTER (more shadow from trees)
BEFOREAFTER: see it in motion-> https://youtu.be/hUWacEQH6js
BEFOREBEFORE
AFTER:
BEFORE
AFTER:
add 2D hair shadow & rim light
https://youtu.be/S67GlGAnvWA
see it in motion->https://youtu.be/M6FKoEiOAzU
see it in motion->AFTER: Sunny + StreetLight ON Sunny + StreetLight OFF Night + StreetLight ON Night + StreetLight OFF see it in motion -> https://youtu.be/jDSnJmZrKPw
BEFOREAFTER
BEFOREAFTER see it in motion -> https://youtu.be/ZfSZOHTBypc
BEFOREBEFORE AFTER see it in motion -> https://youtu.be/EgxiWPk-vaE
AFTER see it in motion -> https://youtu.be/Ty4DXLFqqDo
BEFOREAFTER see it in motion -> https://youtu.be/cebGl_MaWnI
BEFOREAFTER see it in motion ->https://youtu.be/nl5z0r8a9vk
BEFOREsee it in motion -> https://youtu.be/uVI_QOioER4
What is included in this simplified tutorial example toon-lit shader repository?
This repository only contains a very simple toon-lit URP tutorial shader example, to help people write their first custom toon-lit shader in URP.
This example shader's default result(without editing material params) = the following picture
Because this example toon lit shader aims to help people learn shader writing in URP, it is an extremely simplified version. This repository only contains ~3% of the NiloToonURP(full version)'s code, which only contains the most basic & easily understandable sections, to make sure everyone can understand the shader code easily.
It is actually a "How to write your first custom toon-lit shader in URP?" example, instead of a good-looking toon-lit shader (lots of toon-lit tricks are not included in this example shader, for tutorial reasons).
Why create this "simplified version" toon lit shader?
Lots of my shader friends are looking for a toon-lit example shader in URP (not Shader Graph), I want them to switch to URP(instead of still staying in built-in RP), so I decided to provide a simple enough URP toon-lit shader example in URP.
How to try this simplified toon-lit example shader in my URP project?
- Clone all .shader & .hlsl files into your URP project.
- Put these files inside the same folder.
- Change your character's material's shader to "SimpleURPToonLitExample(With Outline)"
- make sure at least _BaseMap(albedo) is assigned
- setup DONE, you can now test your character with light probe/directional light/point light/spot light
- edit the material properties to see how the render result changes
- Most important: open these shader files, and spend some time reading them, you will understand how to write custom lit shaders in URP very quickly
- Most important: open "SimpleURPToonLitOutlineExample_LightingEquation.hlsl", edit it, and experiment with your own toon lighting equation ideas, which is the key part of toon lit shader!
I see the shader is working now, but the outline is broken?
For this tutorial shader, you can let Unity calculate smoothed normal for you, which can produce a better outline, but doing this will make the lighting slightly incorrect.
- click your character's .fbx
- In the model tab
- edit "Normals" to Calculate
- edit "Smoothing Angle" to 180
before calculating smooth normal (print screen of the tutorial shader, not NiloToonURP)
after calculating smooth normal (print screen of the tutorial shader, not NiloToonURP)
*NiloToonURP(full version) contains a few editor C# scripts, which can help the shader to produce correct lighting and perfect outline together automatically.
What is NOT included in this simplified tutorial shader?
For simplicity reasons, most of the features from the NiloToonURP(full version) are removed, or else for beginners, this simple tutorial example shader will be way too complex for reading & learning. Some of the removed features are:
- face anime lighting (auto-fix face ugly lighting due to vertex normal without modifying .fbx, very important)
- smooth outline normal auto baking (auto-fix ugly outlines without modifying .fbx and lighting normal, very important)
- auto 2D hair shadow on the face (very important, it is very difficult to produce good-looking shadow results on the face using URP's shadow map)
- constant width rim light (similar to the method of Blue Protocol / Genshin Impact)
- tricks to render eye/eyebrow over hair (ZOffset, stencil, and renderer redraw helpers)
- PBR specular lighting (GGX)
- all kinds of MatCap features(additive/multiply/shadow/replace...)
- "HSV,tint,texture tint,texture override" shadow & outline color control
- almost all the extra texture input options like roughness, specular, normal map, detail map, parallax, occlusion, emission...
- LOTS of sliders to control lighting style, shadow color, final color, outline, rim light...
- per character "dither fade inout / rim light / color control / extra outline / dissolve / ..." control script
- volume override control of global "rim light / shadow / color control..."
- special bloom post-process volume that can control the param of character/non-character area separately. Usually to prevent character over-bloom, or make the character emitting bloom on allowed areas only
- anime postprocessing volume
- shadow control volume
- perspective removal per character, to avoid character's 3D distorted by high FOV camera
- shader stripping editor script, to keep runtime shader memory usage and build time lower
- (lots of other features)
- just too much for me to write all the removed features here, the NiloToonURP(full version) and this simple tutorial shader example are two totally different products already
How to get a test character model?
The easiest way to get a character model is by downloading Unity-Chan in the Unity AssetStore.
Also, here are some websites where you can download models(If the creator allows it)
if you downloaded a .pmx file, use MMD4Mecanim to convert it to .fbx & prefab directly inside unity http://stereoarts.jp/
if you downloaded a .vrm file, use UniVRM to convert it to prefab directly inside Unity https://github.com/vrm-c/UniVRM
Editor environment requirement
- URP 12
- Unity 2021.3
Apply our shader to another model (2020-2 early version screenshots) https://youtu.be/uVI_QOioER4
More old screenshots from the Full version shader:
different Background image TEST
Credits
model's creator in shader demo image/video:
- https://i-fox.club/pcr/
- https://sketchfab.com/3d-models/band-of-sisters-2f1c0626d4cf4fd286c4cf5d109f7a32
- miHoYo - Honkai Impact 3
- Kuro Game - Punishing: Grey Raven
- Azur Lane: Crosswave
- Sour式鏡音リン
- Unity-Chan
- https://www.bilibili.com/blackboard/activity-mrfzrlha.html
- 【オリジナル3Dモデル】Eve -イヴ- by ganbaru_sisters https://booth.pm/en/items/2557029
- https://www.mmd.hololive.tv/
- Japanese Street by Art Equilibrium https://assetstore.unity.com/packages/3d/environments/urban/japanese-street-170162
- miHoYo - Genshin Impact
- 【セール中】【オリジナル3Dモデル】ドラゴニュート・シェンナ by rokota https://rokota.booth.pm/items/2661189
- Cygames - Uma Musume
- Cygames/Arc System Works - Granblue Fantasy Versus
- 魔使マオ by 百舌谷@mozuya_
- QuQu - https://sonovr.booth.pm/
- nero -ネロ- by KM3 Doll - https://booth.pm/en/items/3167314
- Kanauru's credit list - https://youtu.be/2CTSe6Q5-xI
- YOYOGIMORI (【VRC / VRM 対応3Dモデル】imiut ver3.03) - https://yoyogi-mori.booth.pm/items/2040691
- YOYOGIMORI (【VRC / VRM 対応3Dモデル】白鳥 -Shiratori- ver3.03) - https://yoyogi-mori.booth.pm/items/2482022
- Blue Archive Shun - https://bluearchive.jp/
- アイドリープライド,IDOLY PRIDE - https://idolypride.jp/
- Little Witch Nobeta - https://store.steampowered.com/app/1049890/Little_Witch_Nobeta/
- オリジナル3Dモデル「桔梗」by ぽんでろ - https://booth.pm/en/items/3681787
- 千反田える 3Dモデル(3ds Max) by @itou_nko - https://twitter.com/itou_nko (https://itou-nko.fanbox.cc/)
- HoYoverse - Zenless Zone Zero - zenless.hoyoverse.com
- アイドリープライド,IDOLY PRIDE - https://idolypride.jp/
- Honkai: Star Rail - https://hsr.hoyoverse.com/
- Girls Frontline 2 Exilium