This article is pretty good, but the Unlit Master won't receive shadows - unless you also use the keywords :
MAIN_LIGHT_CALCULATE_SHADOWS
_MAIN_LIGHT_SHADOW_CASCADE
However, the Default value in the blackboard doesn't seem to work unless the keyword is exposed in the main graph.. (but that requires the _ON suffix which would change the keyword).
So to enable them, I'm using the Debug mode on the Material inspector to set them instead :
(Could probably also set them through a C# script using material.EnableKeyword)
(Side note, in the URP Lit shader code the "_MAIN_LIGHT_SHADOWS" keyword is used instead of MAIN_LIGHT_CALCULATE_SHADOWS. But this produces errors in shadergraph as it requires a shadowCoord to be set up in the Varyings struct, which I don't think we can do).
This seems to be the only way to receive shadows with the Unlit Master currently, without editing the generated code. Might be a little awkward, but it works (in URP 7.2.1, 2019.3.3f1 at least).
Thought I'd share this, in case anyone else finds it useful. 🙂
Correction, this isn't the only method to obtain shadows. It's also possible to use this MainLight custom function instead, which rewrites what happens in Shadows.hlsl but bypasses the problem of keywords not being defined : github.com/ciro-unity/Bot…
(not my code)
For this to work with shadow cascades line 18 should be replaced with :
half cascadeIndex = ComputeCascadeIndex(WorldPos);
float4 shadowCoord = mul(_MainLightWorldToShadow[cascadeIndex], float4(WorldPos, 1.0));
to bypass the cascades keyword in TransformWorldToShadowCoord
To add to this thread: not including the _MAIN_LIGHT_SHADOWS keyword actually strips all other keywords from the build so it must be included.
A much easier fix for the shadowCoord error is described in the tweet below. Also see: github.com/Cyanilux/URP_S…
Firstly, the effect uses UVs, where the Y axis is towards the beach, and the X axis repeats around the island. Creating this was a manual process in Blender. Geometry with UV Y=1 appears as sand, and Y=0 as deeper water without the wave pattern.
For the ocean waves (lines) I'm using a Fraction node with the UV.y input to create a repeating pattern of lines, offset by time so they scroll and noise so they are wobbly.
Note the noise should be sampled using worldspace projected UVs so it tiles correctly (& has no seams).
Saw a few others doing cloud shaders last week, so I might as well join in! Really happy with how this turned out. ☁️🌥️☁️ (See thread for #shadergraph + info) #unity3D#madewithunity#shaders
This is actually a fairly simple effect - It's a few Noise nodes with different scales & time offsets stacked onto each other, which are used to offset the Y vertex position of a plane. Also has a depth effect so it fades based on scene objects. Here's the #shadergraph
Note that there are some issues with this in the current LWRP version. In order to fix these I had to edit the code generated by the Master node - (right click the Master node and Show Generated Code. Then copy the file from the Temp folder into your Assets)