39f74202-ead5-4a45-b966-273d526adbf1.json 117 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "pipeline/ssss-blur",
  4. "_objFlags": 0,
  5. "__editorExtras__": {},
  6. "_native": "",
  7. "techniques": [
  8. {
  9. "passes": [
  10. {
  11. "pass": "copy-pass",
  12. "depthTest": false,
  13. "depthWrite": false,
  14. "program": "pipeline/ssss-blur|blur-vs|copy-fs"
  15. },
  16. {
  17. "pass": "ssss-blurX",
  18. "program": "pipeline/ssss-blur|blur-vs|ssssBlurX-fs",
  19. "depthStencilState": {
  20. "depthTest": false,
  21. "depthWrite": false,
  22. "stencilTestFront": true,
  23. "stencilFuncFront": 2,
  24. "stencilRefBack": 120,
  25. "stencilRefFront": 120
  26. }
  27. },
  28. {
  29. "pass": "ssss-blurY",
  30. "program": "pipeline/ssss-blur|blur-vs|ssssBlurY-fs",
  31. "depthStencilState": {
  32. "depthTest": false,
  33. "depthWrite": false,
  34. "stencilTestFront": true,
  35. "stencilFuncFront": 2,
  36. "stencilRefBack": 120,
  37. "stencilRefFront": 120
  38. }
  39. }
  40. ]
  41. }
  42. ],
  43. "shaders": [
  44. {
  45. "blocks": [],
  46. "samplerTextures": [],
  47. "samplers": [],
  48. "textures": [],
  49. "buffers": [],
  50. "images": [],
  51. "subpassInputs": [],
  52. "attributes": [
  53. {
  54. "name": "a_position",
  55. "defines": [],
  56. "format": 32,
  57. "location": 0
  58. },
  59. {
  60. "name": "a_normal",
  61. "defines": [],
  62. "format": 32,
  63. "location": 1
  64. },
  65. {
  66. "name": "a_texCoord",
  67. "defines": [],
  68. "format": 21,
  69. "location": 2
  70. },
  71. {
  72. "name": "a_tangent",
  73. "defines": [],
  74. "format": 44,
  75. "location": 3
  76. },
  77. {
  78. "name": "a_joints",
  79. "defines": [
  80. "CC_USE_SKINNING"
  81. ],
  82. "location": 4
  83. },
  84. {
  85. "name": "a_weights",
  86. "defines": [
  87. "CC_USE_SKINNING"
  88. ],
  89. "format": 44,
  90. "location": 5
  91. },
  92. {
  93. "name": "a_jointAnimInfo",
  94. "defines": [
  95. "USE_INSTANCING",
  96. "CC_USE_BAKED_ANIMATION"
  97. ],
  98. "format": 44,
  99. "isInstanced": true,
  100. "location": 6
  101. },
  102. {
  103. "name": "a_matWorld0",
  104. "defines": [
  105. "USE_INSTANCING"
  106. ],
  107. "format": 44,
  108. "isInstanced": true,
  109. "location": 7
  110. },
  111. {
  112. "name": "a_matWorld1",
  113. "defines": [
  114. "USE_INSTANCING"
  115. ],
  116. "format": 44,
  117. "isInstanced": true,
  118. "location": 8
  119. },
  120. {
  121. "name": "a_matWorld2",
  122. "defines": [
  123. "USE_INSTANCING"
  124. ],
  125. "format": 44,
  126. "isInstanced": true,
  127. "location": 9
  128. },
  129. {
  130. "name": "a_lightingMapUVParam",
  131. "defines": [
  132. "USE_INSTANCING",
  133. "CC_USE_LIGHTMAP"
  134. ],
  135. "format": 44,
  136. "isInstanced": true,
  137. "location": 10
  138. },
  139. {
  140. "name": "a_localShadowBiasAndProbeId",
  141. "defines": [
  142. "USE_INSTANCING"
  143. ],
  144. "format": 44,
  145. "isInstanced": true,
  146. "location": 11
  147. },
  148. {
  149. "name": "a_reflectionProbeData",
  150. "defines": [
  151. "USE_INSTANCING",
  152. "CC_USE_REFLECTION_PROBE"
  153. ],
  154. "format": 44,
  155. "isInstanced": true,
  156. "location": 12
  157. },
  158. {
  159. "name": "a_sh_linear_const_r",
  160. "defines": [
  161. "USE_INSTANCING",
  162. "CC_USE_LIGHT_PROBE"
  163. ],
  164. "format": 44,
  165. "isInstanced": true,
  166. "location": 13
  167. },
  168. {
  169. "name": "a_sh_linear_const_g",
  170. "defines": [
  171. "USE_INSTANCING",
  172. "CC_USE_LIGHT_PROBE"
  173. ],
  174. "format": 44,
  175. "isInstanced": true,
  176. "location": 14
  177. },
  178. {
  179. "name": "a_sh_linear_const_b",
  180. "defines": [
  181. "USE_INSTANCING",
  182. "CC_USE_LIGHT_PROBE"
  183. ],
  184. "format": 44,
  185. "isInstanced": true,
  186. "location": 15
  187. },
  188. {
  189. "name": "a_vertexId",
  190. "defines": [
  191. "CC_USE_MORPH"
  192. ],
  193. "format": 11,
  194. "location": 16
  195. }
  196. ],
  197. "varyings": [
  198. {
  199. "name": "v_uv",
  200. "type": 14,
  201. "count": 1,
  202. "defines": [],
  203. "stageFlags": 17,
  204. "location": 0
  205. }
  206. ],
  207. "fragColors": [
  208. {
  209. "name": "fragColor",
  210. "typename": "vec4",
  211. "type": 16,
  212. "count": 1,
  213. "defines": [],
  214. "stageFlags": 16,
  215. "location": 0
  216. }
  217. ],
  218. "descriptors": [
  219. {
  220. "rate": 0,
  221. "blocks": [],
  222. "samplerTextures": [],
  223. "samplers": [],
  224. "textures": [],
  225. "buffers": [],
  226. "images": [],
  227. "subpassInputs": []
  228. },
  229. {
  230. "rate": 1,
  231. "blocks": [],
  232. "samplerTextures": [],
  233. "samplers": [],
  234. "textures": [],
  235. "buffers": [],
  236. "images": [],
  237. "subpassInputs": []
  238. },
  239. {
  240. "rate": 2,
  241. "blocks": [],
  242. "samplerTextures": [],
  243. "samplers": [],
  244. "textures": [],
  245. "buffers": [],
  246. "images": [],
  247. "subpassInputs": []
  248. },
  249. {
  250. "rate": 3,
  251. "blocks": [
  252. {
  253. "tags": {
  254. "builtin": "global"
  255. },
  256. "name": "CCGlobal",
  257. "members": [
  258. {
  259. "name": "cc_time",
  260. "typename": "vec4",
  261. "type": 16,
  262. "count": 1,
  263. "precision": "highp "
  264. },
  265. {
  266. "name": "cc_screenSize",
  267. "typename": "vec4",
  268. "type": 16,
  269. "count": 1,
  270. "precision": "mediump "
  271. },
  272. {
  273. "name": "cc_nativeSize",
  274. "typename": "vec4",
  275. "type": 16,
  276. "count": 1,
  277. "precision": "mediump "
  278. },
  279. {
  280. "name": "cc_probeInfo",
  281. "typename": "vec4",
  282. "type": 16,
  283. "count": 1,
  284. "precision": "mediump "
  285. },
  286. {
  287. "name": "cc_debug_view_mode",
  288. "typename": "vec4",
  289. "type": 16,
  290. "count": 1,
  291. "precision": "mediump "
  292. }
  293. ],
  294. "defines": [],
  295. "stageFlags": 17
  296. },
  297. {
  298. "tags": {
  299. "builtin": "global"
  300. },
  301. "name": "CCCamera",
  302. "members": [
  303. {
  304. "name": "cc_matView",
  305. "typename": "mat4",
  306. "type": 25,
  307. "count": 1,
  308. "precision": "highp "
  309. },
  310. {
  311. "name": "cc_matViewInv",
  312. "typename": "mat4",
  313. "type": 25,
  314. "count": 1,
  315. "precision": "highp "
  316. },
  317. {
  318. "name": "cc_matProj",
  319. "typename": "mat4",
  320. "type": 25,
  321. "count": 1,
  322. "precision": "highp "
  323. },
  324. {
  325. "name": "cc_matProjInv",
  326. "typename": "mat4",
  327. "type": 25,
  328. "count": 1,
  329. "precision": "highp "
  330. },
  331. {
  332. "name": "cc_matViewProj",
  333. "typename": "mat4",
  334. "type": 25,
  335. "count": 1,
  336. "precision": "highp "
  337. },
  338. {
  339. "name": "cc_matViewProjInv",
  340. "typename": "mat4",
  341. "type": 25,
  342. "count": 1,
  343. "precision": "highp "
  344. },
  345. {
  346. "name": "cc_cameraPos",
  347. "typename": "vec4",
  348. "type": 16,
  349. "count": 1,
  350. "precision": "highp "
  351. },
  352. {
  353. "name": "cc_surfaceTransform",
  354. "typename": "vec4",
  355. "type": 16,
  356. "count": 1,
  357. "precision": "mediump "
  358. },
  359. {
  360. "name": "cc_screenScale",
  361. "typename": "vec4",
  362. "type": 16,
  363. "count": 1,
  364. "precision": "mediump "
  365. },
  366. {
  367. "name": "cc_exposure",
  368. "typename": "vec4",
  369. "type": 16,
  370. "count": 1,
  371. "precision": "mediump "
  372. },
  373. {
  374. "name": "cc_mainLitDir",
  375. "typename": "vec4",
  376. "type": 16,
  377. "count": 1,
  378. "precision": "mediump "
  379. },
  380. {
  381. "name": "cc_mainLitColor",
  382. "typename": "vec4",
  383. "type": 16,
  384. "count": 1,
  385. "precision": "mediump "
  386. },
  387. {
  388. "name": "cc_ambientSky",
  389. "typename": "vec4",
  390. "type": 16,
  391. "count": 1,
  392. "precision": "mediump "
  393. },
  394. {
  395. "name": "cc_ambientGround",
  396. "typename": "vec4",
  397. "type": 16,
  398. "count": 1,
  399. "precision": "mediump "
  400. },
  401. {
  402. "name": "cc_fogColor",
  403. "typename": "vec4",
  404. "type": 16,
  405. "count": 1,
  406. "precision": "mediump "
  407. },
  408. {
  409. "name": "cc_fogBase",
  410. "typename": "vec4",
  411. "type": 16,
  412. "count": 1,
  413. "precision": "mediump "
  414. },
  415. {
  416. "name": "cc_fogAdd",
  417. "typename": "vec4",
  418. "type": 16,
  419. "count": 1,
  420. "precision": "mediump "
  421. },
  422. {
  423. "name": "cc_nearFar",
  424. "typename": "vec4",
  425. "type": 16,
  426. "count": 1,
  427. "precision": "mediump "
  428. },
  429. {
  430. "name": "cc_viewPort",
  431. "typename": "vec4",
  432. "type": 16,
  433. "count": 1,
  434. "precision": "mediump "
  435. }
  436. ],
  437. "defines": [],
  438. "stageFlags": 17
  439. }
  440. ],
  441. "samplerTextures": [
  442. {
  443. "name": "depthRaw",
  444. "type": 28,
  445. "count": 1,
  446. "defines": [],
  447. "stageFlags": 16,
  448. "binding": 0
  449. }
  450. ],
  451. "samplers": [],
  452. "textures": [],
  453. "buffers": [],
  454. "images": [],
  455. "subpassInputs": []
  456. }
  457. ],
  458. "hash": 3626846176,
  459. "glsl4": {
  460. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nlayout(location = 0) in vec3 a_position;\nlayout(location = 1) in vec3 a_normal;\nlayout(location = 2) in vec2 a_texCoord;\nlayout(location = 3) in vec4 a_tangent;\n#if CC_USE_SKINNING\n layout(location = 4) in u32vec4 a_joints;\n layout(location = 5) in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n layout(location = 6) in highp vec4 a_jointAnimInfo;\n #endif\n layout(location = 7) in vec4 a_matWorld0;\n layout(location = 8) in vec4 a_matWorld1;\n layout(location = 9) in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n layout(location = 10) in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n layout(location = 11) in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n layout(location = 12) in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n layout(location = 13) in vec4 a_sh_linear_const_r;\n layout(location = 14) in vec4 a_sh_linear_const_g;\n layout(location = 15) in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n#endif\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nlayout(location = 0) out vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  461. "frag": "\nprecision highp float;\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 packDepthToRGBA (float depth) {\n vec4 ret = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\n ret = fract(ret);\n ret -= vec4(ret.yzw, 0.0) / 255.0;\n return ret;\n}\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nlayout(set = 1, binding = 0) uniform sampler2D depthRaw;\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main() {\n float depth = texture(depthRaw, v_uv).r;\n fragColor = packDepthToRGBA(depth);\n}"
  462. },
  463. "glsl3": {
  464. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nin vec3 a_position;\nin vec3 a_normal;\nin vec2 a_texCoord;\nin vec4 a_tangent;\n#if CC_USE_SKINNING\n in vec4 a_joints;\n in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n in highp vec4 a_jointAnimInfo;\n #endif\n in vec4 a_matWorld0;\n in vec4 a_matWorld1;\n in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n in vec4 a_sh_linear_const_r;\n in vec4 a_sh_linear_const_g;\n in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n in float a_vertexId;\n#endif\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nout vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  465. "frag": "\nprecision highp float;\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 packDepthToRGBA (float depth) {\n vec4 ret = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\n ret = fract(ret);\n ret -= vec4(ret.yzw, 0.0) / 255.0;\n return ret;\n}\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nuniform sampler2D depthRaw;\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main() {\n float depth = texture(depthRaw, v_uv).r;\n fragColor = packDepthToRGBA(depth);\n}"
  466. },
  467. "glsl1": {
  468. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nattribute vec3 a_position;\nattribute vec3 a_normal;\nattribute vec2 a_texCoord;\nattribute vec4 a_tangent;\n#if CC_USE_SKINNING\n attribute vec4 a_joints;\n attribute vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n attribute highp vec4 a_jointAnimInfo;\n #endif\n attribute vec4 a_matWorld0;\n attribute vec4 a_matWorld1;\n attribute vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n attribute vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n attribute vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n attribute vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n attribute vec4 a_sh_linear_const_r;\n attribute vec4 a_sh_linear_const_g;\n attribute vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n attribute float a_vertexId;\n#endif\nuniform highp vec4 cc_cameraPos;\nvarying vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  469. "frag": "\nprecision highp float;\nvec4 packDepthToRGBA (float depth) {\n vec4 ret = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\n ret = fract(ret);\n ret -= vec4(ret.yzw, 0.0) / 255.0;\n return ret;\n}\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nuniform sampler2D depthRaw;\nvarying vec2 v_uv;\nvoid main() {\n float depth = texture2D(depthRaw, v_uv).r;\n gl_FragColor = packDepthToRGBA(depth);\n}"
  470. },
  471. "builtins": {
  472. "globals": {
  473. "blocks": [
  474. {
  475. "name": "CCGlobal",
  476. "defines": []
  477. },
  478. {
  479. "name": "CCCamera",
  480. "defines": []
  481. }
  482. ],
  483. "samplerTextures": [],
  484. "buffers": [],
  485. "images": []
  486. },
  487. "locals": {
  488. "blocks": [],
  489. "samplerTextures": [],
  490. "buffers": [],
  491. "images": []
  492. },
  493. "statistics": {
  494. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  495. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 42
  496. }
  497. },
  498. "defines": [
  499. {
  500. "name": "USE_INSTANCING",
  501. "type": "boolean",
  502. "defines": [],
  503. "editor": {
  504. "elevated": true
  505. }
  506. },
  507. {
  508. "name": "CC_USE_SKINNING",
  509. "type": "boolean",
  510. "defines": []
  511. },
  512. {
  513. "name": "CC_USE_BAKED_ANIMATION",
  514. "type": "boolean",
  515. "defines": [
  516. "USE_INSTANCING"
  517. ]
  518. },
  519. {
  520. "name": "CC_USE_LIGHTMAP",
  521. "type": "boolean",
  522. "defines": [
  523. "USE_INSTANCING"
  524. ]
  525. },
  526. {
  527. "name": "CC_USE_REFLECTION_PROBE",
  528. "type": "boolean",
  529. "defines": [
  530. "USE_INSTANCING"
  531. ]
  532. },
  533. {
  534. "name": "CC_RECEIVE_SHADOW",
  535. "type": "boolean",
  536. "defines": [
  537. "USE_INSTANCING"
  538. ]
  539. },
  540. {
  541. "name": "CC_USE_LIGHT_PROBE",
  542. "type": "boolean",
  543. "defines": [
  544. "USE_INSTANCING"
  545. ]
  546. },
  547. {
  548. "name": "CC_USE_MORPH",
  549. "type": "boolean",
  550. "defines": []
  551. }
  552. ],
  553. "name": "pipeline/ssss-blur|blur-vs|copy-fs"
  554. },
  555. {
  556. "blocks": [
  557. {
  558. "name": "blurUBO",
  559. "members": [
  560. {
  561. "name": "blurInfo",
  562. "type": 16,
  563. "count": 1
  564. },
  565. {
  566. "name": "kernel",
  567. "type": 16,
  568. "count": 25
  569. }
  570. ],
  571. "defines": [],
  572. "stageFlags": 16,
  573. "binding": 0
  574. }
  575. ],
  576. "samplerTextures": [],
  577. "samplers": [],
  578. "textures": [],
  579. "buffers": [],
  580. "images": [],
  581. "subpassInputs": [],
  582. "attributes": [
  583. {
  584. "name": "a_position",
  585. "defines": [],
  586. "format": 32,
  587. "location": 0
  588. },
  589. {
  590. "name": "a_normal",
  591. "defines": [],
  592. "format": 32,
  593. "location": 1
  594. },
  595. {
  596. "name": "a_texCoord",
  597. "defines": [],
  598. "format": 21,
  599. "location": 2
  600. },
  601. {
  602. "name": "a_tangent",
  603. "defines": [],
  604. "format": 44,
  605. "location": 3
  606. },
  607. {
  608. "name": "a_joints",
  609. "defines": [
  610. "CC_USE_SKINNING"
  611. ],
  612. "location": 4
  613. },
  614. {
  615. "name": "a_weights",
  616. "defines": [
  617. "CC_USE_SKINNING"
  618. ],
  619. "format": 44,
  620. "location": 5
  621. },
  622. {
  623. "name": "a_jointAnimInfo",
  624. "defines": [
  625. "USE_INSTANCING",
  626. "CC_USE_BAKED_ANIMATION"
  627. ],
  628. "format": 44,
  629. "isInstanced": true,
  630. "location": 6
  631. },
  632. {
  633. "name": "a_matWorld0",
  634. "defines": [
  635. "USE_INSTANCING"
  636. ],
  637. "format": 44,
  638. "isInstanced": true,
  639. "location": 7
  640. },
  641. {
  642. "name": "a_matWorld1",
  643. "defines": [
  644. "USE_INSTANCING"
  645. ],
  646. "format": 44,
  647. "isInstanced": true,
  648. "location": 8
  649. },
  650. {
  651. "name": "a_matWorld2",
  652. "defines": [
  653. "USE_INSTANCING"
  654. ],
  655. "format": 44,
  656. "isInstanced": true,
  657. "location": 9
  658. },
  659. {
  660. "name": "a_lightingMapUVParam",
  661. "defines": [
  662. "USE_INSTANCING",
  663. "CC_USE_LIGHTMAP"
  664. ],
  665. "format": 44,
  666. "isInstanced": true,
  667. "location": 10
  668. },
  669. {
  670. "name": "a_localShadowBiasAndProbeId",
  671. "defines": [
  672. "USE_INSTANCING"
  673. ],
  674. "format": 44,
  675. "isInstanced": true,
  676. "location": 11
  677. },
  678. {
  679. "name": "a_reflectionProbeData",
  680. "defines": [
  681. "USE_INSTANCING",
  682. "CC_USE_REFLECTION_PROBE"
  683. ],
  684. "format": 44,
  685. "isInstanced": true,
  686. "location": 12
  687. },
  688. {
  689. "name": "a_sh_linear_const_r",
  690. "defines": [
  691. "USE_INSTANCING",
  692. "CC_USE_LIGHT_PROBE"
  693. ],
  694. "format": 44,
  695. "isInstanced": true,
  696. "location": 13
  697. },
  698. {
  699. "name": "a_sh_linear_const_g",
  700. "defines": [
  701. "USE_INSTANCING",
  702. "CC_USE_LIGHT_PROBE"
  703. ],
  704. "format": 44,
  705. "isInstanced": true,
  706. "location": 14
  707. },
  708. {
  709. "name": "a_sh_linear_const_b",
  710. "defines": [
  711. "USE_INSTANCING",
  712. "CC_USE_LIGHT_PROBE"
  713. ],
  714. "format": 44,
  715. "isInstanced": true,
  716. "location": 15
  717. },
  718. {
  719. "name": "a_vertexId",
  720. "defines": [
  721. "CC_USE_MORPH"
  722. ],
  723. "format": 11,
  724. "location": 16
  725. }
  726. ],
  727. "varyings": [
  728. {
  729. "name": "v_uv",
  730. "type": 14,
  731. "count": 1,
  732. "defines": [],
  733. "stageFlags": 17,
  734. "location": 0
  735. }
  736. ],
  737. "fragColors": [
  738. {
  739. "name": "fragColor",
  740. "typename": "vec4",
  741. "type": 16,
  742. "count": 1,
  743. "defines": [],
  744. "stageFlags": 16,
  745. "location": 0
  746. }
  747. ],
  748. "descriptors": [
  749. {
  750. "rate": 0,
  751. "blocks": [],
  752. "samplerTextures": [],
  753. "samplers": [],
  754. "textures": [],
  755. "buffers": [],
  756. "images": [],
  757. "subpassInputs": []
  758. },
  759. {
  760. "rate": 1,
  761. "blocks": [
  762. {
  763. "name": "blurUBO",
  764. "members": [
  765. {
  766. "name": "blurInfo",
  767. "type": 16,
  768. "count": 1
  769. },
  770. {
  771. "name": "kernel",
  772. "type": 16,
  773. "count": 25
  774. }
  775. ],
  776. "defines": [],
  777. "stageFlags": 16,
  778. "binding": 0
  779. }
  780. ],
  781. "samplerTextures": [],
  782. "samplers": [],
  783. "textures": [],
  784. "buffers": [],
  785. "images": [],
  786. "subpassInputs": []
  787. },
  788. {
  789. "rate": 2,
  790. "blocks": [],
  791. "samplerTextures": [],
  792. "samplers": [],
  793. "textures": [],
  794. "buffers": [],
  795. "images": [],
  796. "subpassInputs": []
  797. },
  798. {
  799. "rate": 3,
  800. "blocks": [
  801. {
  802. "tags": {
  803. "builtin": "global"
  804. },
  805. "name": "CCGlobal",
  806. "members": [
  807. {
  808. "name": "cc_time",
  809. "typename": "vec4",
  810. "type": 16,
  811. "count": 1,
  812. "precision": "highp "
  813. },
  814. {
  815. "name": "cc_screenSize",
  816. "typename": "vec4",
  817. "type": 16,
  818. "count": 1,
  819. "precision": "mediump "
  820. },
  821. {
  822. "name": "cc_nativeSize",
  823. "typename": "vec4",
  824. "type": 16,
  825. "count": 1,
  826. "precision": "mediump "
  827. },
  828. {
  829. "name": "cc_probeInfo",
  830. "typename": "vec4",
  831. "type": 16,
  832. "count": 1,
  833. "precision": "mediump "
  834. },
  835. {
  836. "name": "cc_debug_view_mode",
  837. "typename": "vec4",
  838. "type": 16,
  839. "count": 1,
  840. "precision": "mediump "
  841. }
  842. ],
  843. "defines": [],
  844. "stageFlags": 17
  845. },
  846. {
  847. "tags": {
  848. "builtin": "global"
  849. },
  850. "name": "CCCamera",
  851. "members": [
  852. {
  853. "name": "cc_matView",
  854. "typename": "mat4",
  855. "type": 25,
  856. "count": 1,
  857. "precision": "highp "
  858. },
  859. {
  860. "name": "cc_matViewInv",
  861. "typename": "mat4",
  862. "type": 25,
  863. "count": 1,
  864. "precision": "highp "
  865. },
  866. {
  867. "name": "cc_matProj",
  868. "typename": "mat4",
  869. "type": 25,
  870. "count": 1,
  871. "precision": "highp "
  872. },
  873. {
  874. "name": "cc_matProjInv",
  875. "typename": "mat4",
  876. "type": 25,
  877. "count": 1,
  878. "precision": "highp "
  879. },
  880. {
  881. "name": "cc_matViewProj",
  882. "typename": "mat4",
  883. "type": 25,
  884. "count": 1,
  885. "precision": "highp "
  886. },
  887. {
  888. "name": "cc_matViewProjInv",
  889. "typename": "mat4",
  890. "type": 25,
  891. "count": 1,
  892. "precision": "highp "
  893. },
  894. {
  895. "name": "cc_cameraPos",
  896. "typename": "vec4",
  897. "type": 16,
  898. "count": 1,
  899. "precision": "highp "
  900. },
  901. {
  902. "name": "cc_surfaceTransform",
  903. "typename": "vec4",
  904. "type": 16,
  905. "count": 1,
  906. "precision": "mediump "
  907. },
  908. {
  909. "name": "cc_screenScale",
  910. "typename": "vec4",
  911. "type": 16,
  912. "count": 1,
  913. "precision": "mediump "
  914. },
  915. {
  916. "name": "cc_exposure",
  917. "typename": "vec4",
  918. "type": 16,
  919. "count": 1,
  920. "precision": "mediump "
  921. },
  922. {
  923. "name": "cc_mainLitDir",
  924. "typename": "vec4",
  925. "type": 16,
  926. "count": 1,
  927. "precision": "mediump "
  928. },
  929. {
  930. "name": "cc_mainLitColor",
  931. "typename": "vec4",
  932. "type": 16,
  933. "count": 1,
  934. "precision": "mediump "
  935. },
  936. {
  937. "name": "cc_ambientSky",
  938. "typename": "vec4",
  939. "type": 16,
  940. "count": 1,
  941. "precision": "mediump "
  942. },
  943. {
  944. "name": "cc_ambientGround",
  945. "typename": "vec4",
  946. "type": 16,
  947. "count": 1,
  948. "precision": "mediump "
  949. },
  950. {
  951. "name": "cc_fogColor",
  952. "typename": "vec4",
  953. "type": 16,
  954. "count": 1,
  955. "precision": "mediump "
  956. },
  957. {
  958. "name": "cc_fogBase",
  959. "typename": "vec4",
  960. "type": 16,
  961. "count": 1,
  962. "precision": "mediump "
  963. },
  964. {
  965. "name": "cc_fogAdd",
  966. "typename": "vec4",
  967. "type": 16,
  968. "count": 1,
  969. "precision": "mediump "
  970. },
  971. {
  972. "name": "cc_nearFar",
  973. "typename": "vec4",
  974. "type": 16,
  975. "count": 1,
  976. "precision": "mediump "
  977. },
  978. {
  979. "name": "cc_viewPort",
  980. "typename": "vec4",
  981. "type": 16,
  982. "count": 1,
  983. "precision": "mediump "
  984. }
  985. ],
  986. "defines": [],
  987. "stageFlags": 17
  988. }
  989. ],
  990. "samplerTextures": [
  991. {
  992. "name": "colorTex",
  993. "type": 28,
  994. "count": 1,
  995. "defines": [],
  996. "stageFlags": 16,
  997. "binding": 1
  998. },
  999. {
  1000. "name": "depthTex",
  1001. "type": 28,
  1002. "count": 1,
  1003. "defines": [],
  1004. "stageFlags": 16,
  1005. "binding": 2
  1006. }
  1007. ],
  1008. "samplers": [],
  1009. "textures": [],
  1010. "buffers": [],
  1011. "images": [],
  1012. "subpassInputs": []
  1013. }
  1014. ],
  1015. "hash": 1180989910,
  1016. "glsl4": {
  1017. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nlayout(location = 0) in vec3 a_position;\nlayout(location = 1) in vec3 a_normal;\nlayout(location = 2) in vec2 a_texCoord;\nlayout(location = 3) in vec4 a_tangent;\n#if CC_USE_SKINNING\n layout(location = 4) in u32vec4 a_joints;\n layout(location = 5) in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n layout(location = 6) in highp vec4 a_jointAnimInfo;\n #endif\n layout(location = 7) in vec4 a_matWorld0;\n layout(location = 8) in vec4 a_matWorld1;\n layout(location = 9) in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n layout(location = 10) in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n layout(location = 11) in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n layout(location = 12) in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n layout(location = 13) in vec4 a_sh_linear_const_r;\n layout(location = 14) in vec4 a_sh_linear_const_g;\n layout(location = 15) in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n#endif\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nlayout(location = 0) out vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  1018. "frag": "\nprecision highp float;\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\nvec2 saturate(vec2 value) { return clamp(value, vec2(0.0), vec2(1.0)); }\nvec3 saturate(vec3 value) { return clamp(value, vec3(0.0), vec3(1.0)); }\nvec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nvec3 SRGBToLinear (vec3 gamma) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return gamma;\n }\n #endif\n#endif\n return gamma * gamma;\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\n#if defined(CC_USE_METAL) || defined(CC_USE_WGPU)\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y) y = -y\n#else\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y)\n#endif\nfloat GetCameraDepthRH(float depthHS, mat4 matProj)\n{\n return -matProj[3][2] / (depthHS + matProj[2][2]);\n}\nfloat GetCameraDepthRH(float depthHS, float matProj32, float matProj22)\n{\n return -matProj32 / (depthHS + matProj22);\n}\nlayout(set = 1, binding = 0) uniform blurUBO {\n highp vec4 blurInfo;\n highp vec4 kernel[25];\n};\nlayout(set = 1, binding = 1) uniform sampler2D colorTex;\nlayout(set = 1, binding = 2) uniform sampler2D depthTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nvec4 blur(vec2 texcoord, vec2 dir) {\n float ssssFov = blurInfo.x;\n float ssssWidth = blurInfo.y;\n float boundingBox = blurInfo.z;\n float depthUnitScale = boundingBox * blurInfo.w;\n vec4 colorM = texture(colorTex, texcoord);\n #if !CC_USE_HDR\n colorM = vec4(LinearToSRGB(colorM.rgb), colorM.a);\n #endif\n float threshold = 0.9, rangeScale = 1.0 / 0.9;\n float SSSS_STRENGTH_SOURCE = colorM.a > threshold ? 0.0 : colorM.a * rangeScale;\n #define SSSS_STRENGTH_SOURCE_INLOOP (color.a > threshold ? 0.0 : color.a * rangeScale)\n float depthHS = dot(texture(depthTex, texcoord), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depthM = -GetCameraDepthRH(depthHS, cc_matProj);\n float distanceToProjectionWindow = 1.0 / tan(0.5 * ssssFov);\n float scale = distanceToProjectionWindow / depthM * depthUnitScale;\n vec2 finalStep = vec2(ssssWidth) * vec2(scale) * dir;\n finalStep *= vec2(SSSS_STRENGTH_SOURCE);\n finalStep *= vec2(1.0 / (25 > 20 ? 3.0 : 2.0));\n vec4 colorBlurred = colorM;\n colorBlurred.rgb *= kernel[0].rgb;\n for (int i = 1; i < 25; i++) {\n vec2 offset = texcoord + vec2(kernel[i].a) * finalStep;\n vec4 color = texture(colorTex, fixUV(offset));\n #if !CC_USE_HDR\n color = vec4(LinearToSRGB(color.rgb), color.a);\n #endif\n float depthHS = dot(texture(depthTex, fixUV(offset)), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depth = -GetCameraDepthRH(depthHS, cc_matProj);\n float s = saturate(100.0 / depthUnitScale * distanceToProjectionWindow * ssssWidth * abs(depthM - depth));\n color.rgb = mix(color.rgb, colorM.rgb, s);\n colorBlurred.rgb += kernel[i].rgb * mix(colorM.rgb, color.rgb, SSSS_STRENGTH_SOURCE_INLOOP);\n }\n #if !CC_USE_HDR\n colorBlurred = vec4(SRGBToLinear(colorBlurred.rgb), colorBlurred.a);\n #endif\n return colorBlurred;\n}\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main() {\n fragColor = blur(v_uv, vec2(1.0, 0.0));\n}"
  1019. },
  1020. "glsl3": {
  1021. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nin vec3 a_position;\nin vec3 a_normal;\nin vec2 a_texCoord;\nin vec4 a_tangent;\n#if CC_USE_SKINNING\n in vec4 a_joints;\n in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n in highp vec4 a_jointAnimInfo;\n #endif\n in vec4 a_matWorld0;\n in vec4 a_matWorld1;\n in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n in vec4 a_sh_linear_const_r;\n in vec4 a_sh_linear_const_g;\n in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n in float a_vertexId;\n#endif\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nout vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  1022. "frag": "\nprecision highp float;\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\nvec2 saturate(vec2 value) { return clamp(value, vec2(0.0), vec2(1.0)); }\nvec3 saturate(vec3 value) { return clamp(value, vec3(0.0), vec3(1.0)); }\nvec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nvec3 SRGBToLinear (vec3 gamma) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return gamma;\n }\n #endif\n#endif\n return gamma * gamma;\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\n#if defined(CC_USE_METAL) || defined(CC_USE_WGPU)\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y) y = -y\n#else\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y)\n#endif\nfloat GetCameraDepthRH(float depthHS, mat4 matProj)\n{\n return -matProj[3][2] / (depthHS + matProj[2][2]);\n}\nfloat GetCameraDepthRH(float depthHS, float matProj32, float matProj22)\n{\n return -matProj32 / (depthHS + matProj22);\n}\nlayout(std140) uniform blurUBO {\n highp vec4 blurInfo;\n highp vec4 kernel[25];\n};\nuniform sampler2D colorTex;\nuniform sampler2D depthTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nvec4 blur(vec2 texcoord, vec2 dir) {\n float ssssFov = blurInfo.x;\n float ssssWidth = blurInfo.y;\n float boundingBox = blurInfo.z;\n float depthUnitScale = boundingBox * blurInfo.w;\n vec4 colorM = texture(colorTex, texcoord);\n #if !CC_USE_HDR\n colorM = vec4(LinearToSRGB(colorM.rgb), colorM.a);\n #endif\n float threshold = 0.9, rangeScale = 1.0 / 0.9;\n float SSSS_STRENGTH_SOURCE = colorM.a > threshold ? 0.0 : colorM.a * rangeScale;\n #define SSSS_STRENGTH_SOURCE_INLOOP (color.a > threshold ? 0.0 : color.a * rangeScale)\n float depthHS = dot(texture(depthTex, texcoord), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depthM = -GetCameraDepthRH(depthHS, cc_matProj);\n float distanceToProjectionWindow = 1.0 / tan(0.5 * ssssFov);\n float scale = distanceToProjectionWindow / depthM * depthUnitScale;\n vec2 finalStep = vec2(ssssWidth) * vec2(scale) * dir;\n finalStep *= vec2(SSSS_STRENGTH_SOURCE);\n finalStep *= vec2(1.0 / (25 > 20 ? 3.0 : 2.0));\n vec4 colorBlurred = colorM;\n colorBlurred.rgb *= kernel[0].rgb;\n for (int i = 1; i < 25; i++) {\n vec2 offset = texcoord + vec2(kernel[i].a) * finalStep;\n vec4 color = texture(colorTex, fixUV(offset));\n #if !CC_USE_HDR\n color = vec4(LinearToSRGB(color.rgb), color.a);\n #endif\n float depthHS = dot(texture(depthTex, fixUV(offset)), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depth = -GetCameraDepthRH(depthHS, cc_matProj);\n float s = saturate(100.0 / depthUnitScale * distanceToProjectionWindow * ssssWidth * abs(depthM - depth));\n color.rgb = mix(color.rgb, colorM.rgb, s);\n colorBlurred.rgb += kernel[i].rgb * mix(colorM.rgb, color.rgb, SSSS_STRENGTH_SOURCE_INLOOP);\n }\n #if !CC_USE_HDR\n colorBlurred = vec4(SRGBToLinear(colorBlurred.rgb), colorBlurred.a);\n #endif\n return colorBlurred;\n}\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main() {\n fragColor = blur(v_uv, vec2(1.0, 0.0));\n}"
  1023. },
  1024. "glsl1": {
  1025. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nattribute vec3 a_position;\nattribute vec3 a_normal;\nattribute vec2 a_texCoord;\nattribute vec4 a_tangent;\n#if CC_USE_SKINNING\n attribute vec4 a_joints;\n attribute vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n attribute highp vec4 a_jointAnimInfo;\n #endif\n attribute vec4 a_matWorld0;\n attribute vec4 a_matWorld1;\n attribute vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n attribute vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n attribute vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n attribute vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n attribute vec4 a_sh_linear_const_r;\n attribute vec4 a_sh_linear_const_g;\n attribute vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n attribute float a_vertexId;\n#endif\nuniform highp vec4 cc_cameraPos;\nvarying vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  1026. "frag": "\nprecision highp float;\nuniform highp mat4 cc_matProj;\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\nvec2 saturate(vec2 value) { return clamp(value, vec2(0.0), vec2(1.0)); }\nvec3 saturate(vec3 value) { return clamp(value, vec3(0.0), vec3(1.0)); }\nvec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nvec3 SRGBToLinear (vec3 gamma) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return gamma;\n }\n #endif\n#endif\n return gamma * gamma;\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\n#if defined(CC_USE_METAL) || defined(CC_USE_WGPU)\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y) y = -y\n#else\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y)\n#endif\nfloat GetCameraDepthRH(float depthHS, mat4 matProj)\n{\n return -matProj[3][2] / (depthHS + matProj[2][2]);\n}\nfloat GetCameraDepthRH(float depthHS, float matProj32, float matProj22)\n{\n return -matProj32 / (depthHS + matProj22);\n}\n uniform highp vec4 blurInfo;\n uniform highp vec4 kernel[25];\nuniform sampler2D colorTex;\nuniform sampler2D depthTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nvec4 blur(vec2 texcoord, vec2 dir) {\n float ssssFov = blurInfo.x;\n float ssssWidth = blurInfo.y;\n float boundingBox = blurInfo.z;\n float depthUnitScale = boundingBox * blurInfo.w;\n vec4 colorM = texture2D(colorTex, texcoord);\n #if !CC_USE_HDR\n colorM = vec4(LinearToSRGB(colorM.rgb), colorM.a);\n #endif\n float threshold = 0.9, rangeScale = 1.0 / 0.9;\n float SSSS_STRENGTH_SOURCE = colorM.a > threshold ? 0.0 : colorM.a * rangeScale;\n #define SSSS_STRENGTH_SOURCE_INLOOP (color.a > threshold ? 0.0 : color.a * rangeScale)\n float depthHS = dot(texture2D(depthTex, texcoord), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depthM = -GetCameraDepthRH(depthHS, cc_matProj);\n float distanceToProjectionWindow = 1.0 / tan(0.5 * ssssFov);\n float scale = distanceToProjectionWindow / depthM * depthUnitScale;\n vec2 finalStep = vec2(ssssWidth) * vec2(scale) * dir;\n finalStep *= vec2(SSSS_STRENGTH_SOURCE);\n finalStep *= vec2(1.0 / (25 > 20 ? 3.0 : 2.0));\n vec4 colorBlurred = colorM;\n colorBlurred.rgb *= kernel[0].rgb;\n for (int i = 1; i < 25; i++) {\n vec2 offset = texcoord + vec2(kernel[i].a) * finalStep;\n vec4 color = texture2D(colorTex, fixUV(offset));\n #if !CC_USE_HDR\n color = vec4(LinearToSRGB(color.rgb), color.a);\n #endif\n float depthHS = dot(texture2D(depthTex, fixUV(offset)), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depth = -GetCameraDepthRH(depthHS, cc_matProj);\n float s = saturate(100.0 / depthUnitScale * distanceToProjectionWindow * ssssWidth * abs(depthM - depth));\n color.rgb = mix(color.rgb, colorM.rgb, s);\n colorBlurred.rgb += kernel[i].rgb * mix(colorM.rgb, color.rgb, SSSS_STRENGTH_SOURCE_INLOOP);\n }\n #if !CC_USE_HDR\n colorBlurred = vec4(SRGBToLinear(colorBlurred.rgb), colorBlurred.a);\n #endif\n return colorBlurred;\n}\nvarying vec2 v_uv;\nvoid main() {\n gl_FragColor = blur(v_uv, vec2(1.0, 0.0));\n}"
  1027. },
  1028. "builtins": {
  1029. "globals": {
  1030. "blocks": [
  1031. {
  1032. "name": "CCGlobal",
  1033. "defines": []
  1034. },
  1035. {
  1036. "name": "CCCamera",
  1037. "defines": []
  1038. }
  1039. ],
  1040. "samplerTextures": [],
  1041. "buffers": [],
  1042. "images": []
  1043. },
  1044. "locals": {
  1045. "blocks": [],
  1046. "samplerTextures": [],
  1047. "buffers": [],
  1048. "images": []
  1049. },
  1050. "statistics": {
  1051. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  1052. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 68
  1053. }
  1054. },
  1055. "defines": [
  1056. {
  1057. "name": "USE_INSTANCING",
  1058. "type": "boolean",
  1059. "defines": [],
  1060. "editor": {
  1061. "elevated": true
  1062. }
  1063. },
  1064. {
  1065. "name": "CC_USE_SKINNING",
  1066. "type": "boolean",
  1067. "defines": []
  1068. },
  1069. {
  1070. "name": "CC_USE_BAKED_ANIMATION",
  1071. "type": "boolean",
  1072. "defines": [
  1073. "USE_INSTANCING"
  1074. ]
  1075. },
  1076. {
  1077. "name": "CC_USE_LIGHTMAP",
  1078. "type": "boolean",
  1079. "defines": [
  1080. "USE_INSTANCING"
  1081. ]
  1082. },
  1083. {
  1084. "name": "CC_USE_REFLECTION_PROBE",
  1085. "type": "boolean",
  1086. "defines": [
  1087. "USE_INSTANCING"
  1088. ]
  1089. },
  1090. {
  1091. "name": "CC_RECEIVE_SHADOW",
  1092. "type": "boolean",
  1093. "defines": [
  1094. "USE_INSTANCING"
  1095. ]
  1096. },
  1097. {
  1098. "name": "CC_USE_LIGHT_PROBE",
  1099. "type": "boolean",
  1100. "defines": [
  1101. "USE_INSTANCING"
  1102. ]
  1103. },
  1104. {
  1105. "name": "CC_USE_MORPH",
  1106. "type": "boolean",
  1107. "defines": []
  1108. },
  1109. {
  1110. "name": "CC_USE_DEBUG_VIEW",
  1111. "type": "number",
  1112. "defines": [],
  1113. "range": [
  1114. 0,
  1115. 3
  1116. ]
  1117. },
  1118. {
  1119. "name": "CC_SURFACES_ENABLE_DEBUG_VIEW",
  1120. "type": "boolean",
  1121. "defines": [
  1122. "CC_USE_DEBUG_VIEW",
  1123. "CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC"
  1124. ]
  1125. },
  1126. {
  1127. "name": "CC_USE_HDR",
  1128. "type": "boolean",
  1129. "defines": []
  1130. }
  1131. ],
  1132. "name": "pipeline/ssss-blur|blur-vs|ssssBlurX-fs"
  1133. },
  1134. {
  1135. "blocks": [
  1136. {
  1137. "name": "blurUBO",
  1138. "members": [
  1139. {
  1140. "name": "blurInfo",
  1141. "type": 16,
  1142. "count": 1
  1143. },
  1144. {
  1145. "name": "kernel",
  1146. "type": 16,
  1147. "count": 25
  1148. }
  1149. ],
  1150. "defines": [],
  1151. "stageFlags": 16,
  1152. "binding": 0
  1153. }
  1154. ],
  1155. "samplerTextures": [],
  1156. "samplers": [],
  1157. "textures": [],
  1158. "buffers": [],
  1159. "images": [],
  1160. "subpassInputs": [],
  1161. "attributes": [
  1162. {
  1163. "name": "a_position",
  1164. "defines": [],
  1165. "format": 32,
  1166. "location": 0
  1167. },
  1168. {
  1169. "name": "a_normal",
  1170. "defines": [],
  1171. "format": 32,
  1172. "location": 1
  1173. },
  1174. {
  1175. "name": "a_texCoord",
  1176. "defines": [],
  1177. "format": 21,
  1178. "location": 2
  1179. },
  1180. {
  1181. "name": "a_tangent",
  1182. "defines": [],
  1183. "format": 44,
  1184. "location": 3
  1185. },
  1186. {
  1187. "name": "a_joints",
  1188. "defines": [
  1189. "CC_USE_SKINNING"
  1190. ],
  1191. "location": 4
  1192. },
  1193. {
  1194. "name": "a_weights",
  1195. "defines": [
  1196. "CC_USE_SKINNING"
  1197. ],
  1198. "format": 44,
  1199. "location": 5
  1200. },
  1201. {
  1202. "name": "a_jointAnimInfo",
  1203. "defines": [
  1204. "USE_INSTANCING",
  1205. "CC_USE_BAKED_ANIMATION"
  1206. ],
  1207. "format": 44,
  1208. "isInstanced": true,
  1209. "location": 6
  1210. },
  1211. {
  1212. "name": "a_matWorld0",
  1213. "defines": [
  1214. "USE_INSTANCING"
  1215. ],
  1216. "format": 44,
  1217. "isInstanced": true,
  1218. "location": 7
  1219. },
  1220. {
  1221. "name": "a_matWorld1",
  1222. "defines": [
  1223. "USE_INSTANCING"
  1224. ],
  1225. "format": 44,
  1226. "isInstanced": true,
  1227. "location": 8
  1228. },
  1229. {
  1230. "name": "a_matWorld2",
  1231. "defines": [
  1232. "USE_INSTANCING"
  1233. ],
  1234. "format": 44,
  1235. "isInstanced": true,
  1236. "location": 9
  1237. },
  1238. {
  1239. "name": "a_lightingMapUVParam",
  1240. "defines": [
  1241. "USE_INSTANCING",
  1242. "CC_USE_LIGHTMAP"
  1243. ],
  1244. "format": 44,
  1245. "isInstanced": true,
  1246. "location": 10
  1247. },
  1248. {
  1249. "name": "a_localShadowBiasAndProbeId",
  1250. "defines": [
  1251. "USE_INSTANCING"
  1252. ],
  1253. "format": 44,
  1254. "isInstanced": true,
  1255. "location": 11
  1256. },
  1257. {
  1258. "name": "a_reflectionProbeData",
  1259. "defines": [
  1260. "USE_INSTANCING",
  1261. "CC_USE_REFLECTION_PROBE"
  1262. ],
  1263. "format": 44,
  1264. "isInstanced": true,
  1265. "location": 12
  1266. },
  1267. {
  1268. "name": "a_sh_linear_const_r",
  1269. "defines": [
  1270. "USE_INSTANCING",
  1271. "CC_USE_LIGHT_PROBE"
  1272. ],
  1273. "format": 44,
  1274. "isInstanced": true,
  1275. "location": 13
  1276. },
  1277. {
  1278. "name": "a_sh_linear_const_g",
  1279. "defines": [
  1280. "USE_INSTANCING",
  1281. "CC_USE_LIGHT_PROBE"
  1282. ],
  1283. "format": 44,
  1284. "isInstanced": true,
  1285. "location": 14
  1286. },
  1287. {
  1288. "name": "a_sh_linear_const_b",
  1289. "defines": [
  1290. "USE_INSTANCING",
  1291. "CC_USE_LIGHT_PROBE"
  1292. ],
  1293. "format": 44,
  1294. "isInstanced": true,
  1295. "location": 15
  1296. },
  1297. {
  1298. "name": "a_vertexId",
  1299. "defines": [
  1300. "CC_USE_MORPH"
  1301. ],
  1302. "format": 11,
  1303. "location": 16
  1304. }
  1305. ],
  1306. "varyings": [
  1307. {
  1308. "name": "v_uv",
  1309. "type": 14,
  1310. "count": 1,
  1311. "defines": [],
  1312. "stageFlags": 17,
  1313. "location": 0
  1314. }
  1315. ],
  1316. "fragColors": [
  1317. {
  1318. "name": "fragColor",
  1319. "typename": "vec4",
  1320. "type": 16,
  1321. "count": 1,
  1322. "defines": [],
  1323. "stageFlags": 16,
  1324. "location": 0
  1325. }
  1326. ],
  1327. "descriptors": [
  1328. {
  1329. "rate": 0,
  1330. "blocks": [],
  1331. "samplerTextures": [],
  1332. "samplers": [],
  1333. "textures": [],
  1334. "buffers": [],
  1335. "images": [],
  1336. "subpassInputs": []
  1337. },
  1338. {
  1339. "rate": 1,
  1340. "blocks": [
  1341. {
  1342. "name": "blurUBO",
  1343. "members": [
  1344. {
  1345. "name": "blurInfo",
  1346. "type": 16,
  1347. "count": 1
  1348. },
  1349. {
  1350. "name": "kernel",
  1351. "type": 16,
  1352. "count": 25
  1353. }
  1354. ],
  1355. "defines": [],
  1356. "stageFlags": 16,
  1357. "binding": 0
  1358. }
  1359. ],
  1360. "samplerTextures": [],
  1361. "samplers": [],
  1362. "textures": [],
  1363. "buffers": [],
  1364. "images": [],
  1365. "subpassInputs": []
  1366. },
  1367. {
  1368. "rate": 2,
  1369. "blocks": [],
  1370. "samplerTextures": [],
  1371. "samplers": [],
  1372. "textures": [],
  1373. "buffers": [],
  1374. "images": [],
  1375. "subpassInputs": []
  1376. },
  1377. {
  1378. "rate": 3,
  1379. "blocks": [
  1380. {
  1381. "tags": {
  1382. "builtin": "global"
  1383. },
  1384. "name": "CCGlobal",
  1385. "members": [
  1386. {
  1387. "name": "cc_time",
  1388. "typename": "vec4",
  1389. "type": 16,
  1390. "count": 1,
  1391. "precision": "highp "
  1392. },
  1393. {
  1394. "name": "cc_screenSize",
  1395. "typename": "vec4",
  1396. "type": 16,
  1397. "count": 1,
  1398. "precision": "mediump "
  1399. },
  1400. {
  1401. "name": "cc_nativeSize",
  1402. "typename": "vec4",
  1403. "type": 16,
  1404. "count": 1,
  1405. "precision": "mediump "
  1406. },
  1407. {
  1408. "name": "cc_probeInfo",
  1409. "typename": "vec4",
  1410. "type": 16,
  1411. "count": 1,
  1412. "precision": "mediump "
  1413. },
  1414. {
  1415. "name": "cc_debug_view_mode",
  1416. "typename": "vec4",
  1417. "type": 16,
  1418. "count": 1,
  1419. "precision": "mediump "
  1420. }
  1421. ],
  1422. "defines": [],
  1423. "stageFlags": 17
  1424. },
  1425. {
  1426. "tags": {
  1427. "builtin": "global"
  1428. },
  1429. "name": "CCCamera",
  1430. "members": [
  1431. {
  1432. "name": "cc_matView",
  1433. "typename": "mat4",
  1434. "type": 25,
  1435. "count": 1,
  1436. "precision": "highp "
  1437. },
  1438. {
  1439. "name": "cc_matViewInv",
  1440. "typename": "mat4",
  1441. "type": 25,
  1442. "count": 1,
  1443. "precision": "highp "
  1444. },
  1445. {
  1446. "name": "cc_matProj",
  1447. "typename": "mat4",
  1448. "type": 25,
  1449. "count": 1,
  1450. "precision": "highp "
  1451. },
  1452. {
  1453. "name": "cc_matProjInv",
  1454. "typename": "mat4",
  1455. "type": 25,
  1456. "count": 1,
  1457. "precision": "highp "
  1458. },
  1459. {
  1460. "name": "cc_matViewProj",
  1461. "typename": "mat4",
  1462. "type": 25,
  1463. "count": 1,
  1464. "precision": "highp "
  1465. },
  1466. {
  1467. "name": "cc_matViewProjInv",
  1468. "typename": "mat4",
  1469. "type": 25,
  1470. "count": 1,
  1471. "precision": "highp "
  1472. },
  1473. {
  1474. "name": "cc_cameraPos",
  1475. "typename": "vec4",
  1476. "type": 16,
  1477. "count": 1,
  1478. "precision": "highp "
  1479. },
  1480. {
  1481. "name": "cc_surfaceTransform",
  1482. "typename": "vec4",
  1483. "type": 16,
  1484. "count": 1,
  1485. "precision": "mediump "
  1486. },
  1487. {
  1488. "name": "cc_screenScale",
  1489. "typename": "vec4",
  1490. "type": 16,
  1491. "count": 1,
  1492. "precision": "mediump "
  1493. },
  1494. {
  1495. "name": "cc_exposure",
  1496. "typename": "vec4",
  1497. "type": 16,
  1498. "count": 1,
  1499. "precision": "mediump "
  1500. },
  1501. {
  1502. "name": "cc_mainLitDir",
  1503. "typename": "vec4",
  1504. "type": 16,
  1505. "count": 1,
  1506. "precision": "mediump "
  1507. },
  1508. {
  1509. "name": "cc_mainLitColor",
  1510. "typename": "vec4",
  1511. "type": 16,
  1512. "count": 1,
  1513. "precision": "mediump "
  1514. },
  1515. {
  1516. "name": "cc_ambientSky",
  1517. "typename": "vec4",
  1518. "type": 16,
  1519. "count": 1,
  1520. "precision": "mediump "
  1521. },
  1522. {
  1523. "name": "cc_ambientGround",
  1524. "typename": "vec4",
  1525. "type": 16,
  1526. "count": 1,
  1527. "precision": "mediump "
  1528. },
  1529. {
  1530. "name": "cc_fogColor",
  1531. "typename": "vec4",
  1532. "type": 16,
  1533. "count": 1,
  1534. "precision": "mediump "
  1535. },
  1536. {
  1537. "name": "cc_fogBase",
  1538. "typename": "vec4",
  1539. "type": 16,
  1540. "count": 1,
  1541. "precision": "mediump "
  1542. },
  1543. {
  1544. "name": "cc_fogAdd",
  1545. "typename": "vec4",
  1546. "type": 16,
  1547. "count": 1,
  1548. "precision": "mediump "
  1549. },
  1550. {
  1551. "name": "cc_nearFar",
  1552. "typename": "vec4",
  1553. "type": 16,
  1554. "count": 1,
  1555. "precision": "mediump "
  1556. },
  1557. {
  1558. "name": "cc_viewPort",
  1559. "typename": "vec4",
  1560. "type": 16,
  1561. "count": 1,
  1562. "precision": "mediump "
  1563. }
  1564. ],
  1565. "defines": [],
  1566. "stageFlags": 17
  1567. }
  1568. ],
  1569. "samplerTextures": [
  1570. {
  1571. "name": "colorTex",
  1572. "type": 28,
  1573. "count": 1,
  1574. "defines": [],
  1575. "stageFlags": 16,
  1576. "binding": 1
  1577. },
  1578. {
  1579. "name": "depthTex",
  1580. "type": 28,
  1581. "count": 1,
  1582. "defines": [],
  1583. "stageFlags": 16,
  1584. "binding": 2
  1585. }
  1586. ],
  1587. "samplers": [],
  1588. "textures": [],
  1589. "buffers": [],
  1590. "images": [],
  1591. "subpassInputs": []
  1592. }
  1593. ],
  1594. "hash": 1909312829,
  1595. "glsl4": {
  1596. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nlayout(location = 0) in vec3 a_position;\nlayout(location = 1) in vec3 a_normal;\nlayout(location = 2) in vec2 a_texCoord;\nlayout(location = 3) in vec4 a_tangent;\n#if CC_USE_SKINNING\n layout(location = 4) in u32vec4 a_joints;\n layout(location = 5) in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n layout(location = 6) in highp vec4 a_jointAnimInfo;\n #endif\n layout(location = 7) in vec4 a_matWorld0;\n layout(location = 8) in vec4 a_matWorld1;\n layout(location = 9) in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n layout(location = 10) in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n layout(location = 11) in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n layout(location = 12) in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n layout(location = 13) in vec4 a_sh_linear_const_r;\n layout(location = 14) in vec4 a_sh_linear_const_g;\n layout(location = 15) in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n#endif\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nlayout(location = 0) out vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  1597. "frag": "\nprecision highp float;\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\nvec2 saturate(vec2 value) { return clamp(value, vec2(0.0), vec2(1.0)); }\nvec3 saturate(vec3 value) { return clamp(value, vec3(0.0), vec3(1.0)); }\nvec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nvec3 SRGBToLinear (vec3 gamma) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return gamma;\n }\n #endif\n#endif\n return gamma * gamma;\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\n#if defined(CC_USE_METAL) || defined(CC_USE_WGPU)\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y) y = -y\n#else\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y)\n#endif\nfloat GetCameraDepthRH(float depthHS, mat4 matProj)\n{\n return -matProj[3][2] / (depthHS + matProj[2][2]);\n}\nfloat GetCameraDepthRH(float depthHS, float matProj32, float matProj22)\n{\n return -matProj32 / (depthHS + matProj22);\n}\nlayout(set = 1, binding = 0) uniform blurUBO {\n highp vec4 blurInfo;\n highp vec4 kernel[25];\n};\nlayout(set = 1, binding = 1) uniform sampler2D colorTex;\nlayout(set = 1, binding = 2) uniform sampler2D depthTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nvec4 blur(vec2 texcoord, vec2 dir) {\n float ssssFov = blurInfo.x;\n float ssssWidth = blurInfo.y;\n float boundingBox = blurInfo.z;\n float depthUnitScale = boundingBox * blurInfo.w;\n vec4 colorM = texture(colorTex, texcoord);\n #if !CC_USE_HDR\n colorM = vec4(LinearToSRGB(colorM.rgb), colorM.a);\n #endif\n float threshold = 0.9, rangeScale = 1.0 / 0.9;\n float SSSS_STRENGTH_SOURCE = colorM.a > threshold ? 0.0 : colorM.a * rangeScale;\n #define SSSS_STRENGTH_SOURCE_INLOOP (color.a > threshold ? 0.0 : color.a * rangeScale)\n float depthHS = dot(texture(depthTex, texcoord), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depthM = -GetCameraDepthRH(depthHS, cc_matProj);\n float distanceToProjectionWindow = 1.0 / tan(0.5 * ssssFov);\n float scale = distanceToProjectionWindow / depthM * depthUnitScale;\n vec2 finalStep = vec2(ssssWidth) * vec2(scale) * dir;\n finalStep *= vec2(SSSS_STRENGTH_SOURCE);\n finalStep *= vec2(1.0 / (25 > 20 ? 3.0 : 2.0));\n vec4 colorBlurred = colorM;\n colorBlurred.rgb *= kernel[0].rgb;\n for (int i = 1; i < 25; i++) {\n vec2 offset = texcoord + vec2(kernel[i].a) * finalStep;\n vec4 color = texture(colorTex, fixUV(offset));\n #if !CC_USE_HDR\n color = vec4(LinearToSRGB(color.rgb), color.a);\n #endif\n float depthHS = dot(texture(depthTex, fixUV(offset)), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depth = -GetCameraDepthRH(depthHS, cc_matProj);\n float s = saturate(100.0 / depthUnitScale * distanceToProjectionWindow * ssssWidth * abs(depthM - depth));\n color.rgb = mix(color.rgb, colorM.rgb, s);\n colorBlurred.rgb += kernel[i].rgb * mix(colorM.rgb, color.rgb, SSSS_STRENGTH_SOURCE_INLOOP);\n }\n #if !CC_USE_HDR\n colorBlurred = vec4(SRGBToLinear(colorBlurred.rgb), colorBlurred.a);\n #endif\n return colorBlurred;\n}\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main() {\n fragColor = vec4(blur(v_uv, vec2(0.0, 1.0)).rgb, 1.0);\n}"
  1598. },
  1599. "glsl3": {
  1600. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nin vec3 a_position;\nin vec3 a_normal;\nin vec2 a_texCoord;\nin vec4 a_tangent;\n#if CC_USE_SKINNING\n in vec4 a_joints;\n in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n in highp vec4 a_jointAnimInfo;\n #endif\n in vec4 a_matWorld0;\n in vec4 a_matWorld1;\n in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n in vec4 a_sh_linear_const_r;\n in vec4 a_sh_linear_const_g;\n in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n in float a_vertexId;\n#endif\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nout vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  1601. "frag": "\nprecision highp float;\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\nvec2 saturate(vec2 value) { return clamp(value, vec2(0.0), vec2(1.0)); }\nvec3 saturate(vec3 value) { return clamp(value, vec3(0.0), vec3(1.0)); }\nvec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nvec3 SRGBToLinear (vec3 gamma) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return gamma;\n }\n #endif\n#endif\n return gamma * gamma;\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\n#if defined(CC_USE_METAL) || defined(CC_USE_WGPU)\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y) y = -y\n#else\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y)\n#endif\nfloat GetCameraDepthRH(float depthHS, mat4 matProj)\n{\n return -matProj[3][2] / (depthHS + matProj[2][2]);\n}\nfloat GetCameraDepthRH(float depthHS, float matProj32, float matProj22)\n{\n return -matProj32 / (depthHS + matProj22);\n}\nlayout(std140) uniform blurUBO {\n highp vec4 blurInfo;\n highp vec4 kernel[25];\n};\nuniform sampler2D colorTex;\nuniform sampler2D depthTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nvec4 blur(vec2 texcoord, vec2 dir) {\n float ssssFov = blurInfo.x;\n float ssssWidth = blurInfo.y;\n float boundingBox = blurInfo.z;\n float depthUnitScale = boundingBox * blurInfo.w;\n vec4 colorM = texture(colorTex, texcoord);\n #if !CC_USE_HDR\n colorM = vec4(LinearToSRGB(colorM.rgb), colorM.a);\n #endif\n float threshold = 0.9, rangeScale = 1.0 / 0.9;\n float SSSS_STRENGTH_SOURCE = colorM.a > threshold ? 0.0 : colorM.a * rangeScale;\n #define SSSS_STRENGTH_SOURCE_INLOOP (color.a > threshold ? 0.0 : color.a * rangeScale)\n float depthHS = dot(texture(depthTex, texcoord), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depthM = -GetCameraDepthRH(depthHS, cc_matProj);\n float distanceToProjectionWindow = 1.0 / tan(0.5 * ssssFov);\n float scale = distanceToProjectionWindow / depthM * depthUnitScale;\n vec2 finalStep = vec2(ssssWidth) * vec2(scale) * dir;\n finalStep *= vec2(SSSS_STRENGTH_SOURCE);\n finalStep *= vec2(1.0 / (25 > 20 ? 3.0 : 2.0));\n vec4 colorBlurred = colorM;\n colorBlurred.rgb *= kernel[0].rgb;\n for (int i = 1; i < 25; i++) {\n vec2 offset = texcoord + vec2(kernel[i].a) * finalStep;\n vec4 color = texture(colorTex, fixUV(offset));\n #if !CC_USE_HDR\n color = vec4(LinearToSRGB(color.rgb), color.a);\n #endif\n float depthHS = dot(texture(depthTex, fixUV(offset)), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depth = -GetCameraDepthRH(depthHS, cc_matProj);\n float s = saturate(100.0 / depthUnitScale * distanceToProjectionWindow * ssssWidth * abs(depthM - depth));\n color.rgb = mix(color.rgb, colorM.rgb, s);\n colorBlurred.rgb += kernel[i].rgb * mix(colorM.rgb, color.rgb, SSSS_STRENGTH_SOURCE_INLOOP);\n }\n #if !CC_USE_HDR\n colorBlurred = vec4(SRGBToLinear(colorBlurred.rgb), colorBlurred.a);\n #endif\n return colorBlurred;\n}\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main() {\n fragColor = vec4(blur(v_uv, vec2(0.0, 1.0)).rgb, 1.0);\n}"
  1602. },
  1603. "glsl1": {
  1604. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nattribute vec3 a_position;\nattribute vec3 a_normal;\nattribute vec2 a_texCoord;\nattribute vec4 a_tangent;\n#if CC_USE_SKINNING\n attribute vec4 a_joints;\n attribute vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n attribute highp vec4 a_jointAnimInfo;\n #endif\n attribute vec4 a_matWorld0;\n attribute vec4 a_matWorld1;\n attribute vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n attribute vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n attribute vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n attribute vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n attribute vec4 a_sh_linear_const_r;\n attribute vec4 a_sh_linear_const_g;\n attribute vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n attribute float a_vertexId;\n#endif\nuniform highp vec4 cc_cameraPos;\nvarying vec2 v_uv;\nvoid main () {\n StandardVertInput In;\n In.position = vec4(a_position, 1.0);\n In.normal = a_normal;\n In.tangent = a_tangent;\n In.position.xy = cc_cameraPos.w == 0.0 ? vec2(In.position.xy.x, -In.position.xy.y) : In.position.xy;\n gl_Position = In.position;\n v_uv = a_texCoord;\n}",
  1605. "frag": "\nprecision highp float;\nuniform highp mat4 cc_matProj;\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\nvec2 saturate(vec2 value) { return clamp(value, vec2(0.0), vec2(1.0)); }\nvec3 saturate(vec3 value) { return clamp(value, vec3(0.0), vec3(1.0)); }\nvec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\n#define UnpackBitFromFloat(value, bit) (mod(floor(value / pow(10.0, float(bit))), 10.0) > 0.0)\nvec3 SRGBToLinear (vec3 gamma) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return gamma;\n }\n #endif\n#endif\n return gamma * gamma;\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\n#if defined(CC_USE_METAL) || defined(CC_USE_WGPU)\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y) y = -y\n#else\n#define CC_HANDLE_SAMPLE_NDC_FLIP_STATIC(y)\n#endif\nfloat GetCameraDepthRH(float depthHS, mat4 matProj)\n{\n return -matProj[3][2] / (depthHS + matProj[2][2]);\n}\nfloat GetCameraDepthRH(float depthHS, float matProj32, float matProj22)\n{\n return -matProj32 / (depthHS + matProj22);\n}\n uniform highp vec4 blurInfo;\n uniform highp vec4 kernel[25];\nuniform sampler2D colorTex;\nuniform sampler2D depthTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nvec4 blur(vec2 texcoord, vec2 dir) {\n float ssssFov = blurInfo.x;\n float ssssWidth = blurInfo.y;\n float boundingBox = blurInfo.z;\n float depthUnitScale = boundingBox * blurInfo.w;\n vec4 colorM = texture2D(colorTex, texcoord);\n #if !CC_USE_HDR\n colorM = vec4(LinearToSRGB(colorM.rgb), colorM.a);\n #endif\n float threshold = 0.9, rangeScale = 1.0 / 0.9;\n float SSSS_STRENGTH_SOURCE = colorM.a > threshold ? 0.0 : colorM.a * rangeScale;\n #define SSSS_STRENGTH_SOURCE_INLOOP (color.a > threshold ? 0.0 : color.a * rangeScale)\n float depthHS = dot(texture2D(depthTex, texcoord), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depthM = -GetCameraDepthRH(depthHS, cc_matProj);\n float distanceToProjectionWindow = 1.0 / tan(0.5 * ssssFov);\n float scale = distanceToProjectionWindow / depthM * depthUnitScale;\n vec2 finalStep = vec2(ssssWidth) * vec2(scale) * dir;\n finalStep *= vec2(SSSS_STRENGTH_SOURCE);\n finalStep *= vec2(1.0 / (25 > 20 ? 3.0 : 2.0));\n vec4 colorBlurred = colorM;\n colorBlurred.rgb *= kernel[0].rgb;\n for (int i = 1; i < 25; i++) {\n vec2 offset = texcoord + vec2(kernel[i].a) * finalStep;\n vec4 color = texture2D(colorTex, fixUV(offset));\n #if !CC_USE_HDR\n color = vec4(LinearToSRGB(color.rgb), color.a);\n #endif\n float depthHS = dot(texture2D(depthTex, fixUV(offset)), vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)) * 2.0 - 1.0;\n float depth = -GetCameraDepthRH(depthHS, cc_matProj);\n float s = saturate(100.0 / depthUnitScale * distanceToProjectionWindow * ssssWidth * abs(depthM - depth));\n color.rgb = mix(color.rgb, colorM.rgb, s);\n colorBlurred.rgb += kernel[i].rgb * mix(colorM.rgb, color.rgb, SSSS_STRENGTH_SOURCE_INLOOP);\n }\n #if !CC_USE_HDR\n colorBlurred = vec4(SRGBToLinear(colorBlurred.rgb), colorBlurred.a);\n #endif\n return colorBlurred;\n}\nvarying vec2 v_uv;\nvoid main() {\n gl_FragColor = vec4(blur(v_uv, vec2(0.0, 1.0)).rgb, 1.0);\n}"
  1606. },
  1607. "builtins": {
  1608. "globals": {
  1609. "blocks": [
  1610. {
  1611. "name": "CCGlobal",
  1612. "defines": []
  1613. },
  1614. {
  1615. "name": "CCCamera",
  1616. "defines": []
  1617. }
  1618. ],
  1619. "samplerTextures": [],
  1620. "buffers": [],
  1621. "images": []
  1622. },
  1623. "locals": {
  1624. "blocks": [],
  1625. "samplerTextures": [],
  1626. "buffers": [],
  1627. "images": []
  1628. },
  1629. "statistics": {
  1630. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  1631. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 68
  1632. }
  1633. },
  1634. "defines": [
  1635. {
  1636. "name": "USE_INSTANCING",
  1637. "type": "boolean",
  1638. "defines": [],
  1639. "editor": {
  1640. "elevated": true
  1641. }
  1642. },
  1643. {
  1644. "name": "CC_USE_SKINNING",
  1645. "type": "boolean",
  1646. "defines": []
  1647. },
  1648. {
  1649. "name": "CC_USE_BAKED_ANIMATION",
  1650. "type": "boolean",
  1651. "defines": [
  1652. "USE_INSTANCING"
  1653. ]
  1654. },
  1655. {
  1656. "name": "CC_USE_LIGHTMAP",
  1657. "type": "boolean",
  1658. "defines": [
  1659. "USE_INSTANCING"
  1660. ]
  1661. },
  1662. {
  1663. "name": "CC_USE_REFLECTION_PROBE",
  1664. "type": "boolean",
  1665. "defines": [
  1666. "USE_INSTANCING"
  1667. ]
  1668. },
  1669. {
  1670. "name": "CC_RECEIVE_SHADOW",
  1671. "type": "boolean",
  1672. "defines": [
  1673. "USE_INSTANCING"
  1674. ]
  1675. },
  1676. {
  1677. "name": "CC_USE_LIGHT_PROBE",
  1678. "type": "boolean",
  1679. "defines": [
  1680. "USE_INSTANCING"
  1681. ]
  1682. },
  1683. {
  1684. "name": "CC_USE_MORPH",
  1685. "type": "boolean",
  1686. "defines": []
  1687. },
  1688. {
  1689. "name": "CC_USE_DEBUG_VIEW",
  1690. "type": "number",
  1691. "defines": [],
  1692. "range": [
  1693. 0,
  1694. 3
  1695. ]
  1696. },
  1697. {
  1698. "name": "CC_SURFACES_ENABLE_DEBUG_VIEW",
  1699. "type": "boolean",
  1700. "defines": [
  1701. "CC_USE_DEBUG_VIEW",
  1702. "CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC"
  1703. ]
  1704. },
  1705. {
  1706. "name": "CC_USE_HDR",
  1707. "type": "boolean",
  1708. "defines": []
  1709. }
  1710. ],
  1711. "name": "pipeline/ssss-blur|blur-vs|ssssBlurY-fs"
  1712. }
  1713. ],
  1714. "combinations": [],
  1715. "hideInEditor": false
  1716. }