Unity Shader Graph – Grid Shader by UGuruz

June 16, 2021

Shader Graph

Unity


Title:
Grid Shader in Unity LWRP – Shader Graph Tutorial

By:
UGuruz


Youtube – Tutorial #3

Description:
Experimenting with tiling and the rectangle node in Unity Shader Graph to create a Tron-like glowing grid pattern.


My Final Grid Shader Graph (w/ Color Change Addition)


Overview

Following my exploration of Unity’s shader graph, I did this tutorial by UGuruz on creating a grid shader similar to what you see in Tron. I really liked the effect so I continued it slightly further by adding a color changing effect over time, as can be seen in my examples provided.

Learnings from Tutorial

Using a Fraction node with a Tiling & Offset node is an effective way to give you standard expected tiling and offset results. I however had some strange effects because of interactions with the UVs of the models. The base UVs of just a standard Unity cube did not tile effectively for me, so I tried using Unity’s ProBuilder to make a basic cube since that also gave me easy access to modifying UVs if necessary. This gave me much more consistent results similar to those in the tutorial, since I wanted to avoid the step of modifying UVs in Blender.

They mentioned the shader would only work well on flat surfaces, but I at least wanted to test on another surface to see what the result would be and see if I could improve it. That’s why I included a sphere in the environment. It immediately gave very strange results as expected, but I found that grouping faces together through the ProBuilder tool helped give a better result, as this allows it to treat the many faces of a sphere similar to a single large face. This concept works well with a basic tiling pattern like I used here.

I did end up using World type UVs to get a decent visual result on everything, especially the sphere. While this gave something very close to what is desired, it is still a somewhat strange appearance when viewed from some angles as this inherently treats the positioning in world space as the coordinates for applying the shader. I still need to investigate the UV types and UVs in general though to get a better understanding of how to control them.



Unity Shader Graph: Tutorial by UGuruz with Color Change Addition from Steve Lilley on Vimeo.

Video Example of the Grid Shader Result with Color Change Addition

via Blogger http://stevelilleyschool.blogspot.com/2021/06/unity-shader-graph-grid-shader-by-uguruz.html