Uploaded July 2024 | Updated November 2026, 5 days ago
Unity only provides a Main Light Direction node for custom lighting. If we want more fine-tuned control and support for color and additional lights, we'll need to delve into the world of โจcustom HLSL codeโจ. With Shader Graph's Custom Function node, we unlock plenty of new opportunities!
I'm using Unity 2022.3.0f1, although these steps should look similar in previous and subsequent Unity versions.
------------------------------------------------------------------------
๐ Download the project on GitHub: github.com/daniel-ilett/shader-graph-basics-2022-3
๐ฐ Read this tutorial in article format instead: danielilett.com/2024-07-09-tut7-14-intro-to-shader-graph-part-10
๐ก My CustomLighting.hlsl: github.com/daniel-ilett/shader-graph-basics-2022-3/blob/main/Assets/Shaders/CustomLighting.hlsl
๐ฆ Alex Lindman's CustomLighting.hlsl: github.com/Unity-Technologies/ShaderGraph-Custom-Lighting/blob/master/Assets/Includes/CustomLighting.hlsl
------------------------------------------------------------------------
โจ Grab Snapshot Shaders Pro or Hologram Shaders Pro here (affiliate): assetstore.unity.com/publishers/42768?aid=1101lfDLn
๐ Get a copy of my shader book here (affiliate): dpbolvw.net/click-100742141-12898971?url=https%3A%2F%2Flink.springer.com%2Fbook%2F10.1007%2F978-1-4842-8652-4
------------------------------------------------------------------------
๐ฌ Join the Discord: discord.gg/tPQEUwPpb3
๐ Support me on Patreon: patreon.com/danielilett?fan_landing=true
โ Or throw me a one-off coffee on Ko-fi: ko-fi.com/danielilett
------------------------------------------------------------------------
Unity only provides a Main Light Direction node for custom lighting. If we want more fine-tuned control and support for color and additional lights, we'll need to delve into the world of โจcustom HLSL codeโจ. With Shader Graph's Custom Function node, we unlock plenty of new opportunities!
I'm using Unity 2022.3.0f1, although these steps should look similar in previous and subsequent Unity versions.
------------------------------------------------------------------------
๐ Download the project on GitHub: github.com/daniel-ilett/shader-graph-basics-2022-3
๐ฐ Read this tutorial in article format instead: danielilett.com/2024-07-09-tut7-14-intro-to-shader-graph-part-10
๐ก My CustomLighting.hlsl: github.com/daniel-ilett/shader-graph-basics-2022-3/blob/main/Assets/Shaders/CustomLighting.hlsl
๐ฆ Alex Lindman's CustomLighting.hlsl: github.com/Unity-Technologies/ShaderGraph-Custom-Lighting/blob/master/Assets/Includes/CustomLighting.hlsl
------------------------------------------------------------------------
โจ Grab Snapshot Shaders Pro or Hologram Shaders Pro here (affiliate): assetstore.unity.com/publishers/42768?aid=1101lfDLn
๐ Get a copy of my shader book here (affiliate): dpbolvw.net/click-100742141-12898971?url=https%3A%2F%2Flink.springer.com%2Fbook%2F10.1007%2F978-1-4842-8652-4
------------------------------------------------------------------------
๐ฌ Join the Discord: discord.gg/tPQEUwPpb3
๐ Support me on Patreon: patreon.com/danielilett?fan_landing=true
โ Or throw me a one-off coffee on Ko-fi: ko-fi.com/danielilett
------------------------------------------------------------------------








![[SerializeField] and [field:SerializeField] | Bytesize Gamedev
Bytesize Gamedev is a series of shorter tutorials, delivered in around 60 seconds.
In this short video, see how you can expose private fields/variables and properties (public or private) to the Inspector!
๐ฑ I wrote about this on Twitter: https://twitter.com/daniel_ilett/status/1362823465636626433
Unity 2020.2.1f1
โจ Grab Snapshot Shaders Pro here: https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/snapshot-shaders-pro-for-urp-hdrp-160556?aid=1101lfDLn
๐ฌ Join the Discord: https://discord.gg/tPQEUwPpb3
๐ Support me on Patreon: https://www.patreon.com/danielilett?fan_landing=true
โ Or throw me a one-off coffee on Ko-fi: https://ko-fi.com/danielilett
#bytesizegamedev #unity #tutorials [SerializeField] and [field:SerializeField] | Bytesize Gamedev](https://i.ytimg.com/vi/Kn_zSTtIQUE/mqdefault.jpg)

