bf0a6d94-58f0-4ad2-bdf2-c4a31c7dd856.json 193 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "pipeline/post-process/dof",
  4. "_objFlags": 0,
  5. "__editorExtras__": {},
  6. "_native": "",
  7. "techniques": [
  8. {
  9. "passes": [
  10. {
  11. "pass": "dof-coc",
  12. "program": "pipeline/post-process/dof|dof-vs|dof-coc-fs",
  13. "depthStencilState": {
  14. "depthTest": false,
  15. "depthWrite": false
  16. }
  17. },
  18. {
  19. "pass": "dof-prefilter",
  20. "program": "pipeline/post-process/dof|dof-vs|dof-prefilter-fs",
  21. "depthStencilState": {
  22. "depthTest": false,
  23. "depthWrite": false
  24. }
  25. },
  26. {
  27. "pass": "dof-bokeh",
  28. "program": "pipeline/post-process/dof|dof-vs|dof-bokeh-fs",
  29. "depthStencilState": {
  30. "depthTest": false,
  31. "depthWrite": false
  32. }
  33. },
  34. {
  35. "pass": "dof-filter",
  36. "program": "pipeline/post-process/dof|dof-vs|dof-filter-fs",
  37. "depthStencilState": {
  38. "depthTest": false,
  39. "depthWrite": false
  40. }
  41. },
  42. {
  43. "pass": "dof-combine",
  44. "program": "pipeline/post-process/dof|dof-vs|dof-combine-fs",
  45. "depthStencilState": {
  46. "depthTest": false,
  47. "depthWrite": false
  48. }
  49. }
  50. ],
  51. "blendState": {
  52. "targets": [
  53. {
  54. "blend": true,
  55. "blendSrc": "zero",
  56. "blendDst": "src_alpha",
  57. "blendSrcAlpha": "zero",
  58. "blendDstAlpha": "one"
  59. }
  60. ]
  61. }
  62. }
  63. ],
  64. "shaders": [
  65. {
  66. "blocks": [
  67. {
  68. "name": "ColorGradingUBO",
  69. "members": [
  70. {
  71. "name": "cocParams",
  72. "type": 16,
  73. "count": 1
  74. },
  75. {
  76. "name": "mainTexTexelSize",
  77. "type": 16,
  78. "count": 1
  79. }
  80. ],
  81. "defines": [],
  82. "stageFlags": 16,
  83. "binding": 0
  84. },
  85. {
  86. "name": "hbaoUBO",
  87. "members": [
  88. {
  89. "name": "uvDepthToEyePosParams",
  90. "type": 16,
  91. "count": 1
  92. },
  93. {
  94. "name": "radiusParam",
  95. "type": 16,
  96. "count": 1
  97. },
  98. {
  99. "name": "miscParam",
  100. "type": 16,
  101. "count": 1
  102. },
  103. {
  104. "name": "randomTexSize",
  105. "type": 16,
  106. "count": 1
  107. },
  108. {
  109. "name": "blurParam",
  110. "type": 16,
  111. "count": 1
  112. }
  113. ],
  114. "defines": [],
  115. "stageFlags": 16,
  116. "binding": 1
  117. }
  118. ],
  119. "samplerTextures": [
  120. {
  121. "name": "RandomTex",
  122. "type": 28,
  123. "count": 1,
  124. "defines": [],
  125. "stageFlags": 16,
  126. "binding": 8
  127. }
  128. ],
  129. "samplers": [],
  130. "textures": [],
  131. "buffers": [],
  132. "images": [],
  133. "subpassInputs": [],
  134. "attributes": [
  135. {
  136. "name": "a_position",
  137. "defines": [],
  138. "format": 32,
  139. "location": 0
  140. },
  141. {
  142. "name": "a_normal",
  143. "defines": [],
  144. "format": 32,
  145. "location": 1
  146. },
  147. {
  148. "name": "a_texCoord",
  149. "defines": [],
  150. "format": 21,
  151. "location": 2
  152. },
  153. {
  154. "name": "a_tangent",
  155. "defines": [],
  156. "format": 44,
  157. "location": 3
  158. },
  159. {
  160. "name": "a_joints",
  161. "defines": [
  162. "CC_USE_SKINNING"
  163. ],
  164. "location": 4
  165. },
  166. {
  167. "name": "a_weights",
  168. "defines": [
  169. "CC_USE_SKINNING"
  170. ],
  171. "format": 44,
  172. "location": 5
  173. },
  174. {
  175. "name": "a_jointAnimInfo",
  176. "defines": [
  177. "USE_INSTANCING",
  178. "CC_USE_BAKED_ANIMATION"
  179. ],
  180. "format": 44,
  181. "isInstanced": true,
  182. "location": 6
  183. },
  184. {
  185. "name": "a_matWorld0",
  186. "defines": [
  187. "USE_INSTANCING"
  188. ],
  189. "format": 44,
  190. "isInstanced": true,
  191. "location": 7
  192. },
  193. {
  194. "name": "a_matWorld1",
  195. "defines": [
  196. "USE_INSTANCING"
  197. ],
  198. "format": 44,
  199. "isInstanced": true,
  200. "location": 8
  201. },
  202. {
  203. "name": "a_matWorld2",
  204. "defines": [
  205. "USE_INSTANCING"
  206. ],
  207. "format": 44,
  208. "isInstanced": true,
  209. "location": 9
  210. },
  211. {
  212. "name": "a_lightingMapUVParam",
  213. "defines": [
  214. "USE_INSTANCING",
  215. "CC_USE_LIGHTMAP"
  216. ],
  217. "format": 44,
  218. "isInstanced": true,
  219. "location": 10
  220. },
  221. {
  222. "name": "a_localShadowBiasAndProbeId",
  223. "defines": [
  224. "USE_INSTANCING"
  225. ],
  226. "format": 44,
  227. "isInstanced": true,
  228. "location": 11
  229. },
  230. {
  231. "name": "a_reflectionProbeData",
  232. "defines": [
  233. "USE_INSTANCING",
  234. "CC_USE_REFLECTION_PROBE"
  235. ],
  236. "format": 44,
  237. "isInstanced": true,
  238. "location": 12
  239. },
  240. {
  241. "name": "a_sh_linear_const_r",
  242. "defines": [
  243. "USE_INSTANCING",
  244. "CC_USE_LIGHT_PROBE"
  245. ],
  246. "format": 44,
  247. "isInstanced": true,
  248. "location": 13
  249. },
  250. {
  251. "name": "a_sh_linear_const_g",
  252. "defines": [
  253. "USE_INSTANCING",
  254. "CC_USE_LIGHT_PROBE"
  255. ],
  256. "format": 44,
  257. "isInstanced": true,
  258. "location": 14
  259. },
  260. {
  261. "name": "a_sh_linear_const_b",
  262. "defines": [
  263. "USE_INSTANCING",
  264. "CC_USE_LIGHT_PROBE"
  265. ],
  266. "format": 44,
  267. "isInstanced": true,
  268. "location": 15
  269. },
  270. {
  271. "name": "a_vertexId",
  272. "defines": [
  273. "CC_USE_MORPH"
  274. ],
  275. "format": 11,
  276. "location": 16
  277. }
  278. ],
  279. "varyings": [
  280. {
  281. "name": "v_uv",
  282. "type": 14,
  283. "count": 1,
  284. "defines": [],
  285. "stageFlags": 17,
  286. "location": 0
  287. }
  288. ],
  289. "fragColors": [
  290. {
  291. "name": "fragColor",
  292. "typename": "vec4",
  293. "type": 16,
  294. "count": 1,
  295. "defines": [],
  296. "stageFlags": 16,
  297. "location": 0
  298. }
  299. ],
  300. "descriptors": [
  301. {
  302. "rate": 0,
  303. "blocks": [],
  304. "samplerTextures": [],
  305. "samplers": [],
  306. "textures": [],
  307. "buffers": [],
  308. "images": [],
  309. "subpassInputs": []
  310. },
  311. {
  312. "rate": 1,
  313. "blocks": [
  314. {
  315. "name": "ColorGradingUBO",
  316. "members": [
  317. {
  318. "name": "cocParams",
  319. "type": 16,
  320. "count": 1
  321. },
  322. {
  323. "name": "mainTexTexelSize",
  324. "type": 16,
  325. "count": 1
  326. }
  327. ],
  328. "defines": [],
  329. "stageFlags": 16,
  330. "binding": 0
  331. },
  332. {
  333. "name": "hbaoUBO",
  334. "members": [
  335. {
  336. "name": "uvDepthToEyePosParams",
  337. "type": 16,
  338. "count": 1
  339. },
  340. {
  341. "name": "radiusParam",
  342. "type": 16,
  343. "count": 1
  344. },
  345. {
  346. "name": "miscParam",
  347. "type": 16,
  348. "count": 1
  349. },
  350. {
  351. "name": "randomTexSize",
  352. "type": 16,
  353. "count": 1
  354. },
  355. {
  356. "name": "blurParam",
  357. "type": 16,
  358. "count": 1
  359. }
  360. ],
  361. "defines": [],
  362. "stageFlags": 16,
  363. "binding": 1
  364. }
  365. ],
  366. "samplerTextures": [
  367. {
  368. "name": "RandomTex",
  369. "type": 28,
  370. "count": 1,
  371. "defines": [],
  372. "stageFlags": 16,
  373. "binding": 8
  374. }
  375. ],
  376. "samplers": [],
  377. "textures": [],
  378. "buffers": [],
  379. "images": [],
  380. "subpassInputs": []
  381. },
  382. {
  383. "rate": 2,
  384. "blocks": [],
  385. "samplerTextures": [],
  386. "samplers": [],
  387. "textures": [],
  388. "buffers": [],
  389. "images": [],
  390. "subpassInputs": []
  391. },
  392. {
  393. "rate": 3,
  394. "blocks": [
  395. {
  396. "tags": {
  397. "builtin": "global"
  398. },
  399. "name": "CCGlobal",
  400. "members": [
  401. {
  402. "name": "cc_time",
  403. "typename": "vec4",
  404. "type": 16,
  405. "count": 1,
  406. "precision": "highp "
  407. },
  408. {
  409. "name": "cc_screenSize",
  410. "typename": "vec4",
  411. "type": 16,
  412. "count": 1,
  413. "precision": "mediump "
  414. },
  415. {
  416. "name": "cc_nativeSize",
  417. "typename": "vec4",
  418. "type": 16,
  419. "count": 1,
  420. "precision": "mediump "
  421. },
  422. {
  423. "name": "cc_probeInfo",
  424. "typename": "vec4",
  425. "type": 16,
  426. "count": 1,
  427. "precision": "mediump "
  428. },
  429. {
  430. "name": "cc_debug_view_mode",
  431. "typename": "vec4",
  432. "type": 16,
  433. "count": 1,
  434. "precision": "mediump "
  435. }
  436. ],
  437. "defines": [],
  438. "stageFlags": 17
  439. },
  440. {
  441. "tags": {
  442. "builtin": "global"
  443. },
  444. "name": "CCCamera",
  445. "members": [
  446. {
  447. "name": "cc_matView",
  448. "typename": "mat4",
  449. "type": 25,
  450. "count": 1,
  451. "precision": "highp "
  452. },
  453. {
  454. "name": "cc_matViewInv",
  455. "typename": "mat4",
  456. "type": 25,
  457. "count": 1,
  458. "precision": "highp "
  459. },
  460. {
  461. "name": "cc_matProj",
  462. "typename": "mat4",
  463. "type": 25,
  464. "count": 1,
  465. "precision": "highp "
  466. },
  467. {
  468. "name": "cc_matProjInv",
  469. "typename": "mat4",
  470. "type": 25,
  471. "count": 1,
  472. "precision": "highp "
  473. },
  474. {
  475. "name": "cc_matViewProj",
  476. "typename": "mat4",
  477. "type": 25,
  478. "count": 1,
  479. "precision": "highp "
  480. },
  481. {
  482. "name": "cc_matViewProjInv",
  483. "typename": "mat4",
  484. "type": 25,
  485. "count": 1,
  486. "precision": "highp "
  487. },
  488. {
  489. "name": "cc_cameraPos",
  490. "typename": "vec4",
  491. "type": 16,
  492. "count": 1,
  493. "precision": "highp "
  494. },
  495. {
  496. "name": "cc_surfaceTransform",
  497. "typename": "vec4",
  498. "type": 16,
  499. "count": 1,
  500. "precision": "mediump "
  501. },
  502. {
  503. "name": "cc_screenScale",
  504. "typename": "vec4",
  505. "type": 16,
  506. "count": 1,
  507. "precision": "mediump "
  508. },
  509. {
  510. "name": "cc_exposure",
  511. "typename": "vec4",
  512. "type": 16,
  513. "count": 1,
  514. "precision": "mediump "
  515. },
  516. {
  517. "name": "cc_mainLitDir",
  518. "typename": "vec4",
  519. "type": 16,
  520. "count": 1,
  521. "precision": "mediump "
  522. },
  523. {
  524. "name": "cc_mainLitColor",
  525. "typename": "vec4",
  526. "type": 16,
  527. "count": 1,
  528. "precision": "mediump "
  529. },
  530. {
  531. "name": "cc_ambientSky",
  532. "typename": "vec4",
  533. "type": 16,
  534. "count": 1,
  535. "precision": "mediump "
  536. },
  537. {
  538. "name": "cc_ambientGround",
  539. "typename": "vec4",
  540. "type": 16,
  541. "count": 1,
  542. "precision": "mediump "
  543. },
  544. {
  545. "name": "cc_fogColor",
  546. "typename": "vec4",
  547. "type": 16,
  548. "count": 1,
  549. "precision": "mediump "
  550. },
  551. {
  552. "name": "cc_fogBase",
  553. "typename": "vec4",
  554. "type": 16,
  555. "count": 1,
  556. "precision": "mediump "
  557. },
  558. {
  559. "name": "cc_fogAdd",
  560. "typename": "vec4",
  561. "type": 16,
  562. "count": 1,
  563. "precision": "mediump "
  564. },
  565. {
  566. "name": "cc_nearFar",
  567. "typename": "vec4",
  568. "type": 16,
  569. "count": 1,
  570. "precision": "mediump "
  571. },
  572. {
  573. "name": "cc_viewPort",
  574. "typename": "vec4",
  575. "type": 16,
  576. "count": 1,
  577. "precision": "mediump "
  578. }
  579. ],
  580. "defines": [],
  581. "stageFlags": 17
  582. }
  583. ],
  584. "samplerTextures": [
  585. {
  586. "name": "colorTex",
  587. "type": 28,
  588. "count": 1,
  589. "defines": [],
  590. "stageFlags": 16,
  591. "binding": 2
  592. },
  593. {
  594. "name": "cocTex",
  595. "type": 28,
  596. "count": 1,
  597. "defines": [],
  598. "stageFlags": 16,
  599. "binding": 3
  600. },
  601. {
  602. "name": "prefilterTex",
  603. "type": 28,
  604. "count": 1,
  605. "defines": [],
  606. "stageFlags": 16,
  607. "binding": 4
  608. },
  609. {
  610. "name": "bokehTex",
  611. "type": 28,
  612. "count": 1,
  613. "defines": [],
  614. "stageFlags": 16,
  615. "binding": 5
  616. },
  617. {
  618. "name": "filterTex",
  619. "type": 28,
  620. "count": 1,
  621. "defines": [],
  622. "stageFlags": 16,
  623. "binding": 6
  624. },
  625. {
  626. "name": "DepthTex",
  627. "type": 28,
  628. "count": 1,
  629. "defines": [],
  630. "stageFlags": 16,
  631. "binding": 7
  632. },
  633. {
  634. "name": "AOTexNearest",
  635. "type": 28,
  636. "count": 1,
  637. "defines": [],
  638. "stageFlags": 16,
  639. "binding": 9
  640. }
  641. ],
  642. "samplers": [],
  643. "textures": [],
  644. "buffers": [],
  645. "images": [],
  646. "subpassInputs": []
  647. }
  648. ],
  649. "hash": 154327422,
  650. "glsl4": {
  651. "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}",
  652. "frag": "\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\nlayout(set = 1, binding = 0) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nlayout(set = 1, binding = 2) uniform sampler2D colorTex;\nlayout(set = 1, binding = 3) uniform sampler2D cocTex;\nlayout(set = 1, binding = 4) uniform sampler2D prefilterTex;\nlayout(set = 1, binding = 5) uniform sampler2D bokehTex;\nlayout(set = 1, binding = 6) uniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat FloatToUint8(float v) {\n return (v * 127.0 + 128.0 + 0.5) / 255.0;\n}\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};\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#if CC_USE_FOG != 4\n#endif\nlayout(set = 1, binding = 1) uniform hbaoUBO {\n vec4 uvDepthToEyePosParams;\n vec4 radiusParam;\n vec4 miscParam;\n vec4 randomTexSize;\n vec4 blurParam;\n};\n#define NUM_STEPS 8.0\n#define NUM_STEPS_LOOP NUM_STEPS*2.0\n#define INV_NUM_DIRECTIONS 0.125\n#define NUM_DIRECTIONS 8\n#define CONSTANT_2PI 6.2831852\n#define g_AOResolution cc_screenSize.xy\n#define g_InvAOResolution cc_screenSize.zw\n#define g_UVToViewA uvDepthToEyePosParams.xy\n#define g_UVToViewB uvDepthToEyePosParams.zw\n#define g_R radiusParam.x\n#define g_R2 radiusParam.y\n#define g_NegInvR2 radiusParam.z\n#define g_MaxRadiusPixels radiusParam.w\n#define g_FocalLen miscParam.xy\n#define g_TanAngleBias miscParam.z\n#define g_Strength miscParam.w\nlayout(set = 1, binding = 7) uniform sampler2D DepthTex;\nlayout(set = 1, binding = 8) uniform sampler2D RandomTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nfloat GetLinearDepth(vec2 uv) {\n float depthHS = texture(DepthTex, fixUV(uv)).r * 2.0 - 1.0;\n return -GetCameraDepthRH(depthHS, cc_matProj);\n}\n#define KERNEL_FALLOFF 3.0f\n#define KERNEL_RADIUS 8\n#define HALF_KERNEL_RADIUS 4\n#define g_InvFullResolution cc_screenSize.zw\n#define g_BlurFallOff blurParam.x\n#define g_BlurDepthThreshold blurParam.y\n#define g_BlurSimpleRadius blurParam.z\nlayout(set = 1, binding = 9) uniform sampler2D AOTexNearest;\n#define AOTexBilinear AOTexNearest\n#define GetLinearDepthBilinear GetLinearDepth\n#define g_AOSaturation blurParam.w\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main () {\n float depth = GetLinearDepth(v_uv);\n float coc = (depth - focusDistance) / focusRange;\n coc = clamp(coc, -1.0, 1.0);\n fragColor = vec4(FloatToUint8(coc), 0.0, 0.0, 1.0);\n}"
  653. },
  654. "glsl3": {
  655. "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}",
  656. "frag": "\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\nlayout(std140) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat FloatToUint8(float v) {\n return (v * 127.0 + 128.0 + 0.5) / 255.0;\n}\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};\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#if CC_USE_FOG != 4\n#endif\nlayout(std140) uniform hbaoUBO {\n vec4 uvDepthToEyePosParams;\n vec4 radiusParam;\n vec4 miscParam;\n vec4 randomTexSize;\n vec4 blurParam;\n};\n#define NUM_STEPS 8.0\n#define NUM_STEPS_LOOP NUM_STEPS*2.0\n#define INV_NUM_DIRECTIONS 0.125\n#define NUM_DIRECTIONS 8\n#define CONSTANT_2PI 6.2831852\n#define g_AOResolution cc_screenSize.xy\n#define g_InvAOResolution cc_screenSize.zw\n#define g_UVToViewA uvDepthToEyePosParams.xy\n#define g_UVToViewB uvDepthToEyePosParams.zw\n#define g_R radiusParam.x\n#define g_R2 radiusParam.y\n#define g_NegInvR2 radiusParam.z\n#define g_MaxRadiusPixels radiusParam.w\n#define g_FocalLen miscParam.xy\n#define g_TanAngleBias miscParam.z\n#define g_Strength miscParam.w\nuniform sampler2D DepthTex;\nuniform sampler2D RandomTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nfloat GetLinearDepth(vec2 uv) {\n float depthHS = texture(DepthTex, fixUV(uv)).r * 2.0 - 1.0;\n return -GetCameraDepthRH(depthHS, cc_matProj);\n}\n#define KERNEL_FALLOFF 3.0f\n#define KERNEL_RADIUS 8\n#define HALF_KERNEL_RADIUS 4\n#define g_InvFullResolution cc_screenSize.zw\n#define g_BlurFallOff blurParam.x\n#define g_BlurDepthThreshold blurParam.y\n#define g_BlurSimpleRadius blurParam.z\nuniform sampler2D AOTexNearest;\n#define AOTexBilinear AOTexNearest\n#define GetLinearDepthBilinear GetLinearDepth\n#define g_AOSaturation blurParam.w\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main () {\n float depth = GetLinearDepth(v_uv);\n float coc = (depth - focusDistance) / focusRange;\n coc = clamp(coc, -1.0, 1.0);\n fragColor = vec4(FloatToUint8(coc), 0.0, 0.0, 1.0);\n}"
  657. },
  658. "glsl1": {
  659. "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}",
  660. "frag": "\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 uniform vec4 cocParams;\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat FloatToUint8(float v) {\n return (v * 127.0 + 128.0 + 0.5) / 255.0;\n}\nprecision highp float;\nuniform mediump vec4 cc_screenSize;\nuniform highp mat4 cc_matProj;\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#if CC_USE_FOG != 4\n#endif\n uniform vec4 uvDepthToEyePosParams;\n uniform vec4 radiusParam;\n uniform vec4 miscParam;\n uniform vec4 blurParam;\n#define NUM_STEPS 8.0\n#define NUM_STEPS_LOOP NUM_STEPS*2.0\n#define INV_NUM_DIRECTIONS 0.125\n#define NUM_DIRECTIONS 8\n#define CONSTANT_2PI 6.2831852\n#define g_AOResolution cc_screenSize.xy\n#define g_InvAOResolution cc_screenSize.zw\n#define g_UVToViewA uvDepthToEyePosParams.xy\n#define g_UVToViewB uvDepthToEyePosParams.zw\n#define g_R radiusParam.x\n#define g_R2 radiusParam.y\n#define g_NegInvR2 radiusParam.z\n#define g_MaxRadiusPixels radiusParam.w\n#define g_FocalLen miscParam.xy\n#define g_TanAngleBias miscParam.z\n#define g_Strength miscParam.w\nuniform sampler2D DepthTex;\nuniform sampler2D RandomTex;\nvec2 fixUV(vec2 uv)\n{\n return saturate(uv);\n}\nfloat GetLinearDepth(vec2 uv) {\n float depthHS = texture2D(DepthTex, fixUV(uv)).r * 2.0 - 1.0;\n return -GetCameraDepthRH(depthHS, cc_matProj);\n}\n#define KERNEL_FALLOFF 3.0f\n#define KERNEL_RADIUS 8\n#define HALF_KERNEL_RADIUS 4\n#define g_InvFullResolution cc_screenSize.zw\n#define g_BlurFallOff blurParam.x\n#define g_BlurDepthThreshold blurParam.y\n#define g_BlurSimpleRadius blurParam.z\nuniform sampler2D AOTexNearest;\n#define AOTexBilinear AOTexNearest\n#define GetLinearDepthBilinear GetLinearDepth\n#define g_AOSaturation blurParam.w\nvarying vec2 v_uv;\nvoid main () {\n float depth = GetLinearDepth(v_uv);\n float coc = (depth - focusDistance) / focusRange;\n coc = clamp(coc, -1.0, 1.0);\n gl_FragColor = vec4(FloatToUint8(coc), 0.0, 0.0, 1.0);\n}"
  661. },
  662. "builtins": {
  663. "globals": {
  664. "blocks": [
  665. {
  666. "name": "CCGlobal",
  667. "defines": []
  668. },
  669. {
  670. "name": "CCCamera",
  671. "defines": []
  672. }
  673. ],
  674. "samplerTextures": [],
  675. "buffers": [],
  676. "images": []
  677. },
  678. "locals": {
  679. "blocks": [],
  680. "samplerTextures": [],
  681. "buffers": [],
  682. "images": []
  683. },
  684. "statistics": {
  685. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  686. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 49
  687. }
  688. },
  689. "defines": [
  690. {
  691. "name": "USE_INSTANCING",
  692. "type": "boolean",
  693. "defines": [],
  694. "editor": {
  695. "elevated": true
  696. }
  697. },
  698. {
  699. "name": "CC_USE_SKINNING",
  700. "type": "boolean",
  701. "defines": []
  702. },
  703. {
  704. "name": "CC_USE_BAKED_ANIMATION",
  705. "type": "boolean",
  706. "defines": [
  707. "USE_INSTANCING"
  708. ]
  709. },
  710. {
  711. "name": "CC_USE_LIGHTMAP",
  712. "type": "boolean",
  713. "defines": [
  714. "USE_INSTANCING"
  715. ]
  716. },
  717. {
  718. "name": "CC_USE_REFLECTION_PROBE",
  719. "type": "boolean",
  720. "defines": [
  721. "USE_INSTANCING"
  722. ]
  723. },
  724. {
  725. "name": "CC_RECEIVE_SHADOW",
  726. "type": "boolean",
  727. "defines": [
  728. "USE_INSTANCING"
  729. ]
  730. },
  731. {
  732. "name": "CC_USE_LIGHT_PROBE",
  733. "type": "boolean",
  734. "defines": [
  735. "USE_INSTANCING"
  736. ]
  737. },
  738. {
  739. "name": "CC_USE_MORPH",
  740. "type": "boolean",
  741. "defines": []
  742. },
  743. {
  744. "name": "CC_USE_FOG",
  745. "type": "number",
  746. "defines": [],
  747. "range": [
  748. 0,
  749. 4
  750. ]
  751. }
  752. ],
  753. "name": "pipeline/post-process/dof|dof-vs|dof-coc-fs"
  754. },
  755. {
  756. "blocks": [
  757. {
  758. "name": "ColorGradingUBO",
  759. "members": [
  760. {
  761. "name": "cocParams",
  762. "type": 16,
  763. "count": 1
  764. },
  765. {
  766. "name": "mainTexTexelSize",
  767. "type": 16,
  768. "count": 1
  769. }
  770. ],
  771. "defines": [],
  772. "stageFlags": 16,
  773. "binding": 0
  774. }
  775. ],
  776. "samplerTextures": [],
  777. "samplers": [],
  778. "textures": [],
  779. "buffers": [],
  780. "images": [],
  781. "subpassInputs": [],
  782. "attributes": [
  783. {
  784. "name": "a_position",
  785. "defines": [],
  786. "format": 32,
  787. "location": 0
  788. },
  789. {
  790. "name": "a_normal",
  791. "defines": [],
  792. "format": 32,
  793. "location": 1
  794. },
  795. {
  796. "name": "a_texCoord",
  797. "defines": [],
  798. "format": 21,
  799. "location": 2
  800. },
  801. {
  802. "name": "a_tangent",
  803. "defines": [],
  804. "format": 44,
  805. "location": 3
  806. },
  807. {
  808. "name": "a_joints",
  809. "defines": [
  810. "CC_USE_SKINNING"
  811. ],
  812. "location": 4
  813. },
  814. {
  815. "name": "a_weights",
  816. "defines": [
  817. "CC_USE_SKINNING"
  818. ],
  819. "format": 44,
  820. "location": 5
  821. },
  822. {
  823. "name": "a_jointAnimInfo",
  824. "defines": [
  825. "USE_INSTANCING",
  826. "CC_USE_BAKED_ANIMATION"
  827. ],
  828. "format": 44,
  829. "isInstanced": true,
  830. "location": 6
  831. },
  832. {
  833. "name": "a_matWorld0",
  834. "defines": [
  835. "USE_INSTANCING"
  836. ],
  837. "format": 44,
  838. "isInstanced": true,
  839. "location": 7
  840. },
  841. {
  842. "name": "a_matWorld1",
  843. "defines": [
  844. "USE_INSTANCING"
  845. ],
  846. "format": 44,
  847. "isInstanced": true,
  848. "location": 8
  849. },
  850. {
  851. "name": "a_matWorld2",
  852. "defines": [
  853. "USE_INSTANCING"
  854. ],
  855. "format": 44,
  856. "isInstanced": true,
  857. "location": 9
  858. },
  859. {
  860. "name": "a_lightingMapUVParam",
  861. "defines": [
  862. "USE_INSTANCING",
  863. "CC_USE_LIGHTMAP"
  864. ],
  865. "format": 44,
  866. "isInstanced": true,
  867. "location": 10
  868. },
  869. {
  870. "name": "a_localShadowBiasAndProbeId",
  871. "defines": [
  872. "USE_INSTANCING"
  873. ],
  874. "format": 44,
  875. "isInstanced": true,
  876. "location": 11
  877. },
  878. {
  879. "name": "a_reflectionProbeData",
  880. "defines": [
  881. "USE_INSTANCING",
  882. "CC_USE_REFLECTION_PROBE"
  883. ],
  884. "format": 44,
  885. "isInstanced": true,
  886. "location": 12
  887. },
  888. {
  889. "name": "a_sh_linear_const_r",
  890. "defines": [
  891. "USE_INSTANCING",
  892. "CC_USE_LIGHT_PROBE"
  893. ],
  894. "format": 44,
  895. "isInstanced": true,
  896. "location": 13
  897. },
  898. {
  899. "name": "a_sh_linear_const_g",
  900. "defines": [
  901. "USE_INSTANCING",
  902. "CC_USE_LIGHT_PROBE"
  903. ],
  904. "format": 44,
  905. "isInstanced": true,
  906. "location": 14
  907. },
  908. {
  909. "name": "a_sh_linear_const_b",
  910. "defines": [
  911. "USE_INSTANCING",
  912. "CC_USE_LIGHT_PROBE"
  913. ],
  914. "format": 44,
  915. "isInstanced": true,
  916. "location": 15
  917. },
  918. {
  919. "name": "a_vertexId",
  920. "defines": [
  921. "CC_USE_MORPH"
  922. ],
  923. "format": 11,
  924. "location": 16
  925. }
  926. ],
  927. "varyings": [
  928. {
  929. "name": "v_uv",
  930. "type": 14,
  931. "count": 1,
  932. "defines": [],
  933. "stageFlags": 17,
  934. "location": 0
  935. }
  936. ],
  937. "fragColors": [
  938. {
  939. "name": "fragColor",
  940. "typename": "vec4",
  941. "type": 16,
  942. "count": 1,
  943. "defines": [],
  944. "stageFlags": 16,
  945. "location": 0
  946. }
  947. ],
  948. "descriptors": [
  949. {
  950. "rate": 0,
  951. "blocks": [],
  952. "samplerTextures": [],
  953. "samplers": [],
  954. "textures": [],
  955. "buffers": [],
  956. "images": [],
  957. "subpassInputs": []
  958. },
  959. {
  960. "rate": 1,
  961. "blocks": [
  962. {
  963. "name": "ColorGradingUBO",
  964. "members": [
  965. {
  966. "name": "cocParams",
  967. "type": 16,
  968. "count": 1
  969. },
  970. {
  971. "name": "mainTexTexelSize",
  972. "type": 16,
  973. "count": 1
  974. }
  975. ],
  976. "defines": [],
  977. "stageFlags": 16,
  978. "binding": 0
  979. }
  980. ],
  981. "samplerTextures": [],
  982. "samplers": [],
  983. "textures": [],
  984. "buffers": [],
  985. "images": [],
  986. "subpassInputs": []
  987. },
  988. {
  989. "rate": 2,
  990. "blocks": [],
  991. "samplerTextures": [],
  992. "samplers": [],
  993. "textures": [],
  994. "buffers": [],
  995. "images": [],
  996. "subpassInputs": []
  997. },
  998. {
  999. "rate": 3,
  1000. "blocks": [
  1001. {
  1002. "tags": {
  1003. "builtin": "global"
  1004. },
  1005. "name": "CCGlobal",
  1006. "members": [
  1007. {
  1008. "name": "cc_time",
  1009. "typename": "vec4",
  1010. "type": 16,
  1011. "count": 1,
  1012. "precision": "highp "
  1013. },
  1014. {
  1015. "name": "cc_screenSize",
  1016. "typename": "vec4",
  1017. "type": 16,
  1018. "count": 1,
  1019. "precision": "mediump "
  1020. },
  1021. {
  1022. "name": "cc_nativeSize",
  1023. "typename": "vec4",
  1024. "type": 16,
  1025. "count": 1,
  1026. "precision": "mediump "
  1027. },
  1028. {
  1029. "name": "cc_probeInfo",
  1030. "typename": "vec4",
  1031. "type": 16,
  1032. "count": 1,
  1033. "precision": "mediump "
  1034. },
  1035. {
  1036. "name": "cc_debug_view_mode",
  1037. "typename": "vec4",
  1038. "type": 16,
  1039. "count": 1,
  1040. "precision": "mediump "
  1041. }
  1042. ],
  1043. "defines": [],
  1044. "stageFlags": 1
  1045. },
  1046. {
  1047. "tags": {
  1048. "builtin": "global"
  1049. },
  1050. "name": "CCCamera",
  1051. "members": [
  1052. {
  1053. "name": "cc_matView",
  1054. "typename": "mat4",
  1055. "type": 25,
  1056. "count": 1,
  1057. "precision": "highp "
  1058. },
  1059. {
  1060. "name": "cc_matViewInv",
  1061. "typename": "mat4",
  1062. "type": 25,
  1063. "count": 1,
  1064. "precision": "highp "
  1065. },
  1066. {
  1067. "name": "cc_matProj",
  1068. "typename": "mat4",
  1069. "type": 25,
  1070. "count": 1,
  1071. "precision": "highp "
  1072. },
  1073. {
  1074. "name": "cc_matProjInv",
  1075. "typename": "mat4",
  1076. "type": 25,
  1077. "count": 1,
  1078. "precision": "highp "
  1079. },
  1080. {
  1081. "name": "cc_matViewProj",
  1082. "typename": "mat4",
  1083. "type": 25,
  1084. "count": 1,
  1085. "precision": "highp "
  1086. },
  1087. {
  1088. "name": "cc_matViewProjInv",
  1089. "typename": "mat4",
  1090. "type": 25,
  1091. "count": 1,
  1092. "precision": "highp "
  1093. },
  1094. {
  1095. "name": "cc_cameraPos",
  1096. "typename": "vec4",
  1097. "type": 16,
  1098. "count": 1,
  1099. "precision": "highp "
  1100. },
  1101. {
  1102. "name": "cc_surfaceTransform",
  1103. "typename": "vec4",
  1104. "type": 16,
  1105. "count": 1,
  1106. "precision": "mediump "
  1107. },
  1108. {
  1109. "name": "cc_screenScale",
  1110. "typename": "vec4",
  1111. "type": 16,
  1112. "count": 1,
  1113. "precision": "mediump "
  1114. },
  1115. {
  1116. "name": "cc_exposure",
  1117. "typename": "vec4",
  1118. "type": 16,
  1119. "count": 1,
  1120. "precision": "mediump "
  1121. },
  1122. {
  1123. "name": "cc_mainLitDir",
  1124. "typename": "vec4",
  1125. "type": 16,
  1126. "count": 1,
  1127. "precision": "mediump "
  1128. },
  1129. {
  1130. "name": "cc_mainLitColor",
  1131. "typename": "vec4",
  1132. "type": 16,
  1133. "count": 1,
  1134. "precision": "mediump "
  1135. },
  1136. {
  1137. "name": "cc_ambientSky",
  1138. "typename": "vec4",
  1139. "type": 16,
  1140. "count": 1,
  1141. "precision": "mediump "
  1142. },
  1143. {
  1144. "name": "cc_ambientGround",
  1145. "typename": "vec4",
  1146. "type": 16,
  1147. "count": 1,
  1148. "precision": "mediump "
  1149. },
  1150. {
  1151. "name": "cc_fogColor",
  1152. "typename": "vec4",
  1153. "type": 16,
  1154. "count": 1,
  1155. "precision": "mediump "
  1156. },
  1157. {
  1158. "name": "cc_fogBase",
  1159. "typename": "vec4",
  1160. "type": 16,
  1161. "count": 1,
  1162. "precision": "mediump "
  1163. },
  1164. {
  1165. "name": "cc_fogAdd",
  1166. "typename": "vec4",
  1167. "type": 16,
  1168. "count": 1,
  1169. "precision": "mediump "
  1170. },
  1171. {
  1172. "name": "cc_nearFar",
  1173. "typename": "vec4",
  1174. "type": 16,
  1175. "count": 1,
  1176. "precision": "mediump "
  1177. },
  1178. {
  1179. "name": "cc_viewPort",
  1180. "typename": "vec4",
  1181. "type": 16,
  1182. "count": 1,
  1183. "precision": "mediump "
  1184. }
  1185. ],
  1186. "defines": [],
  1187. "stageFlags": 1
  1188. }
  1189. ],
  1190. "samplerTextures": [
  1191. {
  1192. "name": "colorTex",
  1193. "type": 28,
  1194. "count": 1,
  1195. "defines": [],
  1196. "stageFlags": 16,
  1197. "binding": 1
  1198. },
  1199. {
  1200. "name": "cocTex",
  1201. "type": 28,
  1202. "count": 1,
  1203. "defines": [],
  1204. "stageFlags": 16,
  1205. "binding": 2
  1206. },
  1207. {
  1208. "name": "prefilterTex",
  1209. "type": 28,
  1210. "count": 1,
  1211. "defines": [],
  1212. "stageFlags": 16,
  1213. "binding": 3
  1214. },
  1215. {
  1216. "name": "bokehTex",
  1217. "type": 28,
  1218. "count": 1,
  1219. "defines": [],
  1220. "stageFlags": 16,
  1221. "binding": 4
  1222. },
  1223. {
  1224. "name": "filterTex",
  1225. "type": 28,
  1226. "count": 1,
  1227. "defines": [],
  1228. "stageFlags": 16,
  1229. "binding": 5
  1230. }
  1231. ],
  1232. "samplers": [],
  1233. "textures": [],
  1234. "buffers": [],
  1235. "images": [],
  1236. "subpassInputs": []
  1237. }
  1238. ],
  1239. "hash": 2765066539,
  1240. "glsl4": {
  1241. "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}",
  1242. "frag": "\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\nlayout(set = 1, binding = 0) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nlayout(set = 1, binding = 1) uniform sampler2D colorTex;\nlayout(set = 1, binding = 2) uniform sampler2D cocTex;\nlayout(set = 1, binding = 3) uniform sampler2D prefilterTex;\nlayout(set = 1, binding = 4) uniform sampler2D bokehTex;\nlayout(set = 1, binding = 5) uniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat FloatToUint8(float v) {\n return (v * 127.0 + 128.0 + 0.5) / 255.0;\n}\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nfloat Weigh (vec3 c) {\n return 1.0 / (1.0 + max(max(c.r, c.g), c.b));\n}\nvoid main () {\n vec4 o = mainTexTexelSize.xyxy * vec2(-0.5, 0.5).xxyy;\n vec2 uv0 = v_uv + o.xy;\n vec2 uv1 = v_uv + o.zy;\n vec2 uv2 = v_uv + o.xw;\n vec2 uv3 = v_uv + o.zw;\n vec3 s0 = texture(colorTex, uv0).rgb;\n vec3 s1 = texture(colorTex, uv1).rgb;\n vec3 s2 = texture(colorTex, uv2).rgb;\n vec3 s3 = texture(colorTex, uv3).rgb;\n float w0 = Weigh(s0);\n float w1 = Weigh(s1);\n float w2 = Weigh(s2);\n float w3 = Weigh(s3);\n vec3 avg = s0 * w0 + s1 * w1 + s2 * w2 + s3 * w3;\n avg /= max(w0 + w1 + w2 + s3, 0.00001);\n float coc0 = Uint8ToFloat(texture(cocTex, uv0).r);\n float coc1 = Uint8ToFloat(texture(cocTex, uv1).r);\n float coc2 = Uint8ToFloat(texture(cocTex, uv2).r);\n float coc3 = Uint8ToFloat(texture(cocTex, uv3).r);\n float cocMin = min(min(min(coc0, coc1), coc2), coc3);\n float cocMax = max(max(max(coc0, coc1), coc2), coc3);\n float coc = cocMax >= -cocMin ? cocMax : cocMin;\n fragColor = vec4(avg, FloatToUint8(coc));\n}"
  1243. },
  1244. "glsl3": {
  1245. "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}",
  1246. "frag": "\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\nlayout(std140) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat FloatToUint8(float v) {\n return (v * 127.0 + 128.0 + 0.5) / 255.0;\n}\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nfloat Weigh (vec3 c) {\n return 1.0 / (1.0 + max(max(c.r, c.g), c.b));\n}\nvoid main () {\n vec4 o = mainTexTexelSize.xyxy * vec2(-0.5, 0.5).xxyy;\n vec2 uv0 = v_uv + o.xy;\n vec2 uv1 = v_uv + o.zy;\n vec2 uv2 = v_uv + o.xw;\n vec2 uv3 = v_uv + o.zw;\n vec3 s0 = texture(colorTex, uv0).rgb;\n vec3 s1 = texture(colorTex, uv1).rgb;\n vec3 s2 = texture(colorTex, uv2).rgb;\n vec3 s3 = texture(colorTex, uv3).rgb;\n float w0 = Weigh(s0);\n float w1 = Weigh(s1);\n float w2 = Weigh(s2);\n float w3 = Weigh(s3);\n vec3 avg = s0 * w0 + s1 * w1 + s2 * w2 + s3 * w3;\n avg /= max(w0 + w1 + w2 + s3, 0.00001);\n float coc0 = Uint8ToFloat(texture(cocTex, uv0).r);\n float coc1 = Uint8ToFloat(texture(cocTex, uv1).r);\n float coc2 = Uint8ToFloat(texture(cocTex, uv2).r);\n float coc3 = Uint8ToFloat(texture(cocTex, uv3).r);\n float cocMin = min(min(min(coc0, coc1), coc2), coc3);\n float cocMax = max(max(max(coc0, coc1), coc2), coc3);\n float coc = cocMax >= -cocMin ? cocMax : cocMin;\n fragColor = vec4(avg, FloatToUint8(coc));\n}"
  1247. },
  1248. "glsl1": {
  1249. "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}",
  1250. "frag": "\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\n uniform vec4 cocParams;\n uniform vec4 mainTexTexelSize;\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat FloatToUint8(float v) {\n return (v * 127.0 + 128.0 + 0.5) / 255.0;\n}\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nvarying vec2 v_uv;\nfloat Weigh (vec3 c) {\n return 1.0 / (1.0 + max(max(c.r, c.g), c.b));\n}\nvoid main () {\n vec4 o = mainTexTexelSize.xyxy * vec2(-0.5, 0.5).xxyy;\n vec2 uv0 = v_uv + o.xy;\n vec2 uv1 = v_uv + o.zy;\n vec2 uv2 = v_uv + o.xw;\n vec2 uv3 = v_uv + o.zw;\n vec3 s0 = texture2D(colorTex, uv0).rgb;\n vec3 s1 = texture2D(colorTex, uv1).rgb;\n vec3 s2 = texture2D(colorTex, uv2).rgb;\n vec3 s3 = texture2D(colorTex, uv3).rgb;\n float w0 = Weigh(s0);\n float w1 = Weigh(s1);\n float w2 = Weigh(s2);\n float w3 = Weigh(s3);\n vec3 avg = s0 * w0 + s1 * w1 + s2 * w2 + s3 * w3;\n avg /= max(w0 + w1 + w2 + s3, 0.00001);\n float coc0 = Uint8ToFloat(texture2D(cocTex, uv0).r);\n float coc1 = Uint8ToFloat(texture2D(cocTex, uv1).r);\n float coc2 = Uint8ToFloat(texture2D(cocTex, uv2).r);\n float coc3 = Uint8ToFloat(texture2D(cocTex, uv3).r);\n float cocMin = min(min(min(coc0, coc1), coc2), coc3);\n float cocMax = max(max(max(coc0, coc1), coc2), coc3);\n float coc = cocMax >= -cocMin ? cocMax : cocMin;\n gl_FragColor = vec4(avg, FloatToUint8(coc));\n}"
  1251. },
  1252. "builtins": {
  1253. "globals": {
  1254. "blocks": [
  1255. {
  1256. "name": "CCGlobal",
  1257. "defines": []
  1258. },
  1259. {
  1260. "name": "CCCamera",
  1261. "defines": []
  1262. }
  1263. ],
  1264. "samplerTextures": [],
  1265. "buffers": [],
  1266. "images": []
  1267. },
  1268. "locals": {
  1269. "blocks": [],
  1270. "samplerTextures": [],
  1271. "buffers": [],
  1272. "images": []
  1273. },
  1274. "statistics": {
  1275. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  1276. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 2
  1277. }
  1278. },
  1279. "defines": [
  1280. {
  1281. "name": "USE_INSTANCING",
  1282. "type": "boolean",
  1283. "defines": [],
  1284. "editor": {
  1285. "elevated": true
  1286. }
  1287. },
  1288. {
  1289. "name": "CC_USE_SKINNING",
  1290. "type": "boolean",
  1291. "defines": []
  1292. },
  1293. {
  1294. "name": "CC_USE_BAKED_ANIMATION",
  1295. "type": "boolean",
  1296. "defines": [
  1297. "USE_INSTANCING"
  1298. ]
  1299. },
  1300. {
  1301. "name": "CC_USE_LIGHTMAP",
  1302. "type": "boolean",
  1303. "defines": [
  1304. "USE_INSTANCING"
  1305. ]
  1306. },
  1307. {
  1308. "name": "CC_USE_REFLECTION_PROBE",
  1309. "type": "boolean",
  1310. "defines": [
  1311. "USE_INSTANCING"
  1312. ]
  1313. },
  1314. {
  1315. "name": "CC_RECEIVE_SHADOW",
  1316. "type": "boolean",
  1317. "defines": [
  1318. "USE_INSTANCING"
  1319. ]
  1320. },
  1321. {
  1322. "name": "CC_USE_LIGHT_PROBE",
  1323. "type": "boolean",
  1324. "defines": [
  1325. "USE_INSTANCING"
  1326. ]
  1327. },
  1328. {
  1329. "name": "CC_USE_MORPH",
  1330. "type": "boolean",
  1331. "defines": []
  1332. }
  1333. ],
  1334. "name": "pipeline/post-process/dof|dof-vs|dof-prefilter-fs"
  1335. },
  1336. {
  1337. "blocks": [
  1338. {
  1339. "name": "ColorGradingUBO",
  1340. "members": [
  1341. {
  1342. "name": "cocParams",
  1343. "type": 16,
  1344. "count": 1
  1345. },
  1346. {
  1347. "name": "mainTexTexelSize",
  1348. "type": 16,
  1349. "count": 1
  1350. }
  1351. ],
  1352. "defines": [],
  1353. "stageFlags": 16,
  1354. "binding": 0
  1355. }
  1356. ],
  1357. "samplerTextures": [],
  1358. "samplers": [],
  1359. "textures": [],
  1360. "buffers": [],
  1361. "images": [],
  1362. "subpassInputs": [],
  1363. "attributes": [
  1364. {
  1365. "name": "a_position",
  1366. "defines": [],
  1367. "format": 32,
  1368. "location": 0
  1369. },
  1370. {
  1371. "name": "a_normal",
  1372. "defines": [],
  1373. "format": 32,
  1374. "location": 1
  1375. },
  1376. {
  1377. "name": "a_texCoord",
  1378. "defines": [],
  1379. "format": 21,
  1380. "location": 2
  1381. },
  1382. {
  1383. "name": "a_tangent",
  1384. "defines": [],
  1385. "format": 44,
  1386. "location": 3
  1387. },
  1388. {
  1389. "name": "a_joints",
  1390. "defines": [
  1391. "CC_USE_SKINNING"
  1392. ],
  1393. "location": 4
  1394. },
  1395. {
  1396. "name": "a_weights",
  1397. "defines": [
  1398. "CC_USE_SKINNING"
  1399. ],
  1400. "format": 44,
  1401. "location": 5
  1402. },
  1403. {
  1404. "name": "a_jointAnimInfo",
  1405. "defines": [
  1406. "USE_INSTANCING",
  1407. "CC_USE_BAKED_ANIMATION"
  1408. ],
  1409. "format": 44,
  1410. "isInstanced": true,
  1411. "location": 6
  1412. },
  1413. {
  1414. "name": "a_matWorld0",
  1415. "defines": [
  1416. "USE_INSTANCING"
  1417. ],
  1418. "format": 44,
  1419. "isInstanced": true,
  1420. "location": 7
  1421. },
  1422. {
  1423. "name": "a_matWorld1",
  1424. "defines": [
  1425. "USE_INSTANCING"
  1426. ],
  1427. "format": 44,
  1428. "isInstanced": true,
  1429. "location": 8
  1430. },
  1431. {
  1432. "name": "a_matWorld2",
  1433. "defines": [
  1434. "USE_INSTANCING"
  1435. ],
  1436. "format": 44,
  1437. "isInstanced": true,
  1438. "location": 9
  1439. },
  1440. {
  1441. "name": "a_lightingMapUVParam",
  1442. "defines": [
  1443. "USE_INSTANCING",
  1444. "CC_USE_LIGHTMAP"
  1445. ],
  1446. "format": 44,
  1447. "isInstanced": true,
  1448. "location": 10
  1449. },
  1450. {
  1451. "name": "a_localShadowBiasAndProbeId",
  1452. "defines": [
  1453. "USE_INSTANCING"
  1454. ],
  1455. "format": 44,
  1456. "isInstanced": true,
  1457. "location": 11
  1458. },
  1459. {
  1460. "name": "a_reflectionProbeData",
  1461. "defines": [
  1462. "USE_INSTANCING",
  1463. "CC_USE_REFLECTION_PROBE"
  1464. ],
  1465. "format": 44,
  1466. "isInstanced": true,
  1467. "location": 12
  1468. },
  1469. {
  1470. "name": "a_sh_linear_const_r",
  1471. "defines": [
  1472. "USE_INSTANCING",
  1473. "CC_USE_LIGHT_PROBE"
  1474. ],
  1475. "format": 44,
  1476. "isInstanced": true,
  1477. "location": 13
  1478. },
  1479. {
  1480. "name": "a_sh_linear_const_g",
  1481. "defines": [
  1482. "USE_INSTANCING",
  1483. "CC_USE_LIGHT_PROBE"
  1484. ],
  1485. "format": 44,
  1486. "isInstanced": true,
  1487. "location": 14
  1488. },
  1489. {
  1490. "name": "a_sh_linear_const_b",
  1491. "defines": [
  1492. "USE_INSTANCING",
  1493. "CC_USE_LIGHT_PROBE"
  1494. ],
  1495. "format": 44,
  1496. "isInstanced": true,
  1497. "location": 15
  1498. },
  1499. {
  1500. "name": "a_vertexId",
  1501. "defines": [
  1502. "CC_USE_MORPH"
  1503. ],
  1504. "format": 11,
  1505. "location": 16
  1506. }
  1507. ],
  1508. "varyings": [
  1509. {
  1510. "name": "v_uv",
  1511. "type": 14,
  1512. "count": 1,
  1513. "defines": [],
  1514. "stageFlags": 17,
  1515. "location": 0
  1516. }
  1517. ],
  1518. "fragColors": [
  1519. {
  1520. "name": "fragColor",
  1521. "typename": "vec4",
  1522. "type": 16,
  1523. "count": 1,
  1524. "defines": [],
  1525. "stageFlags": 16,
  1526. "location": 0
  1527. }
  1528. ],
  1529. "descriptors": [
  1530. {
  1531. "rate": 0,
  1532. "blocks": [],
  1533. "samplerTextures": [],
  1534. "samplers": [],
  1535. "textures": [],
  1536. "buffers": [],
  1537. "images": [],
  1538. "subpassInputs": []
  1539. },
  1540. {
  1541. "rate": 1,
  1542. "blocks": [
  1543. {
  1544. "name": "ColorGradingUBO",
  1545. "members": [
  1546. {
  1547. "name": "cocParams",
  1548. "type": 16,
  1549. "count": 1
  1550. },
  1551. {
  1552. "name": "mainTexTexelSize",
  1553. "type": 16,
  1554. "count": 1
  1555. }
  1556. ],
  1557. "defines": [],
  1558. "stageFlags": 16,
  1559. "binding": 0
  1560. }
  1561. ],
  1562. "samplerTextures": [],
  1563. "samplers": [],
  1564. "textures": [],
  1565. "buffers": [],
  1566. "images": [],
  1567. "subpassInputs": []
  1568. },
  1569. {
  1570. "rate": 2,
  1571. "blocks": [],
  1572. "samplerTextures": [],
  1573. "samplers": [],
  1574. "textures": [],
  1575. "buffers": [],
  1576. "images": [],
  1577. "subpassInputs": []
  1578. },
  1579. {
  1580. "rate": 3,
  1581. "blocks": [
  1582. {
  1583. "tags": {
  1584. "builtin": "global"
  1585. },
  1586. "name": "CCGlobal",
  1587. "members": [
  1588. {
  1589. "name": "cc_time",
  1590. "typename": "vec4",
  1591. "type": 16,
  1592. "count": 1,
  1593. "precision": "highp "
  1594. },
  1595. {
  1596. "name": "cc_screenSize",
  1597. "typename": "vec4",
  1598. "type": 16,
  1599. "count": 1,
  1600. "precision": "mediump "
  1601. },
  1602. {
  1603. "name": "cc_nativeSize",
  1604. "typename": "vec4",
  1605. "type": 16,
  1606. "count": 1,
  1607. "precision": "mediump "
  1608. },
  1609. {
  1610. "name": "cc_probeInfo",
  1611. "typename": "vec4",
  1612. "type": 16,
  1613. "count": 1,
  1614. "precision": "mediump "
  1615. },
  1616. {
  1617. "name": "cc_debug_view_mode",
  1618. "typename": "vec4",
  1619. "type": 16,
  1620. "count": 1,
  1621. "precision": "mediump "
  1622. }
  1623. ],
  1624. "defines": [],
  1625. "stageFlags": 1
  1626. },
  1627. {
  1628. "tags": {
  1629. "builtin": "global"
  1630. },
  1631. "name": "CCCamera",
  1632. "members": [
  1633. {
  1634. "name": "cc_matView",
  1635. "typename": "mat4",
  1636. "type": 25,
  1637. "count": 1,
  1638. "precision": "highp "
  1639. },
  1640. {
  1641. "name": "cc_matViewInv",
  1642. "typename": "mat4",
  1643. "type": 25,
  1644. "count": 1,
  1645. "precision": "highp "
  1646. },
  1647. {
  1648. "name": "cc_matProj",
  1649. "typename": "mat4",
  1650. "type": 25,
  1651. "count": 1,
  1652. "precision": "highp "
  1653. },
  1654. {
  1655. "name": "cc_matProjInv",
  1656. "typename": "mat4",
  1657. "type": 25,
  1658. "count": 1,
  1659. "precision": "highp "
  1660. },
  1661. {
  1662. "name": "cc_matViewProj",
  1663. "typename": "mat4",
  1664. "type": 25,
  1665. "count": 1,
  1666. "precision": "highp "
  1667. },
  1668. {
  1669. "name": "cc_matViewProjInv",
  1670. "typename": "mat4",
  1671. "type": 25,
  1672. "count": 1,
  1673. "precision": "highp "
  1674. },
  1675. {
  1676. "name": "cc_cameraPos",
  1677. "typename": "vec4",
  1678. "type": 16,
  1679. "count": 1,
  1680. "precision": "highp "
  1681. },
  1682. {
  1683. "name": "cc_surfaceTransform",
  1684. "typename": "vec4",
  1685. "type": 16,
  1686. "count": 1,
  1687. "precision": "mediump "
  1688. },
  1689. {
  1690. "name": "cc_screenScale",
  1691. "typename": "vec4",
  1692. "type": 16,
  1693. "count": 1,
  1694. "precision": "mediump "
  1695. },
  1696. {
  1697. "name": "cc_exposure",
  1698. "typename": "vec4",
  1699. "type": 16,
  1700. "count": 1,
  1701. "precision": "mediump "
  1702. },
  1703. {
  1704. "name": "cc_mainLitDir",
  1705. "typename": "vec4",
  1706. "type": 16,
  1707. "count": 1,
  1708. "precision": "mediump "
  1709. },
  1710. {
  1711. "name": "cc_mainLitColor",
  1712. "typename": "vec4",
  1713. "type": 16,
  1714. "count": 1,
  1715. "precision": "mediump "
  1716. },
  1717. {
  1718. "name": "cc_ambientSky",
  1719. "typename": "vec4",
  1720. "type": 16,
  1721. "count": 1,
  1722. "precision": "mediump "
  1723. },
  1724. {
  1725. "name": "cc_ambientGround",
  1726. "typename": "vec4",
  1727. "type": 16,
  1728. "count": 1,
  1729. "precision": "mediump "
  1730. },
  1731. {
  1732. "name": "cc_fogColor",
  1733. "typename": "vec4",
  1734. "type": 16,
  1735. "count": 1,
  1736. "precision": "mediump "
  1737. },
  1738. {
  1739. "name": "cc_fogBase",
  1740. "typename": "vec4",
  1741. "type": 16,
  1742. "count": 1,
  1743. "precision": "mediump "
  1744. },
  1745. {
  1746. "name": "cc_fogAdd",
  1747. "typename": "vec4",
  1748. "type": 16,
  1749. "count": 1,
  1750. "precision": "mediump "
  1751. },
  1752. {
  1753. "name": "cc_nearFar",
  1754. "typename": "vec4",
  1755. "type": 16,
  1756. "count": 1,
  1757. "precision": "mediump "
  1758. },
  1759. {
  1760. "name": "cc_viewPort",
  1761. "typename": "vec4",
  1762. "type": 16,
  1763. "count": 1,
  1764. "precision": "mediump "
  1765. }
  1766. ],
  1767. "defines": [],
  1768. "stageFlags": 1
  1769. }
  1770. ],
  1771. "samplerTextures": [
  1772. {
  1773. "name": "colorTex",
  1774. "type": 28,
  1775. "count": 1,
  1776. "defines": [],
  1777. "stageFlags": 16,
  1778. "binding": 1
  1779. },
  1780. {
  1781. "name": "cocTex",
  1782. "type": 28,
  1783. "count": 1,
  1784. "defines": [],
  1785. "stageFlags": 16,
  1786. "binding": 2
  1787. },
  1788. {
  1789. "name": "prefilterTex",
  1790. "type": 28,
  1791. "count": 1,
  1792. "defines": [],
  1793. "stageFlags": 16,
  1794. "binding": 3
  1795. },
  1796. {
  1797. "name": "bokehTex",
  1798. "type": 28,
  1799. "count": 1,
  1800. "defines": [],
  1801. "stageFlags": 16,
  1802. "binding": 4
  1803. },
  1804. {
  1805. "name": "filterTex",
  1806. "type": 28,
  1807. "count": 1,
  1808. "defines": [],
  1809. "stageFlags": 16,
  1810. "binding": 5
  1811. }
  1812. ],
  1813. "samplers": [],
  1814. "textures": [],
  1815. "buffers": [],
  1816. "images": [],
  1817. "subpassInputs": []
  1818. }
  1819. ],
  1820. "hash": 1790750633,
  1821. "glsl4": {
  1822. "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}",
  1823. "frag": "\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\nlayout(set = 1, binding = 0) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nlayout(set = 1, binding = 1) uniform sampler2D colorTex;\nlayout(set = 1, binding = 2) uniform sampler2D cocTex;\nlayout(set = 1, binding = 3) uniform sampler2D prefilterTex;\nlayout(set = 1, binding = 4) uniform sampler2D bokehTex;\nlayout(set = 1, binding = 5) uniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nconst int SAMPLE_COUNT = 16;\nvec2 bokehKernel[SAMPLE_COUNT];\nvoid initKernel()\n{\n bokehKernel[0] = vec2(0.0, 0.0);\n bokehKernel[1] = vec2(0.54545456, 0.0);\n bokehKernel[2] = vec2(0.16855472, 0.5187581);\n bokehKernel[3] = vec2(-0.44128203, 0.3206101);\n bokehKernel[4] = vec2(-0.44128197, -0.3206102);\n bokehKernel[5] = vec2(0.1685548, -0.5187581);\n bokehKernel[6] = vec2(1.0, 0.0);\n bokehKernel[7] = vec2(0.809017, 0.58778524);\n bokehKernel[8] = vec2(0.30901697, 0.95105654);\n bokehKernel[9] = vec2(-0.30901703, 0.9510565);\n bokehKernel[10] = vec2(-0.80901706, 0.5877852);\n bokehKernel[11] = vec2(-1.0, 0.0);\n bokehKernel[12] = vec2(-0.80901694, -0.58778536);\n bokehKernel[13] = vec2(-0.30901664, -0.9510566);\n bokehKernel[14] = vec2(0.30901712, -0.9510565);\n bokehKernel[15] = vec2(0.80901694, -0.5877853);\n}\nfloat Weigh (float coc, float dist) {\n return saturate((abs(coc) - dist + 2.0) / 2.0);\n}\nvoid Accumulate(float coc, vec2 displacement, inout vec4 farAcc, inout vec4 nearAcc) {\n float dist = length(displacement);\n vec2 offset = displacement * mainTexTexelSize.xy * 2.0;\n vec4 prefilterColor = texture(prefilterTex, v_uv + offset);\n prefilterColor.a = Uint8ToFloat(prefilterColor.a) * bokehRadius;\n float fw = Weigh(max(0.0, min(prefilterColor.a, coc)), dist);\n farAcc.rgb += prefilterColor.rgb * fw;\n farAcc.a += fw;\n float nw = Weigh(-prefilterColor.a, dist);\n nearAcc.rgb += prefilterColor.rgb * nw;\n nearAcc.a += nw;\n}\nvoid main () {\n initKernel();\n float coc = Uint8ToFloat(texture(prefilterTex, v_uv).a) * bokehRadius;\n vec4 farAcc = vec4(0.0);\n vec4 nearAcc = vec4(0.0);\n for (int k = 0; k < SAMPLE_COUNT; k++) {\n vec2 displacement = bokehKernel[k] * bokehRadius;\n Accumulate(coc, displacement, farAcc, nearAcc);\n }\n farAcc.rgb *= 1.0 / (farAcc.a + (farAcc.a == 0.0 ? 1.0 : 0.0));\n nearAcc.rgb *= 1.0 / (nearAcc.a + (nearAcc.a == 0.0 ? 1.0 : 0.0));\n float alpha = min(1.0, nearAcc.a * PI / float(SAMPLE_COUNT));\n vec3 rgb = mix(farAcc.rgb, nearAcc.rgb, alpha);\n fragColor = vec4(rgb, alpha);\n}"
  1824. },
  1825. "glsl3": {
  1826. "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}",
  1827. "frag": "\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\nlayout(std140) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nconst int SAMPLE_COUNT = 16;\nvec2 bokehKernel[SAMPLE_COUNT];\nvoid initKernel()\n{\n bokehKernel[0] = vec2(0.0, 0.0);\n bokehKernel[1] = vec2(0.54545456, 0.0);\n bokehKernel[2] = vec2(0.16855472, 0.5187581);\n bokehKernel[3] = vec2(-0.44128203, 0.3206101);\n bokehKernel[4] = vec2(-0.44128197, -0.3206102);\n bokehKernel[5] = vec2(0.1685548, -0.5187581);\n bokehKernel[6] = vec2(1.0, 0.0);\n bokehKernel[7] = vec2(0.809017, 0.58778524);\n bokehKernel[8] = vec2(0.30901697, 0.95105654);\n bokehKernel[9] = vec2(-0.30901703, 0.9510565);\n bokehKernel[10] = vec2(-0.80901706, 0.5877852);\n bokehKernel[11] = vec2(-1.0, 0.0);\n bokehKernel[12] = vec2(-0.80901694, -0.58778536);\n bokehKernel[13] = vec2(-0.30901664, -0.9510566);\n bokehKernel[14] = vec2(0.30901712, -0.9510565);\n bokehKernel[15] = vec2(0.80901694, -0.5877853);\n}\nfloat Weigh (float coc, float dist) {\n return saturate((abs(coc) - dist + 2.0) / 2.0);\n}\nvoid Accumulate(float coc, vec2 displacement, inout vec4 farAcc, inout vec4 nearAcc) {\n float dist = length(displacement);\n vec2 offset = displacement * mainTexTexelSize.xy * 2.0;\n vec4 prefilterColor = texture(prefilterTex, v_uv + offset);\n prefilterColor.a = Uint8ToFloat(prefilterColor.a) * bokehRadius;\n float fw = Weigh(max(0.0, min(prefilterColor.a, coc)), dist);\n farAcc.rgb += prefilterColor.rgb * fw;\n farAcc.a += fw;\n float nw = Weigh(-prefilterColor.a, dist);\n nearAcc.rgb += prefilterColor.rgb * nw;\n nearAcc.a += nw;\n}\nvoid main () {\n initKernel();\n float coc = Uint8ToFloat(texture(prefilterTex, v_uv).a) * bokehRadius;\n vec4 farAcc = vec4(0.0);\n vec4 nearAcc = vec4(0.0);\n for (int k = 0; k < SAMPLE_COUNT; k++) {\n vec2 displacement = bokehKernel[k] * bokehRadius;\n Accumulate(coc, displacement, farAcc, nearAcc);\n }\n farAcc.rgb *= 1.0 / (farAcc.a + (farAcc.a == 0.0 ? 1.0 : 0.0));\n nearAcc.rgb *= 1.0 / (nearAcc.a + (nearAcc.a == 0.0 ? 1.0 : 0.0));\n float alpha = min(1.0, nearAcc.a * PI / float(SAMPLE_COUNT));\n vec3 rgb = mix(farAcc.rgb, nearAcc.rgb, alpha);\n fragColor = vec4(rgb, alpha);\n}"
  1828. },
  1829. "glsl1": {
  1830. "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}",
  1831. "frag": "\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 uniform vec4 cocParams;\n uniform vec4 mainTexTexelSize;\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nvarying vec2 v_uv;\nconst int SAMPLE_COUNT = 16;\nvec2 bokehKernel[SAMPLE_COUNT];\nvoid initKernel()\n{\n bokehKernel[0] = vec2(0.0, 0.0);\n bokehKernel[1] = vec2(0.54545456, 0.0);\n bokehKernel[2] = vec2(0.16855472, 0.5187581);\n bokehKernel[3] = vec2(-0.44128203, 0.3206101);\n bokehKernel[4] = vec2(-0.44128197, -0.3206102);\n bokehKernel[5] = vec2(0.1685548, -0.5187581);\n bokehKernel[6] = vec2(1.0, 0.0);\n bokehKernel[7] = vec2(0.809017, 0.58778524);\n bokehKernel[8] = vec2(0.30901697, 0.95105654);\n bokehKernel[9] = vec2(-0.30901703, 0.9510565);\n bokehKernel[10] = vec2(-0.80901706, 0.5877852);\n bokehKernel[11] = vec2(-1.0, 0.0);\n bokehKernel[12] = vec2(-0.80901694, -0.58778536);\n bokehKernel[13] = vec2(-0.30901664, -0.9510566);\n bokehKernel[14] = vec2(0.30901712, -0.9510565);\n bokehKernel[15] = vec2(0.80901694, -0.5877853);\n}\nfloat Weigh (float coc, float dist) {\n return saturate((abs(coc) - dist + 2.0) / 2.0);\n}\nvoid Accumulate(float coc, vec2 displacement, inout vec4 farAcc, inout vec4 nearAcc) {\n float dist = length(displacement);\n vec2 offset = displacement * mainTexTexelSize.xy * 2.0;\n vec4 prefilterColor = texture2D(prefilterTex, v_uv + offset);\n prefilterColor.a = Uint8ToFloat(prefilterColor.a) * bokehRadius;\n float fw = Weigh(max(0.0, min(prefilterColor.a, coc)), dist);\n farAcc.rgb += prefilterColor.rgb * fw;\n farAcc.a += fw;\n float nw = Weigh(-prefilterColor.a, dist);\n nearAcc.rgb += prefilterColor.rgb * nw;\n nearAcc.a += nw;\n}\nvoid main () {\n initKernel();\n float coc = Uint8ToFloat(texture2D(prefilterTex, v_uv).a) * bokehRadius;\n vec4 farAcc = vec4(0.0);\n vec4 nearAcc = vec4(0.0);\n for (int k = 0; k < SAMPLE_COUNT; k++) {\n vec2 displacement = bokehKernel[k] * bokehRadius;\n Accumulate(coc, displacement, farAcc, nearAcc);\n }\n farAcc.rgb *= 1.0 / (farAcc.a + (farAcc.a == 0.0 ? 1.0 : 0.0));\n nearAcc.rgb *= 1.0 / (nearAcc.a + (nearAcc.a == 0.0 ? 1.0 : 0.0));\n float alpha = min(1.0, nearAcc.a * PI / float(SAMPLE_COUNT));\n vec3 rgb = mix(farAcc.rgb, nearAcc.rgb, alpha);\n gl_FragColor = vec4(rgb, alpha);\n}"
  1832. },
  1833. "builtins": {
  1834. "globals": {
  1835. "blocks": [
  1836. {
  1837. "name": "CCGlobal",
  1838. "defines": []
  1839. },
  1840. {
  1841. "name": "CCCamera",
  1842. "defines": []
  1843. }
  1844. ],
  1845. "samplerTextures": [],
  1846. "buffers": [],
  1847. "images": []
  1848. },
  1849. "locals": {
  1850. "blocks": [],
  1851. "samplerTextures": [],
  1852. "buffers": [],
  1853. "images": []
  1854. },
  1855. "statistics": {
  1856. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  1857. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 2
  1858. }
  1859. },
  1860. "defines": [
  1861. {
  1862. "name": "USE_INSTANCING",
  1863. "type": "boolean",
  1864. "defines": [],
  1865. "editor": {
  1866. "elevated": true
  1867. }
  1868. },
  1869. {
  1870. "name": "CC_USE_SKINNING",
  1871. "type": "boolean",
  1872. "defines": []
  1873. },
  1874. {
  1875. "name": "CC_USE_BAKED_ANIMATION",
  1876. "type": "boolean",
  1877. "defines": [
  1878. "USE_INSTANCING"
  1879. ]
  1880. },
  1881. {
  1882. "name": "CC_USE_LIGHTMAP",
  1883. "type": "boolean",
  1884. "defines": [
  1885. "USE_INSTANCING"
  1886. ]
  1887. },
  1888. {
  1889. "name": "CC_USE_REFLECTION_PROBE",
  1890. "type": "boolean",
  1891. "defines": [
  1892. "USE_INSTANCING"
  1893. ]
  1894. },
  1895. {
  1896. "name": "CC_RECEIVE_SHADOW",
  1897. "type": "boolean",
  1898. "defines": [
  1899. "USE_INSTANCING"
  1900. ]
  1901. },
  1902. {
  1903. "name": "CC_USE_LIGHT_PROBE",
  1904. "type": "boolean",
  1905. "defines": [
  1906. "USE_INSTANCING"
  1907. ]
  1908. },
  1909. {
  1910. "name": "CC_USE_MORPH",
  1911. "type": "boolean",
  1912. "defines": []
  1913. }
  1914. ],
  1915. "name": "pipeline/post-process/dof|dof-vs|dof-bokeh-fs"
  1916. },
  1917. {
  1918. "blocks": [
  1919. {
  1920. "name": "ColorGradingUBO",
  1921. "members": [
  1922. {
  1923. "name": "cocParams",
  1924. "type": 16,
  1925. "count": 1
  1926. },
  1927. {
  1928. "name": "mainTexTexelSize",
  1929. "type": 16,
  1930. "count": 1
  1931. }
  1932. ],
  1933. "defines": [],
  1934. "stageFlags": 16,
  1935. "binding": 0
  1936. }
  1937. ],
  1938. "samplerTextures": [],
  1939. "samplers": [],
  1940. "textures": [],
  1941. "buffers": [],
  1942. "images": [],
  1943. "subpassInputs": [],
  1944. "attributes": [
  1945. {
  1946. "name": "a_position",
  1947. "defines": [],
  1948. "format": 32,
  1949. "location": 0
  1950. },
  1951. {
  1952. "name": "a_normal",
  1953. "defines": [],
  1954. "format": 32,
  1955. "location": 1
  1956. },
  1957. {
  1958. "name": "a_texCoord",
  1959. "defines": [],
  1960. "format": 21,
  1961. "location": 2
  1962. },
  1963. {
  1964. "name": "a_tangent",
  1965. "defines": [],
  1966. "format": 44,
  1967. "location": 3
  1968. },
  1969. {
  1970. "name": "a_joints",
  1971. "defines": [
  1972. "CC_USE_SKINNING"
  1973. ],
  1974. "location": 4
  1975. },
  1976. {
  1977. "name": "a_weights",
  1978. "defines": [
  1979. "CC_USE_SKINNING"
  1980. ],
  1981. "format": 44,
  1982. "location": 5
  1983. },
  1984. {
  1985. "name": "a_jointAnimInfo",
  1986. "defines": [
  1987. "USE_INSTANCING",
  1988. "CC_USE_BAKED_ANIMATION"
  1989. ],
  1990. "format": 44,
  1991. "isInstanced": true,
  1992. "location": 6
  1993. },
  1994. {
  1995. "name": "a_matWorld0",
  1996. "defines": [
  1997. "USE_INSTANCING"
  1998. ],
  1999. "format": 44,
  2000. "isInstanced": true,
  2001. "location": 7
  2002. },
  2003. {
  2004. "name": "a_matWorld1",
  2005. "defines": [
  2006. "USE_INSTANCING"
  2007. ],
  2008. "format": 44,
  2009. "isInstanced": true,
  2010. "location": 8
  2011. },
  2012. {
  2013. "name": "a_matWorld2",
  2014. "defines": [
  2015. "USE_INSTANCING"
  2016. ],
  2017. "format": 44,
  2018. "isInstanced": true,
  2019. "location": 9
  2020. },
  2021. {
  2022. "name": "a_lightingMapUVParam",
  2023. "defines": [
  2024. "USE_INSTANCING",
  2025. "CC_USE_LIGHTMAP"
  2026. ],
  2027. "format": 44,
  2028. "isInstanced": true,
  2029. "location": 10
  2030. },
  2031. {
  2032. "name": "a_localShadowBiasAndProbeId",
  2033. "defines": [
  2034. "USE_INSTANCING"
  2035. ],
  2036. "format": 44,
  2037. "isInstanced": true,
  2038. "location": 11
  2039. },
  2040. {
  2041. "name": "a_reflectionProbeData",
  2042. "defines": [
  2043. "USE_INSTANCING",
  2044. "CC_USE_REFLECTION_PROBE"
  2045. ],
  2046. "format": 44,
  2047. "isInstanced": true,
  2048. "location": 12
  2049. },
  2050. {
  2051. "name": "a_sh_linear_const_r",
  2052. "defines": [
  2053. "USE_INSTANCING",
  2054. "CC_USE_LIGHT_PROBE"
  2055. ],
  2056. "format": 44,
  2057. "isInstanced": true,
  2058. "location": 13
  2059. },
  2060. {
  2061. "name": "a_sh_linear_const_g",
  2062. "defines": [
  2063. "USE_INSTANCING",
  2064. "CC_USE_LIGHT_PROBE"
  2065. ],
  2066. "format": 44,
  2067. "isInstanced": true,
  2068. "location": 14
  2069. },
  2070. {
  2071. "name": "a_sh_linear_const_b",
  2072. "defines": [
  2073. "USE_INSTANCING",
  2074. "CC_USE_LIGHT_PROBE"
  2075. ],
  2076. "format": 44,
  2077. "isInstanced": true,
  2078. "location": 15
  2079. },
  2080. {
  2081. "name": "a_vertexId",
  2082. "defines": [
  2083. "CC_USE_MORPH"
  2084. ],
  2085. "format": 11,
  2086. "location": 16
  2087. }
  2088. ],
  2089. "varyings": [
  2090. {
  2091. "name": "v_uv",
  2092. "type": 14,
  2093. "count": 1,
  2094. "defines": [],
  2095. "stageFlags": 17,
  2096. "location": 0
  2097. }
  2098. ],
  2099. "fragColors": [
  2100. {
  2101. "name": "fragColor",
  2102. "typename": "vec4",
  2103. "type": 16,
  2104. "count": 1,
  2105. "defines": [],
  2106. "stageFlags": 16,
  2107. "location": 0
  2108. }
  2109. ],
  2110. "descriptors": [
  2111. {
  2112. "rate": 0,
  2113. "blocks": [],
  2114. "samplerTextures": [],
  2115. "samplers": [],
  2116. "textures": [],
  2117. "buffers": [],
  2118. "images": [],
  2119. "subpassInputs": []
  2120. },
  2121. {
  2122. "rate": 1,
  2123. "blocks": [
  2124. {
  2125. "name": "ColorGradingUBO",
  2126. "members": [
  2127. {
  2128. "name": "cocParams",
  2129. "type": 16,
  2130. "count": 1
  2131. },
  2132. {
  2133. "name": "mainTexTexelSize",
  2134. "type": 16,
  2135. "count": 1
  2136. }
  2137. ],
  2138. "defines": [],
  2139. "stageFlags": 16,
  2140. "binding": 0
  2141. }
  2142. ],
  2143. "samplerTextures": [],
  2144. "samplers": [],
  2145. "textures": [],
  2146. "buffers": [],
  2147. "images": [],
  2148. "subpassInputs": []
  2149. },
  2150. {
  2151. "rate": 2,
  2152. "blocks": [],
  2153. "samplerTextures": [],
  2154. "samplers": [],
  2155. "textures": [],
  2156. "buffers": [],
  2157. "images": [],
  2158. "subpassInputs": []
  2159. },
  2160. {
  2161. "rate": 3,
  2162. "blocks": [
  2163. {
  2164. "tags": {
  2165. "builtin": "global"
  2166. },
  2167. "name": "CCGlobal",
  2168. "members": [
  2169. {
  2170. "name": "cc_time",
  2171. "typename": "vec4",
  2172. "type": 16,
  2173. "count": 1,
  2174. "precision": "highp "
  2175. },
  2176. {
  2177. "name": "cc_screenSize",
  2178. "typename": "vec4",
  2179. "type": 16,
  2180. "count": 1,
  2181. "precision": "mediump "
  2182. },
  2183. {
  2184. "name": "cc_nativeSize",
  2185. "typename": "vec4",
  2186. "type": 16,
  2187. "count": 1,
  2188. "precision": "mediump "
  2189. },
  2190. {
  2191. "name": "cc_probeInfo",
  2192. "typename": "vec4",
  2193. "type": 16,
  2194. "count": 1,
  2195. "precision": "mediump "
  2196. },
  2197. {
  2198. "name": "cc_debug_view_mode",
  2199. "typename": "vec4",
  2200. "type": 16,
  2201. "count": 1,
  2202. "precision": "mediump "
  2203. }
  2204. ],
  2205. "defines": [],
  2206. "stageFlags": 1
  2207. },
  2208. {
  2209. "tags": {
  2210. "builtin": "global"
  2211. },
  2212. "name": "CCCamera",
  2213. "members": [
  2214. {
  2215. "name": "cc_matView",
  2216. "typename": "mat4",
  2217. "type": 25,
  2218. "count": 1,
  2219. "precision": "highp "
  2220. },
  2221. {
  2222. "name": "cc_matViewInv",
  2223. "typename": "mat4",
  2224. "type": 25,
  2225. "count": 1,
  2226. "precision": "highp "
  2227. },
  2228. {
  2229. "name": "cc_matProj",
  2230. "typename": "mat4",
  2231. "type": 25,
  2232. "count": 1,
  2233. "precision": "highp "
  2234. },
  2235. {
  2236. "name": "cc_matProjInv",
  2237. "typename": "mat4",
  2238. "type": 25,
  2239. "count": 1,
  2240. "precision": "highp "
  2241. },
  2242. {
  2243. "name": "cc_matViewProj",
  2244. "typename": "mat4",
  2245. "type": 25,
  2246. "count": 1,
  2247. "precision": "highp "
  2248. },
  2249. {
  2250. "name": "cc_matViewProjInv",
  2251. "typename": "mat4",
  2252. "type": 25,
  2253. "count": 1,
  2254. "precision": "highp "
  2255. },
  2256. {
  2257. "name": "cc_cameraPos",
  2258. "typename": "vec4",
  2259. "type": 16,
  2260. "count": 1,
  2261. "precision": "highp "
  2262. },
  2263. {
  2264. "name": "cc_surfaceTransform",
  2265. "typename": "vec4",
  2266. "type": 16,
  2267. "count": 1,
  2268. "precision": "mediump "
  2269. },
  2270. {
  2271. "name": "cc_screenScale",
  2272. "typename": "vec4",
  2273. "type": 16,
  2274. "count": 1,
  2275. "precision": "mediump "
  2276. },
  2277. {
  2278. "name": "cc_exposure",
  2279. "typename": "vec4",
  2280. "type": 16,
  2281. "count": 1,
  2282. "precision": "mediump "
  2283. },
  2284. {
  2285. "name": "cc_mainLitDir",
  2286. "typename": "vec4",
  2287. "type": 16,
  2288. "count": 1,
  2289. "precision": "mediump "
  2290. },
  2291. {
  2292. "name": "cc_mainLitColor",
  2293. "typename": "vec4",
  2294. "type": 16,
  2295. "count": 1,
  2296. "precision": "mediump "
  2297. },
  2298. {
  2299. "name": "cc_ambientSky",
  2300. "typename": "vec4",
  2301. "type": 16,
  2302. "count": 1,
  2303. "precision": "mediump "
  2304. },
  2305. {
  2306. "name": "cc_ambientGround",
  2307. "typename": "vec4",
  2308. "type": 16,
  2309. "count": 1,
  2310. "precision": "mediump "
  2311. },
  2312. {
  2313. "name": "cc_fogColor",
  2314. "typename": "vec4",
  2315. "type": 16,
  2316. "count": 1,
  2317. "precision": "mediump "
  2318. },
  2319. {
  2320. "name": "cc_fogBase",
  2321. "typename": "vec4",
  2322. "type": 16,
  2323. "count": 1,
  2324. "precision": "mediump "
  2325. },
  2326. {
  2327. "name": "cc_fogAdd",
  2328. "typename": "vec4",
  2329. "type": 16,
  2330. "count": 1,
  2331. "precision": "mediump "
  2332. },
  2333. {
  2334. "name": "cc_nearFar",
  2335. "typename": "vec4",
  2336. "type": 16,
  2337. "count": 1,
  2338. "precision": "mediump "
  2339. },
  2340. {
  2341. "name": "cc_viewPort",
  2342. "typename": "vec4",
  2343. "type": 16,
  2344. "count": 1,
  2345. "precision": "mediump "
  2346. }
  2347. ],
  2348. "defines": [],
  2349. "stageFlags": 1
  2350. }
  2351. ],
  2352. "samplerTextures": [
  2353. {
  2354. "name": "colorTex",
  2355. "type": 28,
  2356. "count": 1,
  2357. "defines": [],
  2358. "stageFlags": 16,
  2359. "binding": 1
  2360. },
  2361. {
  2362. "name": "cocTex",
  2363. "type": 28,
  2364. "count": 1,
  2365. "defines": [],
  2366. "stageFlags": 16,
  2367. "binding": 2
  2368. },
  2369. {
  2370. "name": "prefilterTex",
  2371. "type": 28,
  2372. "count": 1,
  2373. "defines": [],
  2374. "stageFlags": 16,
  2375. "binding": 3
  2376. },
  2377. {
  2378. "name": "bokehTex",
  2379. "type": 28,
  2380. "count": 1,
  2381. "defines": [],
  2382. "stageFlags": 16,
  2383. "binding": 4
  2384. },
  2385. {
  2386. "name": "filterTex",
  2387. "type": 28,
  2388. "count": 1,
  2389. "defines": [],
  2390. "stageFlags": 16,
  2391. "binding": 5
  2392. }
  2393. ],
  2394. "samplers": [],
  2395. "textures": [],
  2396. "buffers": [],
  2397. "images": [],
  2398. "subpassInputs": []
  2399. }
  2400. ],
  2401. "hash": 1818630088,
  2402. "glsl4": {
  2403. "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}",
  2404. "frag": "\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\nlayout(set = 1, binding = 0) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nlayout(set = 1, binding = 1) uniform sampler2D colorTex;\nlayout(set = 1, binding = 2) uniform sampler2D cocTex;\nlayout(set = 1, binding = 3) uniform sampler2D prefilterTex;\nlayout(set = 1, binding = 4) uniform sampler2D bokehTex;\nlayout(set = 1, binding = 5) uniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main () {\n vec4 o = mainTexTexelSize.xyxy * 2.0 * vec2(-0.5, 0.5).xxyy;\n vec4 s =\n texture(bokehTex, v_uv + o.xy) +\n texture(bokehTex, v_uv + o.zy) +\n texture(bokehTex, v_uv + o.xw) +\n texture(bokehTex, v_uv + o.zw);\n fragColor = s * 0.25;\n}"
  2405. },
  2406. "glsl3": {
  2407. "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}",
  2408. "frag": "\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\nlayout(std140) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main () {\n vec4 o = mainTexTexelSize.xyxy * 2.0 * vec2(-0.5, 0.5).xxyy;\n vec4 s =\n texture(bokehTex, v_uv + o.xy) +\n texture(bokehTex, v_uv + o.zy) +\n texture(bokehTex, v_uv + o.xw) +\n texture(bokehTex, v_uv + o.zw);\n fragColor = s * 0.25;\n}"
  2409. },
  2410. "glsl1": {
  2411. "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}",
  2412. "frag": "\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\n uniform vec4 cocParams;\n uniform vec4 mainTexTexelSize;\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nvarying vec2 v_uv;\nvoid main () {\n vec4 o = mainTexTexelSize.xyxy * 2.0 * vec2(-0.5, 0.5).xxyy;\n vec4 s =\n texture2D(bokehTex, v_uv + o.xy) +\n texture2D(bokehTex, v_uv + o.zy) +\n texture2D(bokehTex, v_uv + o.xw) +\n texture2D(bokehTex, v_uv + o.zw);\n gl_FragColor = s * 0.25;\n}"
  2413. },
  2414. "builtins": {
  2415. "globals": {
  2416. "blocks": [
  2417. {
  2418. "name": "CCGlobal",
  2419. "defines": []
  2420. },
  2421. {
  2422. "name": "CCCamera",
  2423. "defines": []
  2424. }
  2425. ],
  2426. "samplerTextures": [],
  2427. "buffers": [],
  2428. "images": []
  2429. },
  2430. "locals": {
  2431. "blocks": [],
  2432. "samplerTextures": [],
  2433. "buffers": [],
  2434. "images": []
  2435. },
  2436. "statistics": {
  2437. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  2438. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 2
  2439. }
  2440. },
  2441. "defines": [
  2442. {
  2443. "name": "USE_INSTANCING",
  2444. "type": "boolean",
  2445. "defines": [],
  2446. "editor": {
  2447. "elevated": true
  2448. }
  2449. },
  2450. {
  2451. "name": "CC_USE_SKINNING",
  2452. "type": "boolean",
  2453. "defines": []
  2454. },
  2455. {
  2456. "name": "CC_USE_BAKED_ANIMATION",
  2457. "type": "boolean",
  2458. "defines": [
  2459. "USE_INSTANCING"
  2460. ]
  2461. },
  2462. {
  2463. "name": "CC_USE_LIGHTMAP",
  2464. "type": "boolean",
  2465. "defines": [
  2466. "USE_INSTANCING"
  2467. ]
  2468. },
  2469. {
  2470. "name": "CC_USE_REFLECTION_PROBE",
  2471. "type": "boolean",
  2472. "defines": [
  2473. "USE_INSTANCING"
  2474. ]
  2475. },
  2476. {
  2477. "name": "CC_RECEIVE_SHADOW",
  2478. "type": "boolean",
  2479. "defines": [
  2480. "USE_INSTANCING"
  2481. ]
  2482. },
  2483. {
  2484. "name": "CC_USE_LIGHT_PROBE",
  2485. "type": "boolean",
  2486. "defines": [
  2487. "USE_INSTANCING"
  2488. ]
  2489. },
  2490. {
  2491. "name": "CC_USE_MORPH",
  2492. "type": "boolean",
  2493. "defines": []
  2494. }
  2495. ],
  2496. "name": "pipeline/post-process/dof|dof-vs|dof-filter-fs"
  2497. },
  2498. {
  2499. "blocks": [
  2500. {
  2501. "name": "ColorGradingUBO",
  2502. "members": [
  2503. {
  2504. "name": "cocParams",
  2505. "type": 16,
  2506. "count": 1
  2507. },
  2508. {
  2509. "name": "mainTexTexelSize",
  2510. "type": 16,
  2511. "count": 1
  2512. }
  2513. ],
  2514. "defines": [],
  2515. "stageFlags": 16,
  2516. "binding": 0
  2517. }
  2518. ],
  2519. "samplerTextures": [],
  2520. "samplers": [],
  2521. "textures": [],
  2522. "buffers": [],
  2523. "images": [],
  2524. "subpassInputs": [],
  2525. "attributes": [
  2526. {
  2527. "name": "a_position",
  2528. "defines": [],
  2529. "format": 32,
  2530. "location": 0
  2531. },
  2532. {
  2533. "name": "a_normal",
  2534. "defines": [],
  2535. "format": 32,
  2536. "location": 1
  2537. },
  2538. {
  2539. "name": "a_texCoord",
  2540. "defines": [],
  2541. "format": 21,
  2542. "location": 2
  2543. },
  2544. {
  2545. "name": "a_tangent",
  2546. "defines": [],
  2547. "format": 44,
  2548. "location": 3
  2549. },
  2550. {
  2551. "name": "a_joints",
  2552. "defines": [
  2553. "CC_USE_SKINNING"
  2554. ],
  2555. "location": 4
  2556. },
  2557. {
  2558. "name": "a_weights",
  2559. "defines": [
  2560. "CC_USE_SKINNING"
  2561. ],
  2562. "format": 44,
  2563. "location": 5
  2564. },
  2565. {
  2566. "name": "a_jointAnimInfo",
  2567. "defines": [
  2568. "USE_INSTANCING",
  2569. "CC_USE_BAKED_ANIMATION"
  2570. ],
  2571. "format": 44,
  2572. "isInstanced": true,
  2573. "location": 6
  2574. },
  2575. {
  2576. "name": "a_matWorld0",
  2577. "defines": [
  2578. "USE_INSTANCING"
  2579. ],
  2580. "format": 44,
  2581. "isInstanced": true,
  2582. "location": 7
  2583. },
  2584. {
  2585. "name": "a_matWorld1",
  2586. "defines": [
  2587. "USE_INSTANCING"
  2588. ],
  2589. "format": 44,
  2590. "isInstanced": true,
  2591. "location": 8
  2592. },
  2593. {
  2594. "name": "a_matWorld2",
  2595. "defines": [
  2596. "USE_INSTANCING"
  2597. ],
  2598. "format": 44,
  2599. "isInstanced": true,
  2600. "location": 9
  2601. },
  2602. {
  2603. "name": "a_lightingMapUVParam",
  2604. "defines": [
  2605. "USE_INSTANCING",
  2606. "CC_USE_LIGHTMAP"
  2607. ],
  2608. "format": 44,
  2609. "isInstanced": true,
  2610. "location": 10
  2611. },
  2612. {
  2613. "name": "a_localShadowBiasAndProbeId",
  2614. "defines": [
  2615. "USE_INSTANCING"
  2616. ],
  2617. "format": 44,
  2618. "isInstanced": true,
  2619. "location": 11
  2620. },
  2621. {
  2622. "name": "a_reflectionProbeData",
  2623. "defines": [
  2624. "USE_INSTANCING",
  2625. "CC_USE_REFLECTION_PROBE"
  2626. ],
  2627. "format": 44,
  2628. "isInstanced": true,
  2629. "location": 12
  2630. },
  2631. {
  2632. "name": "a_sh_linear_const_r",
  2633. "defines": [
  2634. "USE_INSTANCING",
  2635. "CC_USE_LIGHT_PROBE"
  2636. ],
  2637. "format": 44,
  2638. "isInstanced": true,
  2639. "location": 13
  2640. },
  2641. {
  2642. "name": "a_sh_linear_const_g",
  2643. "defines": [
  2644. "USE_INSTANCING",
  2645. "CC_USE_LIGHT_PROBE"
  2646. ],
  2647. "format": 44,
  2648. "isInstanced": true,
  2649. "location": 14
  2650. },
  2651. {
  2652. "name": "a_sh_linear_const_b",
  2653. "defines": [
  2654. "USE_INSTANCING",
  2655. "CC_USE_LIGHT_PROBE"
  2656. ],
  2657. "format": 44,
  2658. "isInstanced": true,
  2659. "location": 15
  2660. },
  2661. {
  2662. "name": "a_vertexId",
  2663. "defines": [
  2664. "CC_USE_MORPH"
  2665. ],
  2666. "format": 11,
  2667. "location": 16
  2668. }
  2669. ],
  2670. "varyings": [
  2671. {
  2672. "name": "v_uv",
  2673. "type": 14,
  2674. "count": 1,
  2675. "defines": [],
  2676. "stageFlags": 17,
  2677. "location": 0
  2678. }
  2679. ],
  2680. "fragColors": [
  2681. {
  2682. "name": "fragColor",
  2683. "typename": "vec4",
  2684. "type": 16,
  2685. "count": 1,
  2686. "defines": [],
  2687. "stageFlags": 16,
  2688. "location": 0
  2689. }
  2690. ],
  2691. "descriptors": [
  2692. {
  2693. "rate": 0,
  2694. "blocks": [],
  2695. "samplerTextures": [],
  2696. "samplers": [],
  2697. "textures": [],
  2698. "buffers": [],
  2699. "images": [],
  2700. "subpassInputs": []
  2701. },
  2702. {
  2703. "rate": 1,
  2704. "blocks": [
  2705. {
  2706. "name": "ColorGradingUBO",
  2707. "members": [
  2708. {
  2709. "name": "cocParams",
  2710. "type": 16,
  2711. "count": 1
  2712. },
  2713. {
  2714. "name": "mainTexTexelSize",
  2715. "type": 16,
  2716. "count": 1
  2717. }
  2718. ],
  2719. "defines": [],
  2720. "stageFlags": 16,
  2721. "binding": 0
  2722. }
  2723. ],
  2724. "samplerTextures": [],
  2725. "samplers": [],
  2726. "textures": [],
  2727. "buffers": [],
  2728. "images": [],
  2729. "subpassInputs": []
  2730. },
  2731. {
  2732. "rate": 2,
  2733. "blocks": [],
  2734. "samplerTextures": [],
  2735. "samplers": [],
  2736. "textures": [],
  2737. "buffers": [],
  2738. "images": [],
  2739. "subpassInputs": []
  2740. },
  2741. {
  2742. "rate": 3,
  2743. "blocks": [
  2744. {
  2745. "tags": {
  2746. "builtin": "global"
  2747. },
  2748. "name": "CCGlobal",
  2749. "members": [
  2750. {
  2751. "name": "cc_time",
  2752. "typename": "vec4",
  2753. "type": 16,
  2754. "count": 1,
  2755. "precision": "highp "
  2756. },
  2757. {
  2758. "name": "cc_screenSize",
  2759. "typename": "vec4",
  2760. "type": 16,
  2761. "count": 1,
  2762. "precision": "mediump "
  2763. },
  2764. {
  2765. "name": "cc_nativeSize",
  2766. "typename": "vec4",
  2767. "type": 16,
  2768. "count": 1,
  2769. "precision": "mediump "
  2770. },
  2771. {
  2772. "name": "cc_probeInfo",
  2773. "typename": "vec4",
  2774. "type": 16,
  2775. "count": 1,
  2776. "precision": "mediump "
  2777. },
  2778. {
  2779. "name": "cc_debug_view_mode",
  2780. "typename": "vec4",
  2781. "type": 16,
  2782. "count": 1,
  2783. "precision": "mediump "
  2784. }
  2785. ],
  2786. "defines": [],
  2787. "stageFlags": 1
  2788. },
  2789. {
  2790. "tags": {
  2791. "builtin": "global"
  2792. },
  2793. "name": "CCCamera",
  2794. "members": [
  2795. {
  2796. "name": "cc_matView",
  2797. "typename": "mat4",
  2798. "type": 25,
  2799. "count": 1,
  2800. "precision": "highp "
  2801. },
  2802. {
  2803. "name": "cc_matViewInv",
  2804. "typename": "mat4",
  2805. "type": 25,
  2806. "count": 1,
  2807. "precision": "highp "
  2808. },
  2809. {
  2810. "name": "cc_matProj",
  2811. "typename": "mat4",
  2812. "type": 25,
  2813. "count": 1,
  2814. "precision": "highp "
  2815. },
  2816. {
  2817. "name": "cc_matProjInv",
  2818. "typename": "mat4",
  2819. "type": 25,
  2820. "count": 1,
  2821. "precision": "highp "
  2822. },
  2823. {
  2824. "name": "cc_matViewProj",
  2825. "typename": "mat4",
  2826. "type": 25,
  2827. "count": 1,
  2828. "precision": "highp "
  2829. },
  2830. {
  2831. "name": "cc_matViewProjInv",
  2832. "typename": "mat4",
  2833. "type": 25,
  2834. "count": 1,
  2835. "precision": "highp "
  2836. },
  2837. {
  2838. "name": "cc_cameraPos",
  2839. "typename": "vec4",
  2840. "type": 16,
  2841. "count": 1,
  2842. "precision": "highp "
  2843. },
  2844. {
  2845. "name": "cc_surfaceTransform",
  2846. "typename": "vec4",
  2847. "type": 16,
  2848. "count": 1,
  2849. "precision": "mediump "
  2850. },
  2851. {
  2852. "name": "cc_screenScale",
  2853. "typename": "vec4",
  2854. "type": 16,
  2855. "count": 1,
  2856. "precision": "mediump "
  2857. },
  2858. {
  2859. "name": "cc_exposure",
  2860. "typename": "vec4",
  2861. "type": 16,
  2862. "count": 1,
  2863. "precision": "mediump "
  2864. },
  2865. {
  2866. "name": "cc_mainLitDir",
  2867. "typename": "vec4",
  2868. "type": 16,
  2869. "count": 1,
  2870. "precision": "mediump "
  2871. },
  2872. {
  2873. "name": "cc_mainLitColor",
  2874. "typename": "vec4",
  2875. "type": 16,
  2876. "count": 1,
  2877. "precision": "mediump "
  2878. },
  2879. {
  2880. "name": "cc_ambientSky",
  2881. "typename": "vec4",
  2882. "type": 16,
  2883. "count": 1,
  2884. "precision": "mediump "
  2885. },
  2886. {
  2887. "name": "cc_ambientGround",
  2888. "typename": "vec4",
  2889. "type": 16,
  2890. "count": 1,
  2891. "precision": "mediump "
  2892. },
  2893. {
  2894. "name": "cc_fogColor",
  2895. "typename": "vec4",
  2896. "type": 16,
  2897. "count": 1,
  2898. "precision": "mediump "
  2899. },
  2900. {
  2901. "name": "cc_fogBase",
  2902. "typename": "vec4",
  2903. "type": 16,
  2904. "count": 1,
  2905. "precision": "mediump "
  2906. },
  2907. {
  2908. "name": "cc_fogAdd",
  2909. "typename": "vec4",
  2910. "type": 16,
  2911. "count": 1,
  2912. "precision": "mediump "
  2913. },
  2914. {
  2915. "name": "cc_nearFar",
  2916. "typename": "vec4",
  2917. "type": 16,
  2918. "count": 1,
  2919. "precision": "mediump "
  2920. },
  2921. {
  2922. "name": "cc_viewPort",
  2923. "typename": "vec4",
  2924. "type": 16,
  2925. "count": 1,
  2926. "precision": "mediump "
  2927. }
  2928. ],
  2929. "defines": [],
  2930. "stageFlags": 1
  2931. }
  2932. ],
  2933. "samplerTextures": [
  2934. {
  2935. "name": "colorTex",
  2936. "type": 28,
  2937. "count": 1,
  2938. "defines": [],
  2939. "stageFlags": 16,
  2940. "binding": 1
  2941. },
  2942. {
  2943. "name": "cocTex",
  2944. "type": 28,
  2945. "count": 1,
  2946. "defines": [],
  2947. "stageFlags": 16,
  2948. "binding": 2
  2949. },
  2950. {
  2951. "name": "prefilterTex",
  2952. "type": 28,
  2953. "count": 1,
  2954. "defines": [],
  2955. "stageFlags": 16,
  2956. "binding": 3
  2957. },
  2958. {
  2959. "name": "bokehTex",
  2960. "type": 28,
  2961. "count": 1,
  2962. "defines": [],
  2963. "stageFlags": 16,
  2964. "binding": 4
  2965. },
  2966. {
  2967. "name": "filterTex",
  2968. "type": 28,
  2969. "count": 1,
  2970. "defines": [],
  2971. "stageFlags": 16,
  2972. "binding": 5
  2973. }
  2974. ],
  2975. "samplers": [],
  2976. "textures": [],
  2977. "buffers": [],
  2978. "images": [],
  2979. "subpassInputs": []
  2980. }
  2981. ],
  2982. "hash": 1697484540,
  2983. "glsl4": {
  2984. "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}",
  2985. "frag": "\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\nlayout(set = 1, binding = 0) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nlayout(set = 1, binding = 1) uniform sampler2D colorTex;\nlayout(set = 1, binding = 2) uniform sampler2D cocTex;\nlayout(set = 1, binding = 3) uniform sampler2D prefilterTex;\nlayout(set = 1, binding = 4) uniform sampler2D bokehTex;\nlayout(set = 1, binding = 5) uniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nlayout(location = 0) in vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main () {\n vec4 source = texture(colorTex, v_uv);\n float coc = Uint8ToFloat(texture(cocTex, v_uv).r) * bokehRadius;\n vec4 dof = texture(filterTex, v_uv);\n float dofStrength = smoothstep(0.1, 1.0, abs(coc));\n vec3 color = mix(source.rgb, dof.rgb, dofStrength + dof.a - dofStrength * dof.a);\n fragColor = vec4(color.rgb, source.a);\n}"
  2986. },
  2987. "glsl3": {
  2988. "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}",
  2989. "frag": "\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\nlayout(std140) uniform ColorGradingUBO {\n vec4 cocParams;\n vec4 mainTexTexelSize;\n};\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nin vec2 v_uv;\nlayout(location = 0) out vec4 fragColor;\nvoid main () {\n vec4 source = texture(colorTex, v_uv);\n float coc = Uint8ToFloat(texture(cocTex, v_uv).r) * bokehRadius;\n vec4 dof = texture(filterTex, v_uv);\n float dofStrength = smoothstep(0.1, 1.0, abs(coc));\n vec3 color = mix(source.rgb, dof.rgb, dofStrength + dof.a - dofStrength * dof.a);\n fragColor = vec4(color.rgb, source.a);\n}"
  2990. },
  2991. "glsl1": {
  2992. "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}",
  2993. "frag": "\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\n uniform vec4 cocParams;\nuniform sampler2D colorTex;\nuniform sampler2D cocTex;\nuniform sampler2D prefilterTex;\nuniform sampler2D bokehTex;\nuniform sampler2D filterTex;\n#define focusDistance cocParams.x\n#define focusRange cocParams.y\n#define bokehRadius cocParams.z\nfloat Uint8ToFloat(float v) {\n v *= 255.0;\n return ((v - 128.0) / 127.0);\n}\nvarying vec2 v_uv;\nvoid main () {\n vec4 source = texture2D(colorTex, v_uv);\n float coc = Uint8ToFloat(texture2D(cocTex, v_uv).r) * bokehRadius;\n vec4 dof = texture2D(filterTex, v_uv);\n float dofStrength = smoothstep(0.1, 1.0, abs(coc));\n vec3 color = mix(source.rgb, dof.rgb, dofStrength + dof.a - dofStrength * dof.a);\n gl_FragColor = vec4(color.rgb, source.a);\n}"
  2994. },
  2995. "builtins": {
  2996. "globals": {
  2997. "blocks": [
  2998. {
  2999. "name": "CCGlobal",
  3000. "defines": []
  3001. },
  3002. {
  3003. "name": "CCCamera",
  3004. "defines": []
  3005. }
  3006. ],
  3007. "samplerTextures": [],
  3008. "buffers": [],
  3009. "images": []
  3010. },
  3011. "locals": {
  3012. "blocks": [],
  3013. "samplerTextures": [],
  3014. "buffers": [],
  3015. "images": []
  3016. },
  3017. "statistics": {
  3018. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  3019. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 2
  3020. }
  3021. },
  3022. "defines": [
  3023. {
  3024. "name": "USE_INSTANCING",
  3025. "type": "boolean",
  3026. "defines": [],
  3027. "editor": {
  3028. "elevated": true
  3029. }
  3030. },
  3031. {
  3032. "name": "CC_USE_SKINNING",
  3033. "type": "boolean",
  3034. "defines": []
  3035. },
  3036. {
  3037. "name": "CC_USE_BAKED_ANIMATION",
  3038. "type": "boolean",
  3039. "defines": [
  3040. "USE_INSTANCING"
  3041. ]
  3042. },
  3043. {
  3044. "name": "CC_USE_LIGHTMAP",
  3045. "type": "boolean",
  3046. "defines": [
  3047. "USE_INSTANCING"
  3048. ]
  3049. },
  3050. {
  3051. "name": "CC_USE_REFLECTION_PROBE",
  3052. "type": "boolean",
  3053. "defines": [
  3054. "USE_INSTANCING"
  3055. ]
  3056. },
  3057. {
  3058. "name": "CC_RECEIVE_SHADOW",
  3059. "type": "boolean",
  3060. "defines": [
  3061. "USE_INSTANCING"
  3062. ]
  3063. },
  3064. {
  3065. "name": "CC_USE_LIGHT_PROBE",
  3066. "type": "boolean",
  3067. "defines": [
  3068. "USE_INSTANCING"
  3069. ]
  3070. },
  3071. {
  3072. "name": "CC_USE_MORPH",
  3073. "type": "boolean",
  3074. "defines": []
  3075. }
  3076. ],
  3077. "name": "pipeline/post-process/dof|dof-vs|dof-combine-fs"
  3078. }
  3079. ],
  3080. "combinations": [],
  3081. "hideInEditor": false
  3082. }