Halftone Effect in Unity Shader Graph and URP
ฝัง
- เผยแพร่เมื่อ 23 ก.ค. 2024
- 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/shade...
📰 Read this tutorial in article format instead: danielilett.com/2022-07-28-tu...
🎮 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-10074214...
🎨 Triceratops model by Zacxophone: sketchfab.com/3d-models/anima...
✨ Grab Snapshot Shaders Pro here: assetstore.unity.com/packages...
------------
💬 Join the Discord: / discord
💖 Support me on Patreon: www.patreon.com/danielilett?f...
☕ 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
Brilliant with the voronoi node for the dots. Thanks for this!
I've been trying to think outside the box with nodes a bit more, was really happy when I figured that one out!
You are awasome keep the great work ;)
Thank you, I learned a lot
Good vid dawg
Would you ever consider making a part 2 or a video about adding additional lights in the Main Lights Calculation?
I've handled additional lights before in my cel shading video, you might be able to tweak it for other effects: th-cam.com/video/lUmRJRrZfGc/w-d-xo.html
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!
thank you
I have a question on this : How to make it receive shadows from other objects ? It seems to me it does not.
too osm broooo
Hey Daniel I'm getting an error on my custom function node. It says "MainLight_float": no matching 0 parameter function at line 174
What values you recomment to use in each variable to the shader look good?
how can you make it like this but instead of small circles, its lines, like spider-verse movie shader?
i made something like this using the official unity spiderverse shader preview but this is so much easier and looks a lot nicer
Is there any way I can get the shader?
@@Garfuneral_ from me???
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?
I also have this issue, did you ever find a fix for it?
After some experimenting I fixed this by changing the file into a string type then copy pasting the function in
same problem with version 2022.3.0
"undeclared identifier 'MainLight_half' at line 179"
had to click on the "custom function"-Node and change the percision manualy to "Single"
@@Thegabagabor this didn't fix the issue for me