Water Surface Depth.shadersubgraph 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. {
  2. "m_SGVersion": 3,
  3. "m_Type": "UnityEditor.ShaderGraph.GraphData",
  4. "m_ObjectId": "57690dd0a7044f7db9b1be37ca7e775d",
  5. "m_Properties": [
  6. {
  7. "m_Id": "200f509d2717478aafb21bf54a385efe"
  8. }
  9. ],
  10. "m_Keywords": [],
  11. "m_Dropdowns": [],
  12. "m_CategoryData": [
  13. {
  14. "m_Id": "1e7e0d3d682d45a7a0ec9de71fda43ed"
  15. }
  16. ],
  17. "m_Nodes": [
  18. {
  19. "m_Id": "56d03c1d5a3c4eeda95194690450ca92"
  20. },
  21. {
  22. "m_Id": "9d08d3bb7e77482f85e9e256a6794e1b"
  23. },
  24. {
  25. "m_Id": "acb0268c2b414e38970678a4b85e9910"
  26. },
  27. {
  28. "m_Id": "fc2165714e974278a2d27395c1eb6187"
  29. },
  30. {
  31. "m_Id": "4052b4219eee4e098e150ecf2fe73b14"
  32. }
  33. ],
  34. "m_GroupDatas": [
  35. {
  36. "m_Id": "14b75083cee14a7bab583b8e1e8e7c0d"
  37. }
  38. ],
  39. "m_StickyNoteDatas": [],
  40. "m_Edges": [
  41. {
  42. "m_OutputSlot": {
  43. "m_Node": {
  44. "m_Id": "4052b4219eee4e098e150ecf2fe73b14"
  45. },
  46. "m_SlotId": 0
  47. },
  48. "m_InputSlot": {
  49. "m_Node": {
  50. "m_Id": "acb0268c2b414e38970678a4b85e9910"
  51. },
  52. "m_SlotId": 2
  53. }
  54. },
  55. {
  56. "m_OutputSlot": {
  57. "m_Node": {
  58. "m_Id": "9d08d3bb7e77482f85e9e256a6794e1b"
  59. },
  60. "m_SlotId": 0
  61. },
  62. "m_InputSlot": {
  63. "m_Node": {
  64. "m_Id": "acb0268c2b414e38970678a4b85e9910"
  65. },
  66. "m_SlotId": 1
  67. }
  68. },
  69. {
  70. "m_OutputSlot": {
  71. "m_Node": {
  72. "m_Id": "acb0268c2b414e38970678a4b85e9910"
  73. },
  74. "m_SlotId": 3
  75. },
  76. "m_InputSlot": {
  77. "m_Node": {
  78. "m_Id": "56d03c1d5a3c4eeda95194690450ca92"
  79. },
  80. "m_SlotId": 1
  81. }
  82. },
  83. {
  84. "m_OutputSlot": {
  85. "m_Node": {
  86. "m_Id": "fc2165714e974278a2d27395c1eb6187"
  87. },
  88. "m_SlotId": 1
  89. },
  90. "m_InputSlot": {
  91. "m_Node": {
  92. "m_Id": "acb0268c2b414e38970678a4b85e9910"
  93. },
  94. "m_SlotId": 0
  95. }
  96. }
  97. ],
  98. "m_VertexContext": {
  99. "m_Position": {
  100. "x": 0.0,
  101. "y": 0.0
  102. },
  103. "m_Blocks": []
  104. },
  105. "m_FragmentContext": {
  106. "m_Position": {
  107. "x": 0.0,
  108. "y": 0.0
  109. },
  110. "m_Blocks": []
  111. },
  112. "m_PreviewData": {
  113. "serializedMesh": {
  114. "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
  115. "m_Guid": ""
  116. },
  117. "preventRotation": false
  118. },
  119. "m_Path": "Water",
  120. "m_GraphPrecision": 1,
  121. "m_PreviewMode": 2,
  122. "m_OutputNode": {
  123. "m_Id": "56d03c1d5a3c4eeda95194690450ca92"
  124. },
  125. "m_SubDatas": [],
  126. "m_ActiveTargets": []
  127. }
  128. {
  129. "m_SGVersion": 0,
  130. "m_Type": "UnityEditor.ShaderGraph.GroupData",
  131. "m_ObjectId": "14b75083cee14a7bab583b8e1e8e7c0d",
  132. "m_Title": "Percieved depth (underwater fog)",
  133. "m_Position": {
  134. "x": -304.0,
  135. "y": -30.0
  136. }
  137. }
  138. {
  139. "m_SGVersion": 0,
  140. "m_Type": "UnityEditor.ShaderGraph.CategoryData",
  141. "m_ObjectId": "1e7e0d3d682d45a7a0ec9de71fda43ed",
  142. "m_Name": "",
  143. "m_ChildObjectList": [
  144. {
  145. "m_Id": "200f509d2717478aafb21bf54a385efe"
  146. }
  147. ]
  148. }
  149. {
  150. "m_SGVersion": 1,
  151. "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
  152. "m_ObjectId": "200f509d2717478aafb21bf54a385efe",
  153. "m_Guid": {
  154. "m_GuidSerialized": "9eee8145-7387-4aa2-b151-9547c20b60d1"
  155. },
  156. "m_Name": "Fog Density",
  157. "m_DefaultRefNameVersion": 1,
  158. "m_RefNameGeneratedByDisplayName": "Fog Density",
  159. "m_DefaultReferenceName": "_Fog_Density",
  160. "m_OverrideReferenceName": "",
  161. "m_GeneratePropertyBlock": true,
  162. "m_UseCustomSlotLabel": false,
  163. "m_CustomSlotLabel": "",
  164. "m_DismissedVersion": 0,
  165. "m_Precision": 0,
  166. "overrideHLSLDeclaration": false,
  167. "hlslDeclarationOverride": 0,
  168. "m_Hidden": false,
  169. "m_Value": 6.0,
  170. "m_FloatType": 0,
  171. "m_RangeValues": {
  172. "x": 0.0,
  173. "y": 1.0
  174. }
  175. }
  176. {
  177. "m_SGVersion": 0,
  178. "m_Type": "UnityEditor.ShaderGraph.PropertyNode",
  179. "m_ObjectId": "4052b4219eee4e098e150ecf2fe73b14",
  180. "m_Group": {
  181. "m_Id": "14b75083cee14a7bab583b8e1e8e7c0d"
  182. },
  183. "m_Name": "Property",
  184. "m_DrawState": {
  185. "m_Expanded": true,
  186. "m_Position": {
  187. "serializedVersion": "2",
  188. "x": -266.0,
  189. "y": 288.0,
  190. "width": 138.0,
  191. "height": 34.0
  192. }
  193. },
  194. "m_Slots": [
  195. {
  196. "m_Id": "ebfce0ea751d44f8835e9b30dc1c8b2b"
  197. }
  198. ],
  199. "synonyms": [],
  200. "m_Precision": 0,
  201. "m_PreviewExpanded": true,
  202. "m_DismissedVersion": 0,
  203. "m_PreviewMode": 0,
  204. "m_CustomColors": {
  205. "m_SerializableColors": []
  206. },
  207. "m_Property": {
  208. "m_Id": "200f509d2717478aafb21bf54a385efe"
  209. }
  210. }
  211. {
  212. "m_SGVersion": 0,
  213. "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
  214. "m_ObjectId": "4563ae525d1041a1a544494802624c15",
  215. "m_Id": 0,
  216. "m_DisplayName": "Out",
  217. "m_SlotType": 1,
  218. "m_Hidden": false,
  219. "m_ShaderOutputName": "Out",
  220. "m_StageCapability": 3,
  221. "m_Value": {
  222. "x": 0.0,
  223. "y": 0.0,
  224. "z": 0.0,
  225. "w": 0.0
  226. },
  227. "m_DefaultValue": {
  228. "x": 0.0,
  229. "y": 0.0,
  230. "z": 0.0,
  231. "w": 0.0
  232. },
  233. "m_Labels": []
  234. }
  235. {
  236. "m_SGVersion": 0,
  237. "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
  238. "m_ObjectId": "4ceff05fc3494e178d74e4f66112da10",
  239. "m_Id": 1,
  240. "m_DisplayName": "Fog_Attentuation",
  241. "m_SlotType": 0,
  242. "m_Hidden": false,
  243. "m_ShaderOutputName": "Fog_Attentuation",
  244. "m_StageCapability": 2,
  245. "m_Value": 0.0,
  246. "m_DefaultValue": 0.0,
  247. "m_Labels": []
  248. }
  249. {
  250. "m_SGVersion": 0,
  251. "m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode",
  252. "m_ObjectId": "56d03c1d5a3c4eeda95194690450ca92",
  253. "m_Group": {
  254. "m_Id": ""
  255. },
  256. "m_Name": "Output",
  257. "m_DrawState": {
  258. "m_Expanded": true,
  259. "m_Position": {
  260. "serializedVersion": "2",
  261. "x": 375.0000305175781,
  262. "y": 162.99998474121095,
  263. "width": 142.99996948242188,
  264. "height": 77.00001525878906
  265. }
  266. },
  267. "m_Slots": [
  268. {
  269. "m_Id": "4ceff05fc3494e178d74e4f66112da10"
  270. }
  271. ],
  272. "synonyms": [],
  273. "m_Precision": 0,
  274. "m_PreviewExpanded": true,
  275. "m_DismissedVersion": 0,
  276. "m_PreviewMode": 0,
  277. "m_CustomColors": {
  278. "m_SerializableColors": []
  279. },
  280. "IsFirstSlotValid": true
  281. }
  282. {
  283. "m_SGVersion": 0,
  284. "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
  285. "m_ObjectId": "6369b3ee5861467c9563190ccf2198db",
  286. "m_Id": 1,
  287. "m_DisplayName": "positionCS",
  288. "m_SlotType": 0,
  289. "m_Hidden": false,
  290. "m_ShaderOutputName": "positionCS",
  291. "m_StageCapability": 3,
  292. "m_Value": {
  293. "x": 0.0,
  294. "y": 0.0,
  295. "z": 0.0,
  296. "w": 0.0
  297. },
  298. "m_DefaultValue": {
  299. "x": 0.0,
  300. "y": 0.0,
  301. "z": 0.0,
  302. "w": 0.0
  303. },
  304. "m_Labels": []
  305. }
  306. {
  307. "m_SGVersion": 0,
  308. "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
  309. "m_ObjectId": "6f81186116594405b8db61ef33eaeec7",
  310. "m_Id": 3,
  311. "m_DisplayName": "depthAttenuation",
  312. "m_SlotType": 1,
  313. "m_Hidden": false,
  314. "m_ShaderOutputName": "depthAttenuation",
  315. "m_StageCapability": 3,
  316. "m_Value": 0.0,
  317. "m_DefaultValue": 0.0,
  318. "m_Labels": []
  319. }
  320. {
  321. "m_SGVersion": 0,
  322. "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode",
  323. "m_ObjectId": "9d08d3bb7e77482f85e9e256a6794e1b",
  324. "m_Group": {
  325. "m_Id": "14b75083cee14a7bab583b8e1e8e7c0d"
  326. },
  327. "m_Name": "Screen Position",
  328. "m_DrawState": {
  329. "m_Expanded": true,
  330. "m_Position": {
  331. "serializedVersion": "2",
  332. "x": -273.5,
  333. "y": 152.0,
  334. "width": 145.0,
  335. "height": 129.0
  336. }
  337. },
  338. "m_Slots": [
  339. {
  340. "m_Id": "4563ae525d1041a1a544494802624c15"
  341. }
  342. ],
  343. "synonyms": [],
  344. "m_Precision": 0,
  345. "m_PreviewExpanded": false,
  346. "m_DismissedVersion": 0,
  347. "m_PreviewMode": 0,
  348. "m_CustomColors": {
  349. "m_SerializableColors": []
  350. },
  351. "m_ScreenSpaceType": 1
  352. }
  353. {
  354. "m_SGVersion": 0,
  355. "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
  356. "m_ObjectId": "a5a15fc6e6f4433a919d21d7ef135465",
  357. "m_Id": 0,
  358. "m_DisplayName": "eyeDepth",
  359. "m_SlotType": 0,
  360. "m_Hidden": false,
  361. "m_ShaderOutputName": "eyeDepth",
  362. "m_StageCapability": 3,
  363. "m_Value": 0.0,
  364. "m_DefaultValue": 0.0,
  365. "m_Labels": []
  366. }
  367. {
  368. "m_SGVersion": 1,
  369. "m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
  370. "m_ObjectId": "acb0268c2b414e38970678a4b85e9910",
  371. "m_Group": {
  372. "m_Id": "14b75083cee14a7bab583b8e1e8e7c0d"
  373. },
  374. "m_Name": "CalcWaterDepth (Custom Function)",
  375. "m_DrawState": {
  376. "m_Expanded": true,
  377. "m_Position": {
  378. "serializedVersion": "2",
  379. "x": -6.5,
  380. "y": 162.99993896484376,
  381. "width": 254.0,
  382. "height": 166.0
  383. }
  384. },
  385. "m_Slots": [
  386. {
  387. "m_Id": "a5a15fc6e6f4433a919d21d7ef135465"
  388. },
  389. {
  390. "m_Id": "6369b3ee5861467c9563190ccf2198db"
  391. },
  392. {
  393. "m_Id": "b1aea78a4cb846b687c3e3c8a51a8131"
  394. },
  395. {
  396. "m_Id": "6f81186116594405b8db61ef33eaeec7"
  397. }
  398. ],
  399. "synonyms": [
  400. "code",
  401. "HLSL"
  402. ],
  403. "m_Precision": 0,
  404. "m_PreviewExpanded": false,
  405. "m_DismissedVersion": 0,
  406. "m_PreviewMode": 0,
  407. "m_CustomColors": {
  408. "m_SerializableColors": []
  409. },
  410. "m_SourceType": 1,
  411. "m_FunctionName": "CalcWaterDepth",
  412. "m_FunctionSource": "",
  413. "m_FunctionBody": "const float sceneDepth = eyeDepth;\r\r\n\rconst float clipSpaceDepth = positionCS.w;\n\nfloat surfaceDepth = (sceneDepth - clipSpaceDepth);\r\n\r\ndepthAttenuation = saturate(1.0 - exp(-surfaceDepth * depthScalar * 0.1));"
  414. }
  415. {
  416. "m_SGVersion": 0,
  417. "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
  418. "m_ObjectId": "b1aea78a4cb846b687c3e3c8a51a8131",
  419. "m_Id": 2,
  420. "m_DisplayName": "depthScalar",
  421. "m_SlotType": 0,
  422. "m_Hidden": false,
  423. "m_ShaderOutputName": "depthScalar",
  424. "m_StageCapability": 3,
  425. "m_Value": 0.0,
  426. "m_DefaultValue": 0.0,
  427. "m_Labels": []
  428. }
  429. {
  430. "m_SGVersion": 0,
  431. "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
  432. "m_ObjectId": "dfeed0284ab2426081fbde3ae2d4cf98",
  433. "m_Id": 1,
  434. "m_DisplayName": "Out",
  435. "m_SlotType": 1,
  436. "m_Hidden": false,
  437. "m_ShaderOutputName": "Out",
  438. "m_StageCapability": 2,
  439. "m_Value": 0.0,
  440. "m_DefaultValue": 0.0,
  441. "m_Labels": []
  442. }
  443. {
  444. "m_SGVersion": 0,
  445. "m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot",
  446. "m_ObjectId": "e98042f018904841862a997efed96a8d",
  447. "m_Id": 0,
  448. "m_DisplayName": "UV",
  449. "m_SlotType": 0,
  450. "m_Hidden": false,
  451. "m_ShaderOutputName": "UV",
  452. "m_StageCapability": 3,
  453. "m_Value": {
  454. "x": 0.0,
  455. "y": 0.0,
  456. "z": 0.0,
  457. "w": 0.0
  458. },
  459. "m_DefaultValue": {
  460. "x": 0.0,
  461. "y": 0.0,
  462. "z": 0.0,
  463. "w": 0.0
  464. },
  465. "m_Labels": [],
  466. "m_ScreenSpaceType": 0
  467. }
  468. {
  469. "m_SGVersion": 0,
  470. "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
  471. "m_ObjectId": "ebfce0ea751d44f8835e9b30dc1c8b2b",
  472. "m_Id": 0,
  473. "m_DisplayName": "Fog Density",
  474. "m_SlotType": 1,
  475. "m_Hidden": false,
  476. "m_ShaderOutputName": "Out",
  477. "m_StageCapability": 3,
  478. "m_Value": 0.0,
  479. "m_DefaultValue": 0.0,
  480. "m_Labels": []
  481. }
  482. {
  483. "m_SGVersion": 0,
  484. "m_Type": "UnityEditor.ShaderGraph.SceneDepthNode",
  485. "m_ObjectId": "fc2165714e974278a2d27395c1eb6187",
  486. "m_Group": {
  487. "m_Id": "14b75083cee14a7bab583b8e1e8e7c0d"
  488. },
  489. "m_Name": "Scene Depth",
  490. "m_DrawState": {
  491. "m_Expanded": true,
  492. "m_Position": {
  493. "serializedVersion": "2",
  494. "x": -279.5,
  495. "y": 29.0,
  496. "width": 145.0,
  497. "height": 112.0
  498. }
  499. },
  500. "m_Slots": [
  501. {
  502. "m_Id": "e98042f018904841862a997efed96a8d"
  503. },
  504. {
  505. "m_Id": "dfeed0284ab2426081fbde3ae2d4cf98"
  506. }
  507. ],
  508. "synonyms": [
  509. "zbuffer",
  510. "zdepth"
  511. ],
  512. "m_Precision": 0,
  513. "m_PreviewExpanded": true,
  514. "m_DismissedVersion": 0,
  515. "m_PreviewMode": 0,
  516. "m_CustomColors": {
  517. "m_SerializableColors": []
  518. },
  519. "m_DepthSamplingMode": 2
  520. }