I've moved to a new site! This wordpress blog will no longer be updated. You can find slightly updated/improved posts, and all future posts here : https://www.cyanilux.com/
Follow me on twitter to stay updated on when new posts go live, and to see cool shaders ✨
Shader Graph – Shadows for URP Unlit Graph
This was initially written as an answer to someone on the Unity Discord. Have tried updating it since v11 (2021.1) changed some things. I probably won't be updating further as I've moved to a new site. For up-to-date information, I've shared some custom lighting functions/subgraphs on github! It includes a Main Light Shadows one which …
Continue reading "Shader Graph – Shadows for URP Unlit Graph"
Passing Particle System Data into Shadergraph (Custom Vertex Streams)
Intro This post provides information on how to use the Custom Vertex Streams option on the Particle System component (also called Shuriken) to pass per-particle data into the shader. Note that it won’t go over how to use the component itself but there are plenty of tutorials online – here’s one that looks well written. In …
Continue reading "Passing Particle System Data into Shadergraph (Custom Vertex Streams)"
Post Processing in the Universal RP
The Universal Render Pipeline (URP, previously known as Lightweight RP) uses an integrated Volume system for Post Processing effects, sometimes referred to as Post Processing V3 / PPv3. These effects include things like Bloom, Chromatic Aberration, Depth of Field, Color Adjustments, Tonemapping, Vignette, etc. Note that URP does not have Ambient Occlusion yet, it's on …
Writing Shader Code for the Universal RP
Orthographic Depth
Hey! I use the depth texture/buffer (Scene Depth node) in quite a few of my shader breakdowns, but the graphs given only work with a camera with a Perspective projection, meaning objects further away from the camera are smaller on the screen, which gives a 3D effect. A camera can also have an Orthographic projection, …
World space UVs & Triplanar Mapping
This post includes an introduction to using the Position node to sample textures rather than using mesh UV channels, which is also the basis of Triplanar mapping. It won’t be super in-depth but will provide some example graphs to (hopefully) help beginners understand how this could be used! World space UVs We use UVs to …
UV-Based Nodes
This post includes an introduction to using the Sample Texture 2D node and UV-based nodes such as Tiling And Offset, Rotate, Flipbook and Polar Coordinates. Note that I'm not going over warping effects such as the Radial Shear, Spherize and Twirl nodes. This post is already quite long and I think what those effects do …
Fresnel Effect
The shadergraph documentation defines this node as : “Fresnel Effect is the effect of differing reflectance on a surface depending on viewing angle, where as you approach the grazing angle more light is reflected. The Fresnel Effect node approximates this by calculating the angle between the surface normal and the view direction.” In other words, …
Voronoi
F1 Voronoi output, raised to a power of 2. Voronoi noise, also known as Cellular noise, or Worley noise is a type of noise based on cells, where each cell contains a single point offset by a random vector. For each pixel in the cell we obtain the distance to this point, and compare it …