28d6d6b8-3f66-4a73-9795-17a0852ba2d4.json 277 KB

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