style(shader): update comments and adjust node IDs

main
uc-hoba 2 weeks ago
parent 7a277add78
commit 8e40c09546
  1. 6
      Assets/Resources/Toon.cginc
  2. 30
      Assets/Resources/Toon.shadergraph

@ -13,18 +13,18 @@ void MainLight_float(float3 WorldPos, out float3 Direction, out float3 Color, ou
Direction = mainLight.direction; Direction = mainLight.direction;
Color = mainLight.color; Color = mainLight.color;
// 直接採樣主光陰影貼圖,繞過 MAIN_LIGHT_CALCULATE_SHADOWS keyword 條件。 // Sample the main light shadowmap directly, bypassing the MAIN_LIGHT_CALCULATE_SHADOWS keyword.
ShadowSamplingData samplingData = GetMainLightShadowSamplingData(); ShadowSamplingData samplingData = GetMainLightShadowSamplingData();
half4 shadowParams = GetMainLightShadowParams(); half4 shadowParams = GetMainLightShadowParams();
real shadowStrength = shadowParams.x; real shadowStrength = shadowParams.x;
// PCF 過濾採樣 → 柔邊、消鋸齒(不依賴 _SHADOWS_SOFT keyword) // PCF-filtered sampling -> soft, anti-aliased edges (independent of the _SHADOWS_SOFT keyword)
real atten = SampleShadowmapFiltered( real atten = SampleShadowmapFiltered(
TEXTURE2D_ARGS(_MainLightShadowmapTexture, sampler_LinearClampCompare), TEXTURE2D_ARGS(_MainLightShadowmapTexture, sampler_LinearClampCompare),
shadowCoord, samplingData); shadowCoord, samplingData);
atten = LerpWhiteTo(atten, shadowStrength); atten = LerpWhiteTo(atten, shadowStrength);
// 超出陰影最遠距離 = 不打陰影 // Beyond the max shadow distance -> no shadow
ShadowAtten = BEYOND_SHADOW_FAR(shadowCoord) ? 1.0 : atten; ShadowAtten = BEYOND_SHADOW_FAR(shadowCoord) ? 1.0 : atten;
#endif #endif
} }

@ -144,15 +144,15 @@
{ {
"m_OutputSlot": { "m_OutputSlot": {
"m_Node": { "m_Node": {
"m_Id": "77f2a00de8b0456eb3b436834fc3672a" "m_Id": "762af4acd40549258fc192cd75cd1960"
}, },
"m_SlotId": 3 "m_SlotId": 2
}, },
"m_InputSlot": { "m_InputSlot": {
"m_Node": { "m_Node": {
"m_Id": "762af4acd40549258fc192cd75cd1960" "m_Id": "92c317bc8d36460799db823c560b1cad"
}, },
"m_SlotId": 1 "m_SlotId": 0
} }
}, },
{ {
@ -164,9 +164,9 @@
}, },
"m_InputSlot": { "m_InputSlot": {
"m_Node": { "m_Node": {
"m_Id": "92c317bc8d36460799db823c560b1cad" "m_Id": "762af4acd40549258fc192cd75cd1960"
}, },
"m_SlotId": 0 "m_SlotId": 1
} }
}, },
{ {
@ -231,8 +231,8 @@
}, },
"m_FragmentContext": { "m_FragmentContext": {
"m_Position": { "m_Position": {
"x": 0.0, "x": 0.00005936622619628906,
"y": 430.0 "y": 406.0000305175781
}, },
"m_Blocks": [ "m_Blocks": [
{ {
@ -976,10 +976,10 @@
"m_Expanded": true, "m_Expanded": true,
"m_Position": { "m_Position": {
"serializedVersion": "2", "serializedVersion": "2",
"x": -293.0, "x": -836.0000610351563,
"y": 357.00006103515627, "y": 615.0000610351563,
"width": 221.00009155273438, "width": 221.00006103515626,
"height": 124.99996948242188 "height": 125.0
} }
}, },
"m_Slots": [ "m_Slots": [
@ -1444,9 +1444,9 @@
"m_Expanded": true, "m_Expanded": true,
"m_Position": { "m_Position": {
"serializedVersion": "2", "serializedVersion": "2",
"x": -555.0, "x": -1098.0,
"y": 357.00006103515627, "y": 615.0000610351563,
"width": 206.00006103515626, "width": 205.99993896484376,
"height": 130.0 "height": 130.0
} }
}, },

Loading…
Cancel
Save