Halftone Effect in Unity Shader Graph and URP

  Рет қаралды 18,546

Daniel Ilett

2 жыл бұрын

Halftone is a technique used for printing where tiny dots of different colors and sizes are layered to look like a full-colour image. In this video, I use Shader Graph to implement a similar technique, where the shaded regions of the image are converted into differently-sized darkened dots.
------------
👇 Download the project on GitHub: github.com/daniel-ilett/shaders-halftone
📰 Read this tutorial in article format instead: danielilett.com/2022-07-28-tut6-1-halftone/
🎮 This project uses Unity 2021.3.0f1 (LTS) and URP 12.1.6, but it should work with other versions.
------------
📚 Get a copy of my shader book here: www.dpbolvw.net/click-100742141-12898971?url=https%3A%2F%2Flink.springer.com%2Fbook%2F10.1007%2F978-1-4842-8652-4
🎨 Triceratops model by Zacxophone: sketchfab.com/3d-models/animated-triceratops-skeleton-06cb55f941d94dc8b95ac46f92d89e7c
✨ Grab Snapshot Shaders Pro here: assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/snapshot-shaders-pro-for-urp-hdrp-160556?aid=1101lfDLn
------------
💬 Join the Discord: discord.gg/tPQEUwPpb3
💖 Support me on Patreon: www.patreon.com/danielilett?fan_landing=true
☕ Or throw me a one-off coffee on Ko-fi: ko-fi.com/danielilett
------------
00:00 Introduction
00:32 How It Works
01:12 Lighting.hlsl Code
02:12 GetMainLight Subgraph
03:23 Halftone Properties
05:50 Halftone Behavior
10:28 Usage Examples
#gamedev #shaders #madewithunity

Пікірлер: 23
@PatrikBergsten
@PatrikBergsten 2 жыл бұрын
Brilliant with the voronoi node for the dots. Thanks for this!
@danielilett
@danielilett 2 жыл бұрын
I've been trying to think outside the box with nodes a bit more, was really happy when I figured that one out!
@jtherussian
@jtherussian 2 жыл бұрын
Would you ever consider making a part 2 or a video about adding additional lights in the Main Lights Calculation?
@danielilett
@danielilett 2 жыл бұрын
I've handled additional lights before in my cel shading video, you might be able to tweak it for other effects: kzbin.info/www/bejne/oobQg32Ip7-ZfcU Usually I just include the main light in most effects because it's far easier to explain in the video. But yeah I think it would be a good idea to spin it into a separate video sometime!
@izzynab332
@izzynab332 2 жыл бұрын
You are awasome keep the great work ;)
@yocliwood
@yocliwood 6 ай бұрын
Thank you, I learned a lot
@ElpredatorGYRO
@ElpredatorGYRO Жыл бұрын
I have a question on this : How to make it receive shadows from other objects ? It seems to me it does not.
@alexvenegas7081
@alexvenegas7081 3 ай бұрын
What values you recomment to use in each variable to the shader look good?
@accidentalgenius8252
@accidentalgenius8252 2 жыл бұрын
Good vid dawg
@Weenmeen
@Weenmeen Жыл бұрын
Hey Daniel I'm getting an error on my custom function node. It says "MainLight_float": no matching 0 parameter function at line 174
@KenHaise
@KenHaise 3 ай бұрын
how can you make it like this but instead of small circles, its lines, like spider-verse movie shader?
@LittleKoneko
@LittleKoneko 2 жыл бұрын
i made something like this using the official unity spiderverse shader preview but this is so much easier and looks a lot nicer
@Garfuneral_
@Garfuneral_ Жыл бұрын
Is there any way I can get the shader?
@LittleKoneko
@LittleKoneko Жыл бұрын
@@Garfuneral_ from me???
@LittleKoneko
@LittleKoneko 2 жыл бұрын
thank you
@tamerxero
@tamerxero 2 жыл бұрын
I tried to follow the project but the script, when put into the custom function node, threw errors saying there was an undeclared variable 'MainLight_Half.' Downloaded the version off Git to see if that worked, and my materials are still pink. Using 2021.1.11 (LTS), any tips you can provide?
@SlimeWithClass
@SlimeWithClass Жыл бұрын
I also have this issue, did you ever find a fix for it?
@SlimeWithClass
@SlimeWithClass Жыл бұрын
After some experimenting I fixed this by changing the file into a string type then copy pasting the function in
@Thegabagabor
@Thegabagabor Жыл бұрын
same problem with version 2022.3.0 "undeclared identifier 'MainLight_half' at line 179"
@Thegabagabor
@Thegabagabor Жыл бұрын
had to click on the "custom function"-Node and change the percision manualy to "Single"
@Weenmeen
@Weenmeen Жыл бұрын
@@Thegabagabor this didn't fix the issue for me
@subhradipmajumder4204
@subhradipmajumder4204 2 жыл бұрын
too osm broooo
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 32 МЛН
How it feels when u walk through first class
00:52
Adam W
Рет қаралды 21 МЛН
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 55 МЛН
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 32 МЛН