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

ความคิดเห็น • 23

  • @PatrikBergsten
    @PatrikBergsten 2 ปีที่แล้ว +1

    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!

  • @izzynab332
    @izzynab332 2 ปีที่แล้ว +2

    You are awasome keep the great work ;)

  • @yocliwood
    @yocliwood 3 หลายเดือนก่อน +1

    Thank you, I learned a lot

  • @accidentalgenius8252
    @accidentalgenius8252 2 ปีที่แล้ว +1

    Good vid dawg

  • @jtherussian
    @jtherussian 2 ปีที่แล้ว +5

    Would you ever consider making a part 2 or a video about adding additional lights in the Main Lights Calculation?

    • @danielilett
      @danielilett  2 ปีที่แล้ว +3

      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!

  • @LittleKoneko
    @LittleKoneko 2 ปีที่แล้ว

    thank you

  • @ElpredatorGYRO
    @ElpredatorGYRO ปีที่แล้ว +2

    I have a question on this : How to make it receive shadows from other objects ? It seems to me it does not.

  • @subhradipmajumder4204
    @subhradipmajumder4204 2 ปีที่แล้ว

    too osm broooo

  • @Weenmeen
    @Weenmeen 9 หลายเดือนก่อน

    Hey Daniel I'm getting an error on my custom function node. It says "MainLight_float": no matching 0 parameter function at line 174

  • @alexvenegas7081
    @alexvenegas7081 19 วันที่ผ่านมา

    What values you recomment to use in each variable to the shader look good?

  • @KenHaise
    @KenHaise 16 วันที่ผ่านมา

    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???

  • @tamerxero
    @tamerxero ปีที่แล้ว

    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 ปีที่แล้ว +9

      had to click on the "custom function"-Node and change the percision manualy to "Single"

    • @Weenmeen
      @Weenmeen 9 หลายเดือนก่อน

      @@Thegabagabor this didn't fix the issue for me