debug.json 146 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362
  1. [
  2. 1,
  3. 0,
  4. 0,
  5. [
  6. [
  7. "cc.EffectAsset",
  8. [
  9. "_name",
  10. "shaders",
  11. "techniques"
  12. ],
  13. 0
  14. ]
  15. ],
  16. [
  17. [
  18. 0,
  19. 0,
  20. 1,
  21. 2,
  22. 4
  23. ]
  24. ],
  25. [
  26. [
  27. 0,
  28. "builtin-unlit",
  29. [
  30. {
  31. "hash": 340555192,
  32. "name": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  33. "blocks": [
  34. {
  35. "name": "TexCoords",
  36. "stageFlags": 1,
  37. "binding": 0,
  38. "members": [
  39. {
  40. "name": "tilingOffset",
  41. "type": 16,
  42. "count": 1
  43. }
  44. ],
  45. "defines": [
  46. "USE_TEXTURE"
  47. ]
  48. },
  49. {
  50. "name": "Constant",
  51. "stageFlags": 16,
  52. "binding": 1,
  53. "members": [
  54. {
  55. "name": "mainColor",
  56. "type": 16,
  57. "count": 1
  58. },
  59. {
  60. "name": "colorScaleAndCutoff",
  61. "type": 16,
  62. "count": 1
  63. }
  64. ],
  65. "defines": []
  66. }
  67. ],
  68. "samplerTextures": [
  69. {
  70. "name": "mainTexture",
  71. "type": 28,
  72. "count": 1,
  73. "stageFlags": 16,
  74. "binding": 2,
  75. "defines": [
  76. "USE_TEXTURE"
  77. ]
  78. }
  79. ],
  80. "samplers": [],
  81. "textures": [],
  82. "buffers": [],
  83. "images": [],
  84. "subpassInputs": [],
  85. "attributes": [
  86. {
  87. "name": "a_position",
  88. "format": 32,
  89. "location": 0,
  90. "defines": []
  91. },
  92. {
  93. "name": "a_normal",
  94. "format": 32,
  95. "location": 1,
  96. "defines": []
  97. },
  98. {
  99. "name": "a_texCoord",
  100. "format": 21,
  101. "location": 2,
  102. "defines": []
  103. },
  104. {
  105. "name": "a_tangent",
  106. "format": 44,
  107. "location": 3,
  108. "defines": []
  109. },
  110. {
  111. "name": "a_joints",
  112. "location": 4,
  113. "defines": [
  114. "CC_USE_SKINNING"
  115. ]
  116. },
  117. {
  118. "name": "a_weights",
  119. "format": 44,
  120. "location": 5,
  121. "defines": [
  122. "CC_USE_SKINNING"
  123. ]
  124. },
  125. {
  126. "name": "a_jointAnimInfo",
  127. "format": 44,
  128. "isInstanced": true,
  129. "location": 6,
  130. "defines": [
  131. "USE_INSTANCING",
  132. "CC_USE_BAKED_ANIMATION"
  133. ]
  134. },
  135. {
  136. "name": "a_matWorld0",
  137. "format": 44,
  138. "isInstanced": true,
  139. "location": 7,
  140. "defines": [
  141. "USE_INSTANCING"
  142. ]
  143. },
  144. {
  145. "name": "a_matWorld1",
  146. "format": 44,
  147. "isInstanced": true,
  148. "location": 8,
  149. "defines": [
  150. "USE_INSTANCING"
  151. ]
  152. },
  153. {
  154. "name": "a_matWorld2",
  155. "format": 44,
  156. "isInstanced": true,
  157. "location": 9,
  158. "defines": [
  159. "USE_INSTANCING"
  160. ]
  161. },
  162. {
  163. "name": "a_lightingMapUVParam",
  164. "format": 44,
  165. "isInstanced": true,
  166. "location": 10,
  167. "defines": [
  168. "USE_INSTANCING",
  169. "CC_USE_LIGHTMAP"
  170. ]
  171. },
  172. {
  173. "name": "a_localShadowBiasAndProbeId",
  174. "format": 44,
  175. "isInstanced": true,
  176. "location": 11,
  177. "defines": [
  178. "USE_INSTANCING"
  179. ]
  180. },
  181. {
  182. "name": "a_reflectionProbeData",
  183. "format": 44,
  184. "isInstanced": true,
  185. "location": 12,
  186. "defines": [
  187. "USE_INSTANCING",
  188. "CC_USE_REFLECTION_PROBE"
  189. ]
  190. },
  191. {
  192. "name": "a_sh_linear_const_r",
  193. "format": 44,
  194. "isInstanced": true,
  195. "location": 13,
  196. "defines": [
  197. "USE_INSTANCING",
  198. "CC_USE_LIGHT_PROBE"
  199. ]
  200. },
  201. {
  202. "name": "a_sh_linear_const_g",
  203. "format": 44,
  204. "isInstanced": true,
  205. "location": 14,
  206. "defines": [
  207. "USE_INSTANCING",
  208. "CC_USE_LIGHT_PROBE"
  209. ]
  210. },
  211. {
  212. "name": "a_sh_linear_const_b",
  213. "format": 44,
  214. "isInstanced": true,
  215. "location": 15,
  216. "defines": [
  217. "USE_INSTANCING",
  218. "CC_USE_LIGHT_PROBE"
  219. ]
  220. },
  221. {
  222. "name": "a_vertexId",
  223. "format": 11,
  224. "location": 16,
  225. "defines": [
  226. "CC_USE_MORPH"
  227. ]
  228. },
  229. {
  230. "name": "a_color",
  231. "format": 44,
  232. "location": 17,
  233. "defines": [
  234. "USE_VERTEX_COLOR"
  235. ]
  236. }
  237. ],
  238. "fragColors": [
  239. {
  240. "name": "cc_FragColor",
  241. "typename": "vec4",
  242. "type": 16,
  243. "count": 1,
  244. "stageFlags": 16,
  245. "location": 0,
  246. "defines": []
  247. }
  248. ],
  249. "descriptors": [
  250. {
  251. "rate": 0,
  252. "blocks": [
  253. {
  254. "name": "CCMorph",
  255. "stageFlags": 1,
  256. "tags": {
  257. "builtin": "local"
  258. },
  259. "members": [
  260. {
  261. "name": "cc_displacementWeights",
  262. "typename": "vec4",
  263. "type": 16,
  264. "count": 15,
  265. "isArray": true
  266. },
  267. {
  268. "name": "cc_displacementTextureInfo",
  269. "typename": "vec4",
  270. "type": 16,
  271. "count": 1
  272. }
  273. ],
  274. "defines": [
  275. "CC_USE_MORPH"
  276. ]
  277. },
  278. {
  279. "name": "CCSkinningTexture",
  280. "stageFlags": 1,
  281. "tags": {
  282. "builtin": "local"
  283. },
  284. "members": [
  285. {
  286. "name": "cc_jointTextureInfo",
  287. "typename": "vec4",
  288. "type": 16,
  289. "count": 1,
  290. "precision": "highp "
  291. }
  292. ],
  293. "defines": [
  294. "CC_USE_SKINNING",
  295. "CC_USE_BAKED_ANIMATION"
  296. ]
  297. },
  298. {
  299. "name": "CCSkinningAnimation",
  300. "stageFlags": 1,
  301. "tags": {
  302. "builtin": "local"
  303. },
  304. "members": [
  305. {
  306. "name": "cc_jointAnimInfo",
  307. "typename": "vec4",
  308. "type": 16,
  309. "count": 1,
  310. "precision": "highp "
  311. }
  312. ],
  313. "defines": [
  314. "CC_USE_SKINNING",
  315. "CC_USE_BAKED_ANIMATION"
  316. ]
  317. },
  318. {
  319. "name": "CCSkinning",
  320. "stageFlags": 1,
  321. "tags": {
  322. "builtin": "local"
  323. },
  324. "members": [
  325. {
  326. "name": "cc_joints",
  327. "typename": "vec4",
  328. "type": 16,
  329. "count": 0,
  330. "precision": "highp ",
  331. "isArray": true
  332. }
  333. ],
  334. "defines": [
  335. "CC_USE_SKINNING",
  336. "!CC_USE_BAKED_ANIMATION",
  337. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  338. ]
  339. },
  340. {
  341. "name": "CCLocal",
  342. "stageFlags": 1,
  343. "tags": {
  344. "builtin": "local"
  345. },
  346. "members": [
  347. {
  348. "name": "cc_matWorld",
  349. "typename": "mat4",
  350. "type": 25,
  351. "count": 1,
  352. "precision": "highp "
  353. },
  354. {
  355. "name": "cc_matWorldIT",
  356. "typename": "mat4",
  357. "type": 25,
  358. "count": 1,
  359. "precision": "highp "
  360. },
  361. {
  362. "name": "cc_lightingMapUVParam",
  363. "typename": "vec4",
  364. "type": 16,
  365. "count": 1,
  366. "precision": "highp "
  367. },
  368. {
  369. "name": "cc_localShadowBias",
  370. "typename": "vec4",
  371. "type": 16,
  372. "count": 1,
  373. "precision": "highp "
  374. },
  375. {
  376. "name": "cc_reflectionProbeData1",
  377. "typename": "vec4",
  378. "type": 16,
  379. "count": 1,
  380. "precision": "highp "
  381. },
  382. {
  383. "name": "cc_reflectionProbeData2",
  384. "typename": "vec4",
  385. "type": 16,
  386. "count": 1,
  387. "precision": "highp "
  388. },
  389. {
  390. "name": "cc_reflectionProbeBlendData1",
  391. "typename": "vec4",
  392. "type": 16,
  393. "count": 1,
  394. "precision": "highp "
  395. },
  396. {
  397. "name": "cc_reflectionProbeBlendData2",
  398. "typename": "vec4",
  399. "type": 16,
  400. "count": 1,
  401. "precision": "highp "
  402. }
  403. ],
  404. "defines": [
  405. "!USE_INSTANCING"
  406. ]
  407. }
  408. ],
  409. "samplerTextures": [
  410. {
  411. "name": "cc_PositionDisplacements",
  412. "typename": "sampler2D",
  413. "type": 28,
  414. "count": 1,
  415. "stageFlags": 1,
  416. "tags": {
  417. "builtin": "local"
  418. },
  419. "defines": [
  420. "CC_USE_MORPH",
  421. "CC_MORPH_TARGET_HAS_POSITION"
  422. ]
  423. },
  424. {
  425. "name": "cc_NormalDisplacements",
  426. "typename": "sampler2D",
  427. "type": 28,
  428. "count": 1,
  429. "stageFlags": 1,
  430. "tags": {
  431. "builtin": "local"
  432. },
  433. "defines": [
  434. "CC_USE_MORPH",
  435. "CC_MORPH_TARGET_HAS_NORMAL"
  436. ]
  437. },
  438. {
  439. "name": "cc_TangentDisplacements",
  440. "typename": "sampler2D",
  441. "type": 28,
  442. "count": 1,
  443. "stageFlags": 1,
  444. "tags": {
  445. "builtin": "local"
  446. },
  447. "defines": [
  448. "CC_USE_MORPH",
  449. "CC_MORPH_TARGET_HAS_TANGENT"
  450. ]
  451. },
  452. {
  453. "name": "cc_jointTexture",
  454. "typename": "sampler2D",
  455. "type": 28,
  456. "count": 1,
  457. "precision": "highp ",
  458. "stageFlags": 1,
  459. "tags": {
  460. "builtin": "local"
  461. },
  462. "defines": [
  463. "CC_USE_SKINNING",
  464. "CC_USE_BAKED_ANIMATION"
  465. ]
  466. },
  467. {
  468. "name": "cc_realtimeJoint",
  469. "typename": "sampler2D",
  470. "type": 28,
  471. "count": 1,
  472. "precision": "highp ",
  473. "stageFlags": 1,
  474. "tags": {
  475. "builtin": "local"
  476. },
  477. "defines": [
  478. "CC_USE_SKINNING",
  479. "!CC_USE_BAKED_ANIMATION",
  480. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  481. ]
  482. }
  483. ],
  484. "samplers": [],
  485. "textures": [],
  486. "buffers": [],
  487. "images": [],
  488. "subpassInputs": []
  489. },
  490. {
  491. "rate": 1,
  492. "blocks": [
  493. {
  494. "name": "TexCoords",
  495. "stageFlags": 1,
  496. "binding": 0,
  497. "members": [
  498. {
  499. "name": "tilingOffset",
  500. "type": 16,
  501. "count": 1
  502. }
  503. ],
  504. "defines": [
  505. "USE_TEXTURE"
  506. ]
  507. },
  508. {
  509. "name": "Constant",
  510. "stageFlags": 16,
  511. "binding": 1,
  512. "members": [
  513. {
  514. "name": "mainColor",
  515. "type": 16,
  516. "count": 1
  517. },
  518. {
  519. "name": "colorScaleAndCutoff",
  520. "type": 16,
  521. "count": 1
  522. }
  523. ],
  524. "defines": []
  525. }
  526. ],
  527. "samplerTextures": [
  528. {
  529. "name": "mainTexture",
  530. "type": 28,
  531. "count": 1,
  532. "stageFlags": 16,
  533. "binding": 2,
  534. "defines": [
  535. "USE_TEXTURE"
  536. ]
  537. }
  538. ],
  539. "samplers": [],
  540. "textures": [],
  541. "buffers": [],
  542. "images": [],
  543. "subpassInputs": []
  544. },
  545. {
  546. "rate": 2,
  547. "blocks": [],
  548. "samplerTextures": [],
  549. "samplers": [],
  550. "textures": [],
  551. "buffers": [],
  552. "images": [],
  553. "subpassInputs": []
  554. },
  555. {
  556. "rate": 3,
  557. "blocks": [
  558. {
  559. "name": "CCGlobal",
  560. "stageFlags": 17,
  561. "tags": {
  562. "builtin": "global"
  563. },
  564. "members": [
  565. {
  566. "name": "cc_time",
  567. "typename": "vec4",
  568. "type": 16,
  569. "count": 1,
  570. "precision": "highp "
  571. },
  572. {
  573. "name": "cc_screenSize",
  574. "typename": "vec4",
  575. "type": 16,
  576. "count": 1,
  577. "precision": "mediump "
  578. },
  579. {
  580. "name": "cc_nativeSize",
  581. "typename": "vec4",
  582. "type": 16,
  583. "count": 1,
  584. "precision": "mediump "
  585. },
  586. {
  587. "name": "cc_probeInfo",
  588. "typename": "vec4",
  589. "type": 16,
  590. "count": 1,
  591. "precision": "mediump "
  592. },
  593. {
  594. "name": "cc_debug_view_mode",
  595. "typename": "vec4",
  596. "type": 16,
  597. "count": 1,
  598. "precision": "mediump "
  599. }
  600. ],
  601. "defines": []
  602. },
  603. {
  604. "name": "CCCamera",
  605. "stageFlags": 17,
  606. "tags": {
  607. "builtin": "global"
  608. },
  609. "members": [
  610. {
  611. "name": "cc_matView",
  612. "typename": "mat4",
  613. "type": 25,
  614. "count": 1,
  615. "precision": "highp "
  616. },
  617. {
  618. "name": "cc_matViewInv",
  619. "typename": "mat4",
  620. "type": 25,
  621. "count": 1,
  622. "precision": "highp "
  623. },
  624. {
  625. "name": "cc_matProj",
  626. "typename": "mat4",
  627. "type": 25,
  628. "count": 1,
  629. "precision": "highp "
  630. },
  631. {
  632. "name": "cc_matProjInv",
  633. "typename": "mat4",
  634. "type": 25,
  635. "count": 1,
  636. "precision": "highp "
  637. },
  638. {
  639. "name": "cc_matViewProj",
  640. "typename": "mat4",
  641. "type": 25,
  642. "count": 1,
  643. "precision": "highp "
  644. },
  645. {
  646. "name": "cc_matViewProjInv",
  647. "typename": "mat4",
  648. "type": 25,
  649. "count": 1,
  650. "precision": "highp "
  651. },
  652. {
  653. "name": "cc_cameraPos",
  654. "typename": "vec4",
  655. "type": 16,
  656. "count": 1,
  657. "precision": "highp "
  658. },
  659. {
  660. "name": "cc_surfaceTransform",
  661. "typename": "vec4",
  662. "type": 16,
  663. "count": 1,
  664. "precision": "mediump "
  665. },
  666. {
  667. "name": "cc_screenScale",
  668. "typename": "vec4",
  669. "type": 16,
  670. "count": 1,
  671. "precision": "mediump "
  672. },
  673. {
  674. "name": "cc_exposure",
  675. "typename": "vec4",
  676. "type": 16,
  677. "count": 1,
  678. "precision": "mediump "
  679. },
  680. {
  681. "name": "cc_mainLitDir",
  682. "typename": "vec4",
  683. "type": 16,
  684. "count": 1,
  685. "precision": "mediump "
  686. },
  687. {
  688. "name": "cc_mainLitColor",
  689. "typename": "vec4",
  690. "type": 16,
  691. "count": 1,
  692. "precision": "mediump "
  693. },
  694. {
  695. "name": "cc_ambientSky",
  696. "typename": "vec4",
  697. "type": 16,
  698. "count": 1,
  699. "precision": "mediump "
  700. },
  701. {
  702. "name": "cc_ambientGround",
  703. "typename": "vec4",
  704. "type": 16,
  705. "count": 1,
  706. "precision": "mediump "
  707. },
  708. {
  709. "name": "cc_fogColor",
  710. "typename": "vec4",
  711. "type": 16,
  712. "count": 1,
  713. "precision": "mediump "
  714. },
  715. {
  716. "name": "cc_fogBase",
  717. "typename": "vec4",
  718. "type": 16,
  719. "count": 1,
  720. "precision": "mediump "
  721. },
  722. {
  723. "name": "cc_fogAdd",
  724. "typename": "vec4",
  725. "type": 16,
  726. "count": 1,
  727. "precision": "mediump "
  728. },
  729. {
  730. "name": "cc_nearFar",
  731. "typename": "vec4",
  732. "type": 16,
  733. "count": 1,
  734. "precision": "mediump "
  735. },
  736. {
  737. "name": "cc_viewPort",
  738. "typename": "vec4",
  739. "type": 16,
  740. "count": 1,
  741. "precision": "mediump "
  742. }
  743. ],
  744. "defines": []
  745. }
  746. ],
  747. "samplerTextures": [],
  748. "samplers": [],
  749. "textures": [],
  750. "buffers": [],
  751. "images": [],
  752. "subpassInputs": []
  753. }
  754. ],
  755. "glsl1": {
  756. "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 vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\nuniform highp mat4 cc_matView;\n uniform highp mat4 cc_matProj;\n uniform highp vec4 cc_cameraPos;\n uniform mediump vec4 cc_fogBase;\n uniform mediump vec4 cc_fogAdd;\n#if !USE_INSTANCING\n uniform highp mat4 cc_matWorld;\n#endif\nvoid CCGetWorldMatrix(out mat4 matWorld)\n{\n #if USE_INSTANCING\n matWorld = mat4(\n vec4(a_matWorld0.xyz, 0.0),\n vec4(a_matWorld1.xyz, 0.0),\n vec4(a_matWorld2.xyz, 0.0),\n vec4(a_matWorld0.w, a_matWorld1.w, a_matWorld2.w, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n #endif\n}\n#if CC_USE_FOG != 4\n float LinearFog(vec4 pos, vec3 cameraPos, float fogStart, float fogEnd) {\n vec4 wPos = pos;\n float cam_dis = distance(cameraPos, wPos.xyz);\n return clamp((fogEnd - cam_dis) / (fogEnd - fogStart), 0., 1.);\n }\n float ExpFog(vec4 pos, vec3 cameraPos, float fogStart, float fogDensity, float fogAtten) {\n vec4 wPos = pos;\n float cam_dis = max(distance(cameraPos, wPos.xyz) - fogStart, 0.0) / fogAtten * 4.;\n float f = exp(-cam_dis * fogDensity);\n return f;\n }\n float ExpSquaredFog(vec4 pos, vec3 cameraPos, float fogStart, float fogDensity, float fogAtten) {\n vec4 wPos = pos;\n float cam_dis = max(distance(cameraPos, wPos.xyz) - fogStart, 0.0) / fogAtten * 4.;\n float f = exp(-cam_dis * cam_dis * fogDensity * fogDensity);\n return f;\n }\n float LayeredFog(vec4 pos, vec3 cameraPos, float fogTop, float fogRange, float fogAtten) {\n vec4 wPos = pos;\n vec3 camWorldProj = cameraPos.xyz;\n camWorldProj.y = 0.;\n vec3 worldPosProj = wPos.xyz;\n worldPosProj.y = 0.;\n float fDeltaD = distance(worldPosProj, camWorldProj) / fogAtten * 2.0;\n float fDeltaY, fDensityIntegral;\n if (cameraPos.y > fogTop) {\n if (wPos.y < fogTop) {\n fDeltaY = (fogTop - wPos.y) / fogRange * 2.0;\n fDensityIntegral = fDeltaY * fDeltaY * 0.5;\n }\n else {\n fDeltaY = 0.;\n fDensityIntegral = 0.;\n }\n }\n else {\n if (wPos.y < fogTop) {\n float fDeltaA = (fogTop - cameraPos.y) / fogRange * 2.;\n float fDeltaB = (fogTop - wPos.y) / fogRange * 2.;\n fDeltaY = abs(fDeltaA - fDeltaB);\n fDensityIntegral = abs((fDeltaA * fDeltaA * 0.5) - (fDeltaB * fDeltaB * 0.5));\n }\n else {\n fDeltaY = abs(fogTop - cameraPos.y) / fogRange * 2.;\n fDensityIntegral = abs(fDeltaY * fDeltaY * 0.5);\n }\n }\n float fDensity;\n if (fDeltaY != 0.) {\n fDensity = (sqrt(1.0 + ((fDeltaD / fDeltaY) * (fDeltaD / fDeltaY)))) * fDensityIntegral;\n }\n else {\n fDensity = 0.;\n }\n float f = exp(-fDensity);\n return f;\n }\n#endif\nvoid CC_TRANSFER_FOG_BASE(vec4 pos, out float factor)\n{\n#if CC_USE_FOG == 0\n\tfactor = LinearFog(pos, cc_cameraPos.xyz, cc_fogBase.x, cc_fogBase.y);\n#elif CC_USE_FOG == 1\n\tfactor = ExpFog(pos, cc_cameraPos.xyz, cc_fogBase.x, cc_fogBase.z, cc_fogAdd.z);\n#elif CC_USE_FOG == 2\n\tfactor = ExpSquaredFog(pos, cc_cameraPos.xyz, cc_fogBase.x, cc_fogBase.z, cc_fogAdd.z);\n#elif CC_USE_FOG == 3\n\tfactor = LayeredFog(pos, cc_cameraPos.xyz, cc_fogAdd.x, cc_fogAdd.y, cc_fogAdd.z);\n#else\n\tfactor = 1.0;\n#endif\n}\n#if !CC_USE_ACCURATE_FOG\nvarying mediump float v_fog_factor;\n#endif\nvoid CC_TRANSFER_FOG(vec4 pos) {\n#if !CC_USE_ACCURATE_FOG\n CC_TRANSFER_FOG_BASE(pos, v_fog_factor);\n#endif\n}\n#if USE_VERTEX_COLOR\n attribute lowp vec4 a_color;\n varying lowp vec4 v_color;\n#endif\n#if USE_TEXTURE\n varying vec2 v_uv;\n uniform vec4 tilingOffset;\n#endif\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld;\n CCGetWorldMatrix(matWorld);\n #if USE_TEXTURE\n v_uv = a_texCoord * tilingOffset.xy + tilingOffset.zw;\n #if SAMPLE_FROM_RT\n v_uv = cc_cameraPos.w > 1.0 ? vec2(v_uv.x, 1.0 - v_uv.y) : v_uv;\n #endif\n #endif\n #if USE_VERTEX_COLOR\n v_color = a_color;\n #endif\n CC_TRANSFER_FOG(matWorld * position);\n return cc_matProj * (cc_matView * matWorld) * position;\n}\nvoid main() { gl_Position = vert(); }",
  757. "frag": "\nprecision highp float;\nvec3 ACESToneMap (vec3 color) {\n color = min(color, vec3(8.0));\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nvec3 SRGBToLinear (vec3 gamma) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return gamma;\n }\n #endif\n#endif\n return gamma * gamma;\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\nvec4 packRGBE (vec3 rgb) {\n highp float maxComp = max(max(rgb.r, rgb.g), rgb.b);\n highp float e = 128.0;\n if (maxComp > 0.0001) {\n e = log(maxComp) / log(1.1);\n e = ceil(e);\n e = clamp(e + 128.0, 0.0, 255.0);\n }\n highp float sc = 1.0 / pow(1.1, e - 128.0);\n vec3 encode = clamp(rgb * sc, vec3(0.0), vec3(1.0)) * 255.0;\n vec3 encode_rounded = floor(encode) + step(encode - floor(encode), vec3(0.5));\n return vec4(encode_rounded, e) / 255.0;\n}\nvec4 CCFragOutput (vec4 color) {\n #if CC_USE_RGBE_OUTPUT\n color = packRGBE(color.rgb);\n #elif !CC_USE_FLOAT_OUTPUT\n #if CC_USE_HDR && CC_TONE_MAPPING_TYPE == HDR_TONE_MAPPING_ACES\n color.rgb = ACESToneMap(color.rgb);\n #endif\n color.rgb = LinearToSRGB(color.rgb);\n #endif\n return color;\n}\nuniform highp vec4 cc_cameraPos;\n uniform mediump vec4 cc_fogColor;\n uniform mediump vec4 cc_fogBase;\n uniform mediump vec4 cc_fogAdd;\n#if CC_USE_FOG != 4\n float LinearFog(vec4 pos, vec3 cameraPos, float fogStart, float fogEnd) {\n vec4 wPos = pos;\n float cam_dis = distance(cameraPos, wPos.xyz);\n return clamp((fogEnd - cam_dis) / (fogEnd - fogStart), 0., 1.);\n }\n float ExpFog(vec4 pos, vec3 cameraPos, float fogStart, float fogDensity, float fogAtten) {\n vec4 wPos = pos;\n float cam_dis = max(distance(cameraPos, wPos.xyz) - fogStart, 0.0) / fogAtten * 4.;\n float f = exp(-cam_dis * fogDensity);\n return f;\n }\n float ExpSquaredFog(vec4 pos, vec3 cameraPos, float fogStart, float fogDensity, float fogAtten) {\n vec4 wPos = pos;\n float cam_dis = max(distance(cameraPos, wPos.xyz) - fogStart, 0.0) / fogAtten * 4.;\n float f = exp(-cam_dis * cam_dis * fogDensity * fogDensity);\n return f;\n }\n float LayeredFog(vec4 pos, vec3 cameraPos, float fogTop, float fogRange, float fogAtten) {\n vec4 wPos = pos;\n vec3 camWorldProj = cameraPos.xyz;\n camWorldProj.y = 0.;\n vec3 worldPosProj = wPos.xyz;\n worldPosProj.y = 0.;\n float fDeltaD = distance(worldPosProj, camWorldProj) / fogAtten * 2.0;\n float fDeltaY, fDensityIntegral;\n if (cameraPos.y > fogTop) {\n if (wPos.y < fogTop) {\n fDeltaY = (fogTop - wPos.y) / fogRange * 2.0;\n fDensityIntegral = fDeltaY * fDeltaY * 0.5;\n }\n else {\n fDeltaY = 0.;\n fDensityIntegral = 0.;\n }\n }\n else {\n if (wPos.y < fogTop) {\n float fDeltaA = (fogTop - cameraPos.y) / fogRange * 2.;\n float fDeltaB = (fogTop - wPos.y) / fogRange * 2.;\n fDeltaY = abs(fDeltaA - fDeltaB);\n fDensityIntegral = abs((fDeltaA * fDeltaA * 0.5) - (fDeltaB * fDeltaB * 0.5));\n }\n else {\n fDeltaY = abs(fogTop - cameraPos.y) / fogRange * 2.;\n fDensityIntegral = abs(fDeltaY * fDeltaY * 0.5);\n }\n }\n float fDensity;\n if (fDeltaY != 0.) {\n fDensity = (sqrt(1.0 + ((fDeltaD / fDeltaY) * (fDeltaD / fDeltaY)))) * fDensityIntegral;\n }\n else {\n fDensity = 0.;\n }\n float f = exp(-fDensity);\n return f;\n }\n#endif\nvoid CC_TRANSFER_FOG_BASE(vec4 pos, out float factor)\n{\n#if CC_USE_FOG == 0\n\tfactor = LinearFog(pos, cc_cameraPos.xyz, cc_fogBase.x, cc_fogBase.y);\n#elif CC_USE_FOG == 1\n\tfactor = ExpFog(pos, cc_cameraPos.xyz, cc_fogBase.x, cc_fogBase.z, cc_fogAdd.z);\n#elif CC_USE_FOG == 2\n\tfactor = ExpSquaredFog(pos, cc_cameraPos.xyz, cc_fogBase.x, cc_fogBase.z, cc_fogAdd.z);\n#elif CC_USE_FOG == 3\n\tfactor = LayeredFog(pos, cc_cameraPos.xyz, cc_fogAdd.x, cc_fogAdd.y, cc_fogAdd.z);\n#else\n\tfactor = 1.0;\n#endif\n}\nvoid CC_APPLY_FOG_BASE(inout vec4 color, float factor) {\n\tcolor = vec4(mix(cc_fogColor.rgb, color.rgb, factor), color.a);\n}\n#if !CC_USE_ACCURATE_FOG\nvarying mediump float v_fog_factor;\n#endif\nvoid CC_APPLY_FOG(inout vec4 color) {\n#if !CC_USE_ACCURATE_FOG\n CC_APPLY_FOG_BASE(color, v_fog_factor);\n#endif\n}\nvoid CC_APPLY_FOG(inout vec4 color, vec3 worldPos) {\n#if CC_USE_ACCURATE_FOG\n float factor;\n CC_TRANSFER_FOG_BASE(vec4(worldPos, 1.0), factor);\n#else\n float factor = v_fog_factor;\n#endif\n CC_APPLY_FOG_BASE(color, factor);\n}\n#if USE_ALPHA_TEST\n#endif\n#if USE_TEXTURE\n varying vec2 v_uv;\n uniform sampler2D mainTexture;\n#endif\n uniform vec4 mainColor;\n uniform vec4 colorScaleAndCutoff;\n#if USE_VERTEX_COLOR\n varying lowp vec4 v_color;\n#endif\nvec4 frag () {\n vec4 o = mainColor;\n o.rgb *= colorScaleAndCutoff.xyz;\n #if USE_VERTEX_COLOR\n o.rgb *= SRGBToLinear(v_color.rgb);\n o.a *= v_color.a;\n #endif\n #if USE_TEXTURE\n vec4 texColor = texture2D(mainTexture, v_uv);\n texColor.rgb = SRGBToLinear(texColor.rgb);\n o *= texColor;\n #endif\n #if USE_ALPHA_TEST\n if (o.ALPHA_TEST_CHANNEL < colorScaleAndCutoff.w) discard;\n #endif\n CC_APPLY_FOG(o);\n return CCFragOutput(o);\n}\nvoid main() { gl_FragColor = frag(); }"
  758. },
  759. "builtins": {
  760. "globals": {
  761. "blocks": [
  762. {
  763. "name": "CCGlobal",
  764. "defines": []
  765. },
  766. {
  767. "name": "CCCamera",
  768. "defines": []
  769. }
  770. ],
  771. "samplerTextures": [],
  772. "buffers": [],
  773. "images": []
  774. },
  775. "locals": {
  776. "blocks": [
  777. {
  778. "name": "CCMorph",
  779. "defines": [
  780. "CC_USE_MORPH"
  781. ]
  782. },
  783. {
  784. "name": "CCSkinningTexture",
  785. "defines": [
  786. "CC_USE_SKINNING",
  787. "CC_USE_BAKED_ANIMATION"
  788. ]
  789. },
  790. {
  791. "name": "CCSkinningAnimation",
  792. "defines": [
  793. "CC_USE_SKINNING",
  794. "CC_USE_BAKED_ANIMATION"
  795. ]
  796. },
  797. {
  798. "name": "CCSkinning",
  799. "defines": [
  800. "CC_USE_SKINNING",
  801. "!CC_USE_BAKED_ANIMATION",
  802. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  803. ]
  804. },
  805. {
  806. "name": "CCLocal",
  807. "defines": [
  808. "!USE_INSTANCING"
  809. ]
  810. }
  811. ],
  812. "samplerTextures": [
  813. {
  814. "name": "cc_PositionDisplacements",
  815. "defines": [
  816. "CC_USE_MORPH",
  817. "CC_MORPH_TARGET_HAS_POSITION"
  818. ]
  819. },
  820. {
  821. "name": "cc_NormalDisplacements",
  822. "defines": [
  823. "CC_USE_MORPH",
  824. "CC_MORPH_TARGET_HAS_NORMAL"
  825. ]
  826. },
  827. {
  828. "name": "cc_TangentDisplacements",
  829. "defines": [
  830. "CC_USE_MORPH",
  831. "CC_MORPH_TARGET_HAS_TANGENT"
  832. ]
  833. },
  834. {
  835. "name": "cc_jointTexture",
  836. "defines": [
  837. "CC_USE_SKINNING",
  838. "CC_USE_BAKED_ANIMATION"
  839. ]
  840. },
  841. {
  842. "name": "cc_realtimeJoint",
  843. "defines": [
  844. "CC_USE_SKINNING",
  845. "!CC_USE_BAKED_ANIMATION",
  846. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  847. ]
  848. }
  849. ],
  850. "buffers": [],
  851. "images": []
  852. },
  853. "statistics": {
  854. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 75,
  855. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 44
  856. }
  857. },
  858. "defines": [
  859. {
  860. "name": "USE_INSTANCING",
  861. "type": "boolean"
  862. },
  863. {
  864. "name": "CC_USE_SKINNING",
  865. "type": "boolean"
  866. },
  867. {
  868. "name": "CC_USE_BAKED_ANIMATION",
  869. "type": "boolean"
  870. },
  871. {
  872. "name": "CC_USE_LIGHTMAP",
  873. "type": "boolean"
  874. },
  875. {
  876. "name": "CC_USE_REFLECTION_PROBE",
  877. "type": "boolean"
  878. },
  879. {
  880. "name": "CC_RECEIVE_SHADOW",
  881. "type": "boolean"
  882. },
  883. {
  884. "name": "CC_USE_LIGHT_PROBE",
  885. "type": "boolean"
  886. },
  887. {
  888. "name": "CC_USE_MORPH",
  889. "type": "boolean"
  890. },
  891. {
  892. "name": "CC_MORPH_TARGET_COUNT",
  893. "type": "number",
  894. "range": [
  895. 2,
  896. 8
  897. ]
  898. },
  899. {
  900. "name": "CC_MORPH_TARGET_HAS_POSITION",
  901. "type": "boolean"
  902. },
  903. {
  904. "name": "CC_MORPH_TARGET_HAS_NORMAL",
  905. "type": "boolean"
  906. },
  907. {
  908. "name": "CC_MORPH_TARGET_HAS_TANGENT",
  909. "type": "boolean"
  910. },
  911. {
  912. "name": "CC_MORPH_PRECOMPUTED",
  913. "type": "boolean"
  914. },
  915. {
  916. "name": "CC_USE_REAL_TIME_JOINT_TEXTURE",
  917. "type": "boolean"
  918. },
  919. {
  920. "name": "CC_USE_FOG",
  921. "type": "number",
  922. "range": [
  923. 0,
  924. 4
  925. ]
  926. },
  927. {
  928. "name": "CC_USE_ACCURATE_FOG",
  929. "type": "boolean"
  930. },
  931. {
  932. "name": "USE_VERTEX_COLOR",
  933. "type": "boolean"
  934. },
  935. {
  936. "name": "USE_TEXTURE",
  937. "type": "boolean"
  938. },
  939. {
  940. "name": "SAMPLE_FROM_RT",
  941. "type": "boolean"
  942. },
  943. {
  944. "name": "CC_USE_DEBUG_VIEW",
  945. "type": "number",
  946. "range": [
  947. 0,
  948. 3
  949. ]
  950. },
  951. {
  952. "name": "CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC",
  953. "type": "boolean"
  954. },
  955. {
  956. "name": "CC_SURFACES_ENABLE_DEBUG_VIEW",
  957. "type": "boolean"
  958. },
  959. {
  960. "name": "CC_USE_RGBE_OUTPUT",
  961. "type": "boolean"
  962. },
  963. {
  964. "name": "CC_USE_FLOAT_OUTPUT",
  965. "type": "boolean"
  966. },
  967. {
  968. "name": "CC_USE_HDR",
  969. "type": "boolean"
  970. },
  971. {
  972. "name": "CC_TONE_MAPPING_TYPE",
  973. "type": "number",
  974. "range": [
  975. 0,
  976. 3
  977. ]
  978. },
  979. {
  980. "name": "HDR_TONE_MAPPING_ACES",
  981. "type": "boolean"
  982. },
  983. {
  984. "name": "USE_ALPHA_TEST",
  985. "type": "boolean"
  986. },
  987. {
  988. "name": "ALPHA_TEST_CHANNEL",
  989. "type": "string",
  990. "options": [
  991. "a",
  992. "r",
  993. "g",
  994. "b"
  995. ]
  996. }
  997. ]
  998. },
  999. {
  1000. "hash": 3680218420,
  1001. "name": "builtin-unlit|planar-shadow-vs:vert|planar-shadow-fs:frag",
  1002. "blocks": [],
  1003. "samplerTextures": [],
  1004. "samplers": [],
  1005. "textures": [],
  1006. "buffers": [],
  1007. "images": [],
  1008. "subpassInputs": [],
  1009. "attributes": [
  1010. {
  1011. "name": "a_position",
  1012. "format": 32,
  1013. "location": 0,
  1014. "defines": []
  1015. },
  1016. {
  1017. "name": "a_normal",
  1018. "format": 32,
  1019. "location": 1,
  1020. "defines": []
  1021. },
  1022. {
  1023. "name": "a_texCoord",
  1024. "format": 21,
  1025. "location": 2,
  1026. "defines": []
  1027. },
  1028. {
  1029. "name": "a_tangent",
  1030. "format": 44,
  1031. "location": 3,
  1032. "defines": []
  1033. },
  1034. {
  1035. "name": "a_joints",
  1036. "location": 4,
  1037. "defines": [
  1038. "CC_USE_SKINNING"
  1039. ]
  1040. },
  1041. {
  1042. "name": "a_weights",
  1043. "format": 44,
  1044. "location": 5,
  1045. "defines": [
  1046. "CC_USE_SKINNING"
  1047. ]
  1048. },
  1049. {
  1050. "name": "a_jointAnimInfo",
  1051. "format": 44,
  1052. "isInstanced": true,
  1053. "location": 6,
  1054. "defines": [
  1055. "USE_INSTANCING",
  1056. "CC_USE_BAKED_ANIMATION"
  1057. ]
  1058. },
  1059. {
  1060. "name": "a_matWorld0",
  1061. "format": 44,
  1062. "isInstanced": true,
  1063. "location": 7,
  1064. "defines": [
  1065. "USE_INSTANCING"
  1066. ]
  1067. },
  1068. {
  1069. "name": "a_matWorld1",
  1070. "format": 44,
  1071. "isInstanced": true,
  1072. "location": 8,
  1073. "defines": [
  1074. "USE_INSTANCING"
  1075. ]
  1076. },
  1077. {
  1078. "name": "a_matWorld2",
  1079. "format": 44,
  1080. "isInstanced": true,
  1081. "location": 9,
  1082. "defines": [
  1083. "USE_INSTANCING"
  1084. ]
  1085. },
  1086. {
  1087. "name": "a_lightingMapUVParam",
  1088. "format": 44,
  1089. "isInstanced": true,
  1090. "location": 10,
  1091. "defines": [
  1092. "USE_INSTANCING",
  1093. "CC_USE_LIGHTMAP"
  1094. ]
  1095. },
  1096. {
  1097. "name": "a_localShadowBiasAndProbeId",
  1098. "format": 44,
  1099. "isInstanced": true,
  1100. "location": 11,
  1101. "defines": [
  1102. "USE_INSTANCING"
  1103. ]
  1104. },
  1105. {
  1106. "name": "a_reflectionProbeData",
  1107. "format": 44,
  1108. "isInstanced": true,
  1109. "location": 12,
  1110. "defines": [
  1111. "USE_INSTANCING",
  1112. "CC_USE_REFLECTION_PROBE"
  1113. ]
  1114. },
  1115. {
  1116. "name": "a_sh_linear_const_r",
  1117. "format": 44,
  1118. "isInstanced": true,
  1119. "location": 13,
  1120. "defines": [
  1121. "USE_INSTANCING",
  1122. "CC_USE_LIGHT_PROBE"
  1123. ]
  1124. },
  1125. {
  1126. "name": "a_sh_linear_const_g",
  1127. "format": 44,
  1128. "isInstanced": true,
  1129. "location": 14,
  1130. "defines": [
  1131. "USE_INSTANCING",
  1132. "CC_USE_LIGHT_PROBE"
  1133. ]
  1134. },
  1135. {
  1136. "name": "a_sh_linear_const_b",
  1137. "format": 44,
  1138. "isInstanced": true,
  1139. "location": 15,
  1140. "defines": [
  1141. "USE_INSTANCING",
  1142. "CC_USE_LIGHT_PROBE"
  1143. ]
  1144. },
  1145. {
  1146. "name": "a_vertexId",
  1147. "format": 11,
  1148. "location": 16,
  1149. "defines": [
  1150. "CC_USE_MORPH"
  1151. ]
  1152. }
  1153. ],
  1154. "fragColors": [
  1155. {
  1156. "name": "cc_FragColor",
  1157. "typename": "vec4",
  1158. "type": 16,
  1159. "count": 1,
  1160. "stageFlags": 16,
  1161. "location": 0,
  1162. "defines": []
  1163. }
  1164. ],
  1165. "descriptors": [
  1166. {
  1167. "rate": 0,
  1168. "blocks": [
  1169. {
  1170. "name": "CCMorph",
  1171. "stageFlags": 1,
  1172. "tags": {
  1173. "builtin": "local"
  1174. },
  1175. "members": [
  1176. {
  1177. "name": "cc_displacementWeights",
  1178. "typename": "vec4",
  1179. "type": 16,
  1180. "count": 15,
  1181. "isArray": true
  1182. },
  1183. {
  1184. "name": "cc_displacementTextureInfo",
  1185. "typename": "vec4",
  1186. "type": 16,
  1187. "count": 1
  1188. }
  1189. ],
  1190. "defines": [
  1191. "CC_USE_MORPH"
  1192. ]
  1193. },
  1194. {
  1195. "name": "CCSkinningTexture",
  1196. "stageFlags": 1,
  1197. "tags": {
  1198. "builtin": "local"
  1199. },
  1200. "members": [
  1201. {
  1202. "name": "cc_jointTextureInfo",
  1203. "typename": "vec4",
  1204. "type": 16,
  1205. "count": 1,
  1206. "precision": "highp "
  1207. }
  1208. ],
  1209. "defines": [
  1210. "CC_USE_SKINNING",
  1211. "CC_USE_BAKED_ANIMATION"
  1212. ]
  1213. },
  1214. {
  1215. "name": "CCSkinningAnimation",
  1216. "stageFlags": 1,
  1217. "tags": {
  1218. "builtin": "local"
  1219. },
  1220. "members": [
  1221. {
  1222. "name": "cc_jointAnimInfo",
  1223. "typename": "vec4",
  1224. "type": 16,
  1225. "count": 1,
  1226. "precision": "highp "
  1227. }
  1228. ],
  1229. "defines": [
  1230. "CC_USE_SKINNING",
  1231. "CC_USE_BAKED_ANIMATION"
  1232. ]
  1233. },
  1234. {
  1235. "name": "CCSkinning",
  1236. "stageFlags": 1,
  1237. "tags": {
  1238. "builtin": "local"
  1239. },
  1240. "members": [
  1241. {
  1242. "name": "cc_joints",
  1243. "typename": "vec4",
  1244. "type": 16,
  1245. "count": 0,
  1246. "precision": "highp ",
  1247. "isArray": true
  1248. }
  1249. ],
  1250. "defines": [
  1251. "CC_USE_SKINNING",
  1252. "!CC_USE_BAKED_ANIMATION",
  1253. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  1254. ]
  1255. },
  1256. {
  1257. "name": "CCLocal",
  1258. "stageFlags": 1,
  1259. "tags": {
  1260. "builtin": "local"
  1261. },
  1262. "members": [
  1263. {
  1264. "name": "cc_matWorld",
  1265. "typename": "mat4",
  1266. "type": 25,
  1267. "count": 1,
  1268. "precision": "highp "
  1269. },
  1270. {
  1271. "name": "cc_matWorldIT",
  1272. "typename": "mat4",
  1273. "type": 25,
  1274. "count": 1,
  1275. "precision": "highp "
  1276. },
  1277. {
  1278. "name": "cc_lightingMapUVParam",
  1279. "typename": "vec4",
  1280. "type": 16,
  1281. "count": 1,
  1282. "precision": "highp "
  1283. },
  1284. {
  1285. "name": "cc_localShadowBias",
  1286. "typename": "vec4",
  1287. "type": 16,
  1288. "count": 1,
  1289. "precision": "highp "
  1290. },
  1291. {
  1292. "name": "cc_reflectionProbeData1",
  1293. "typename": "vec4",
  1294. "type": 16,
  1295. "count": 1,
  1296. "precision": "highp "
  1297. },
  1298. {
  1299. "name": "cc_reflectionProbeData2",
  1300. "typename": "vec4",
  1301. "type": 16,
  1302. "count": 1,
  1303. "precision": "highp "
  1304. },
  1305. {
  1306. "name": "cc_reflectionProbeBlendData1",
  1307. "typename": "vec4",
  1308. "type": 16,
  1309. "count": 1,
  1310. "precision": "highp "
  1311. },
  1312. {
  1313. "name": "cc_reflectionProbeBlendData2",
  1314. "typename": "vec4",
  1315. "type": 16,
  1316. "count": 1,
  1317. "precision": "highp "
  1318. }
  1319. ],
  1320. "defines": [
  1321. "!USE_INSTANCING"
  1322. ]
  1323. }
  1324. ],
  1325. "samplerTextures": [
  1326. {
  1327. "name": "cc_PositionDisplacements",
  1328. "typename": "sampler2D",
  1329. "type": 28,
  1330. "count": 1,
  1331. "stageFlags": 1,
  1332. "tags": {
  1333. "builtin": "local"
  1334. },
  1335. "defines": [
  1336. "CC_USE_MORPH",
  1337. "CC_MORPH_TARGET_HAS_POSITION"
  1338. ]
  1339. },
  1340. {
  1341. "name": "cc_NormalDisplacements",
  1342. "typename": "sampler2D",
  1343. "type": 28,
  1344. "count": 1,
  1345. "stageFlags": 1,
  1346. "tags": {
  1347. "builtin": "local"
  1348. },
  1349. "defines": [
  1350. "CC_USE_MORPH",
  1351. "CC_MORPH_TARGET_HAS_NORMAL"
  1352. ]
  1353. },
  1354. {
  1355. "name": "cc_TangentDisplacements",
  1356. "typename": "sampler2D",
  1357. "type": 28,
  1358. "count": 1,
  1359. "stageFlags": 1,
  1360. "tags": {
  1361. "builtin": "local"
  1362. },
  1363. "defines": [
  1364. "CC_USE_MORPH",
  1365. "CC_MORPH_TARGET_HAS_TANGENT"
  1366. ]
  1367. },
  1368. {
  1369. "name": "cc_jointTexture",
  1370. "typename": "sampler2D",
  1371. "type": 28,
  1372. "count": 1,
  1373. "precision": "highp ",
  1374. "stageFlags": 1,
  1375. "tags": {
  1376. "builtin": "local"
  1377. },
  1378. "defines": [
  1379. "CC_USE_SKINNING",
  1380. "CC_USE_BAKED_ANIMATION"
  1381. ]
  1382. },
  1383. {
  1384. "name": "cc_realtimeJoint",
  1385. "typename": "sampler2D",
  1386. "type": 28,
  1387. "count": 1,
  1388. "precision": "highp ",
  1389. "stageFlags": 1,
  1390. "tags": {
  1391. "builtin": "local"
  1392. },
  1393. "defines": [
  1394. "CC_USE_SKINNING",
  1395. "!CC_USE_BAKED_ANIMATION",
  1396. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  1397. ]
  1398. }
  1399. ],
  1400. "samplers": [],
  1401. "textures": [],
  1402. "buffers": [],
  1403. "images": [],
  1404. "subpassInputs": []
  1405. },
  1406. {
  1407. "rate": 1,
  1408. "blocks": [],
  1409. "samplerTextures": [],
  1410. "samplers": [],
  1411. "textures": [],
  1412. "buffers": [],
  1413. "images": [],
  1414. "subpassInputs": []
  1415. },
  1416. {
  1417. "rate": 2,
  1418. "blocks": [],
  1419. "samplerTextures": [],
  1420. "samplers": [],
  1421. "textures": [],
  1422. "buffers": [],
  1423. "images": [],
  1424. "subpassInputs": []
  1425. },
  1426. {
  1427. "rate": 3,
  1428. "blocks": [
  1429. {
  1430. "name": "CCGlobal",
  1431. "stageFlags": 17,
  1432. "tags": {
  1433. "builtin": "global"
  1434. },
  1435. "members": [
  1436. {
  1437. "name": "cc_time",
  1438. "typename": "vec4",
  1439. "type": 16,
  1440. "count": 1,
  1441. "precision": "highp "
  1442. },
  1443. {
  1444. "name": "cc_screenSize",
  1445. "typename": "vec4",
  1446. "type": 16,
  1447. "count": 1,
  1448. "precision": "mediump "
  1449. },
  1450. {
  1451. "name": "cc_nativeSize",
  1452. "typename": "vec4",
  1453. "type": 16,
  1454. "count": 1,
  1455. "precision": "mediump "
  1456. },
  1457. {
  1458. "name": "cc_probeInfo",
  1459. "typename": "vec4",
  1460. "type": 16,
  1461. "count": 1,
  1462. "precision": "mediump "
  1463. },
  1464. {
  1465. "name": "cc_debug_view_mode",
  1466. "typename": "vec4",
  1467. "type": 16,
  1468. "count": 1,
  1469. "precision": "mediump "
  1470. }
  1471. ],
  1472. "defines": []
  1473. },
  1474. {
  1475. "name": "CCCamera",
  1476. "stageFlags": 17,
  1477. "tags": {
  1478. "builtin": "global"
  1479. },
  1480. "members": [
  1481. {
  1482. "name": "cc_matView",
  1483. "typename": "mat4",
  1484. "type": 25,
  1485. "count": 1,
  1486. "precision": "highp "
  1487. },
  1488. {
  1489. "name": "cc_matViewInv",
  1490. "typename": "mat4",
  1491. "type": 25,
  1492. "count": 1,
  1493. "precision": "highp "
  1494. },
  1495. {
  1496. "name": "cc_matProj",
  1497. "typename": "mat4",
  1498. "type": 25,
  1499. "count": 1,
  1500. "precision": "highp "
  1501. },
  1502. {
  1503. "name": "cc_matProjInv",
  1504. "typename": "mat4",
  1505. "type": 25,
  1506. "count": 1,
  1507. "precision": "highp "
  1508. },
  1509. {
  1510. "name": "cc_matViewProj",
  1511. "typename": "mat4",
  1512. "type": 25,
  1513. "count": 1,
  1514. "precision": "highp "
  1515. },
  1516. {
  1517. "name": "cc_matViewProjInv",
  1518. "typename": "mat4",
  1519. "type": 25,
  1520. "count": 1,
  1521. "precision": "highp "
  1522. },
  1523. {
  1524. "name": "cc_cameraPos",
  1525. "typename": "vec4",
  1526. "type": 16,
  1527. "count": 1,
  1528. "precision": "highp "
  1529. },
  1530. {
  1531. "name": "cc_surfaceTransform",
  1532. "typename": "vec4",
  1533. "type": 16,
  1534. "count": 1,
  1535. "precision": "mediump "
  1536. },
  1537. {
  1538. "name": "cc_screenScale",
  1539. "typename": "vec4",
  1540. "type": 16,
  1541. "count": 1,
  1542. "precision": "mediump "
  1543. },
  1544. {
  1545. "name": "cc_exposure",
  1546. "typename": "vec4",
  1547. "type": 16,
  1548. "count": 1,
  1549. "precision": "mediump "
  1550. },
  1551. {
  1552. "name": "cc_mainLitDir",
  1553. "typename": "vec4",
  1554. "type": 16,
  1555. "count": 1,
  1556. "precision": "mediump "
  1557. },
  1558. {
  1559. "name": "cc_mainLitColor",
  1560. "typename": "vec4",
  1561. "type": 16,
  1562. "count": 1,
  1563. "precision": "mediump "
  1564. },
  1565. {
  1566. "name": "cc_ambientSky",
  1567. "typename": "vec4",
  1568. "type": 16,
  1569. "count": 1,
  1570. "precision": "mediump "
  1571. },
  1572. {
  1573. "name": "cc_ambientGround",
  1574. "typename": "vec4",
  1575. "type": 16,
  1576. "count": 1,
  1577. "precision": "mediump "
  1578. },
  1579. {
  1580. "name": "cc_fogColor",
  1581. "typename": "vec4",
  1582. "type": 16,
  1583. "count": 1,
  1584. "precision": "mediump "
  1585. },
  1586. {
  1587. "name": "cc_fogBase",
  1588. "typename": "vec4",
  1589. "type": 16,
  1590. "count": 1,
  1591. "precision": "mediump "
  1592. },
  1593. {
  1594. "name": "cc_fogAdd",
  1595. "typename": "vec4",
  1596. "type": 16,
  1597. "count": 1,
  1598. "precision": "mediump "
  1599. },
  1600. {
  1601. "name": "cc_nearFar",
  1602. "typename": "vec4",
  1603. "type": 16,
  1604. "count": 1,
  1605. "precision": "mediump "
  1606. },
  1607. {
  1608. "name": "cc_viewPort",
  1609. "typename": "vec4",
  1610. "type": 16,
  1611. "count": 1,
  1612. "precision": "mediump "
  1613. }
  1614. ],
  1615. "defines": []
  1616. },
  1617. {
  1618. "name": "CCShadow",
  1619. "stageFlags": 17,
  1620. "tags": {
  1621. "builtin": "global"
  1622. },
  1623. "members": [
  1624. {
  1625. "name": "cc_matLightView",
  1626. "typename": "mat4",
  1627. "type": 25,
  1628. "count": 1,
  1629. "precision": "highp "
  1630. },
  1631. {
  1632. "name": "cc_matLightViewProj",
  1633. "typename": "mat4",
  1634. "type": 25,
  1635. "count": 1,
  1636. "precision": "highp "
  1637. },
  1638. {
  1639. "name": "cc_shadowInvProjDepthInfo",
  1640. "typename": "vec4",
  1641. "type": 16,
  1642. "count": 1,
  1643. "precision": "highp "
  1644. },
  1645. {
  1646. "name": "cc_shadowProjDepthInfo",
  1647. "typename": "vec4",
  1648. "type": 16,
  1649. "count": 1,
  1650. "precision": "highp "
  1651. },
  1652. {
  1653. "name": "cc_shadowProjInfo",
  1654. "typename": "vec4",
  1655. "type": 16,
  1656. "count": 1,
  1657. "precision": "highp "
  1658. },
  1659. {
  1660. "name": "cc_shadowNFLSInfo",
  1661. "typename": "vec4",
  1662. "type": 16,
  1663. "count": 1,
  1664. "precision": "mediump "
  1665. },
  1666. {
  1667. "name": "cc_shadowWHPBInfo",
  1668. "typename": "vec4",
  1669. "type": 16,
  1670. "count": 1,
  1671. "precision": "mediump "
  1672. },
  1673. {
  1674. "name": "cc_shadowLPNNInfo",
  1675. "typename": "vec4",
  1676. "type": 16,
  1677. "count": 1,
  1678. "precision": "mediump "
  1679. },
  1680. {
  1681. "name": "cc_shadowColor",
  1682. "typename": "vec4",
  1683. "type": 16,
  1684. "count": 1,
  1685. "precision": "lowp "
  1686. },
  1687. {
  1688. "name": "cc_planarNDInfo",
  1689. "typename": "vec4",
  1690. "type": 16,
  1691. "count": 1,
  1692. "precision": "mediump "
  1693. }
  1694. ],
  1695. "defines": []
  1696. }
  1697. ],
  1698. "samplerTextures": [],
  1699. "samplers": [],
  1700. "textures": [],
  1701. "buffers": [],
  1702. "images": [],
  1703. "subpassInputs": []
  1704. }
  1705. ],
  1706. "glsl1": {
  1707. "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)\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\nvec2 saturate(vec2 value) { return clamp(value, vec2(0.0), vec2(1.0)); }\nvec3 saturate(vec3 value) { return clamp(value, vec3(0.0), vec3(1.0)); }\nvec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\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 vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\nuniform highp mat4 cc_matView;\n uniform highp mat4 cc_matProj;\n uniform highp vec4 cc_cameraPos;\n uniform mediump vec4 cc_mainLitDir;\n uniform mediump vec4 cc_nearFar;\n#if !USE_INSTANCING\n uniform highp mat4 cc_matWorld;\n uniform highp mat4 cc_matWorldIT;\n#endif\nvoid CCGetWorldMatrixFull(out mat4 matWorld, out mat4 matWorldIT)\n{\n #if USE_INSTANCING\n matWorld = mat4(\n vec4(a_matWorld0.xyz, 0.0),\n vec4(a_matWorld1.xyz, 0.0),\n vec4(a_matWorld2.xyz, 0.0),\n vec4(a_matWorld0.w, a_matWorld1.w, a_matWorld2.w, 1.0)\n );\n vec3 scale = 1.0 / vec3(length(a_matWorld0.xyz), length(a_matWorld1.xyz), length(a_matWorld2.xyz));\n vec3 scale2 = scale * scale;\n matWorldIT = mat4(\n vec4(a_matWorld0.xyz * scale2.x, 0.0),\n vec4(a_matWorld1.xyz * scale2.y, 0.0),\n vec4(a_matWorld2.xyz * scale2.z, 0.0),\n vec4(0.0, 0.0, 0.0, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n matWorldIT = cc_matWorldIT;\n #endif\n}\nuniform mediump vec4 cc_shadowWHPBInfo;\n uniform mediump vec4 cc_planarNDInfo;\nvec4 CalculatePlanarShadowPos(vec3 meshWorldPos, vec3 cameraPos, vec3 lightDir, vec4 plane) {\n vec3 P = meshWorldPos;\n vec3 L = lightDir;\n vec3 N = plane.xyz;\n float d = plane.w + EPSILON_LOWP;\n float dist = (-d - dot(P, N)) / (dot(L, N) + EPSILON_LOWP);\n vec3 shadowPos = P + L * dist;\n return vec4(shadowPos, dist);\n}\nvec4 CalculatePlanarShadowClipPos(vec4 shadowPos, vec3 cameraPos, mat4 matView, mat4 matProj, vec4 nearFar, float bias) {\n vec4 camPos = matView * vec4(shadowPos.xyz, 1.0);\n float lerpCoef = saturate((nearFar.z < 0.0 ? -camPos.z : camPos.z) / (nearFar.y - nearFar.x));\n camPos.z += mix(nearFar.x * 0.01, nearFar.y * EPSILON_LOWP * bias, lerpCoef);\n return matProj * camPos;\n}\nvarying float v_dist;\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld, matWorldIT;\n CCGetWorldMatrixFull(matWorld, matWorldIT);\n vec3 worldPos = (matWorld * position).xyz;\n vec4 shadowPos = CalculatePlanarShadowPos(worldPos, cc_cameraPos.xyz, cc_mainLitDir.xyz, cc_planarNDInfo);\n position = CalculatePlanarShadowClipPos(shadowPos, cc_cameraPos.xyz, cc_matView, cc_matProj, cc_nearFar, cc_shadowWHPBInfo.w);\n v_dist = shadowPos.w;\n return position;\n}\nvoid main() { gl_Position = vert(); }",
  1708. "frag": "\nprecision highp float;\nuniform lowp vec4 cc_shadowColor;\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nvarying float v_dist;\nvec4 frag () {\n if(v_dist < 0.0)\n discard;\n return CCFragOutput(cc_shadowColor);\n}\nvoid main() { gl_FragColor = frag(); }"
  1709. },
  1710. "builtins": {
  1711. "globals": {
  1712. "blocks": [
  1713. {
  1714. "name": "CCGlobal",
  1715. "defines": []
  1716. },
  1717. {
  1718. "name": "CCCamera",
  1719. "defines": []
  1720. },
  1721. {
  1722. "name": "CCShadow",
  1723. "defines": []
  1724. }
  1725. ],
  1726. "samplerTextures": [],
  1727. "buffers": [],
  1728. "images": []
  1729. },
  1730. "locals": {
  1731. "blocks": [
  1732. {
  1733. "name": "CCMorph",
  1734. "defines": [
  1735. "CC_USE_MORPH"
  1736. ]
  1737. },
  1738. {
  1739. "name": "CCSkinningTexture",
  1740. "defines": [
  1741. "CC_USE_SKINNING",
  1742. "CC_USE_BAKED_ANIMATION"
  1743. ]
  1744. },
  1745. {
  1746. "name": "CCSkinningAnimation",
  1747. "defines": [
  1748. "CC_USE_SKINNING",
  1749. "CC_USE_BAKED_ANIMATION"
  1750. ]
  1751. },
  1752. {
  1753. "name": "CCSkinning",
  1754. "defines": [
  1755. "CC_USE_SKINNING",
  1756. "!CC_USE_BAKED_ANIMATION",
  1757. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  1758. ]
  1759. },
  1760. {
  1761. "name": "CCLocal",
  1762. "defines": [
  1763. "!USE_INSTANCING"
  1764. ]
  1765. }
  1766. ],
  1767. "samplerTextures": [
  1768. {
  1769. "name": "cc_PositionDisplacements",
  1770. "defines": [
  1771. "CC_USE_MORPH",
  1772. "CC_MORPH_TARGET_HAS_POSITION"
  1773. ]
  1774. },
  1775. {
  1776. "name": "cc_NormalDisplacements",
  1777. "defines": [
  1778. "CC_USE_MORPH",
  1779. "CC_MORPH_TARGET_HAS_NORMAL"
  1780. ]
  1781. },
  1782. {
  1783. "name": "cc_TangentDisplacements",
  1784. "defines": [
  1785. "CC_USE_MORPH",
  1786. "CC_MORPH_TARGET_HAS_TANGENT"
  1787. ]
  1788. },
  1789. {
  1790. "name": "cc_jointTexture",
  1791. "defines": [
  1792. "CC_USE_SKINNING",
  1793. "CC_USE_BAKED_ANIMATION"
  1794. ]
  1795. },
  1796. {
  1797. "name": "cc_realtimeJoint",
  1798. "defines": [
  1799. "CC_USE_SKINNING",
  1800. "!CC_USE_BAKED_ANIMATION",
  1801. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  1802. ]
  1803. }
  1804. ],
  1805. "buffers": [],
  1806. "images": []
  1807. },
  1808. "statistics": {
  1809. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 90,
  1810. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 58
  1811. }
  1812. },
  1813. "defines": [
  1814. {
  1815. "name": "USE_INSTANCING",
  1816. "type": "boolean"
  1817. },
  1818. {
  1819. "name": "CC_USE_SKINNING",
  1820. "type": "boolean"
  1821. },
  1822. {
  1823. "name": "CC_USE_BAKED_ANIMATION",
  1824. "type": "boolean"
  1825. },
  1826. {
  1827. "name": "CC_USE_LIGHTMAP",
  1828. "type": "boolean"
  1829. },
  1830. {
  1831. "name": "CC_USE_REFLECTION_PROBE",
  1832. "type": "boolean"
  1833. },
  1834. {
  1835. "name": "CC_RECEIVE_SHADOW",
  1836. "type": "boolean"
  1837. },
  1838. {
  1839. "name": "CC_USE_LIGHT_PROBE",
  1840. "type": "boolean"
  1841. },
  1842. {
  1843. "name": "CC_USE_MORPH",
  1844. "type": "boolean"
  1845. },
  1846. {
  1847. "name": "CC_MORPH_TARGET_COUNT",
  1848. "type": "number",
  1849. "range": [
  1850. 2,
  1851. 8
  1852. ]
  1853. },
  1854. {
  1855. "name": "CC_MORPH_TARGET_HAS_POSITION",
  1856. "type": "boolean"
  1857. },
  1858. {
  1859. "name": "CC_MORPH_TARGET_HAS_NORMAL",
  1860. "type": "boolean"
  1861. },
  1862. {
  1863. "name": "CC_MORPH_TARGET_HAS_TANGENT",
  1864. "type": "boolean"
  1865. },
  1866. {
  1867. "name": "CC_MORPH_PRECOMPUTED",
  1868. "type": "boolean"
  1869. },
  1870. {
  1871. "name": "CC_USE_REAL_TIME_JOINT_TEXTURE",
  1872. "type": "boolean"
  1873. }
  1874. ]
  1875. }
  1876. ],
  1877. [
  1878. {
  1879. "name": "opaque",
  1880. "passes": [
  1881. {
  1882. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  1883. "properties": {
  1884. "mainTexture": {
  1885. "value": "grey",
  1886. "type": 28
  1887. },
  1888. "tilingOffset": {
  1889. "type": 16,
  1890. "value": [
  1891. 1,
  1892. 1,
  1893. 0,
  1894. 0
  1895. ]
  1896. },
  1897. "mainColor": {
  1898. "linear": true,
  1899. "type": 16,
  1900. "value": [
  1901. 1,
  1902. 1,
  1903. 1,
  1904. 1
  1905. ]
  1906. },
  1907. "colorScale": {
  1908. "type": 15,
  1909. "value": [
  1910. 1,
  1911. 1,
  1912. 1
  1913. ],
  1914. "handleInfo": [
  1915. "colorScaleAndCutoff",
  1916. 0,
  1917. 15
  1918. ]
  1919. },
  1920. "alphaThreshold": {
  1921. "type": 13,
  1922. "value": [
  1923. 0.5
  1924. ],
  1925. "handleInfo": [
  1926. "colorScaleAndCutoff",
  1927. 3,
  1928. 13
  1929. ]
  1930. },
  1931. "color": {
  1932. "linear": true,
  1933. "type": 16,
  1934. "handleInfo": [
  1935. "mainColor",
  1936. 0,
  1937. 16
  1938. ]
  1939. },
  1940. "colorScaleAndCutoff": {
  1941. "type": 16,
  1942. "value": [
  1943. 1,
  1944. 1,
  1945. 1,
  1946. 0.5
  1947. ]
  1948. }
  1949. }
  1950. },
  1951. {
  1952. "phase": "planar-shadow",
  1953. "propertyIndex": 0,
  1954. "program": "builtin-unlit|planar-shadow-vs:vert|planar-shadow-fs:frag",
  1955. "blendState": {
  1956. "targets": [
  1957. {
  1958. "blend": true,
  1959. "blendSrc": 2,
  1960. "blendDst": 4,
  1961. "blendDstAlpha": 4
  1962. }
  1963. ]
  1964. },
  1965. "depthStencilState": {
  1966. "depthTest": true,
  1967. "depthWrite": false,
  1968. "stencilTestFront": true,
  1969. "stencilFuncFront": 5,
  1970. "stencilPassOpFront": 2,
  1971. "stencilRefBack": 128,
  1972. "stencilRefFront": 128,
  1973. "stencilReadMaskBack": 128,
  1974. "stencilReadMaskFront": 128,
  1975. "stencilWriteMaskBack": 128,
  1976. "stencilWriteMaskFront": 128
  1977. }
  1978. },
  1979. {
  1980. "phase": "deferred-forward",
  1981. "propertyIndex": 0,
  1982. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag"
  1983. }
  1984. ]
  1985. },
  1986. {
  1987. "name": "transparent",
  1988. "passes": [
  1989. {
  1990. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  1991. "blendState": {
  1992. "targets": [
  1993. {
  1994. "blend": true,
  1995. "blendSrc": 2,
  1996. "blendDst": 4,
  1997. "blendDstAlpha": 4
  1998. }
  1999. ]
  2000. },
  2001. "depthStencilState": {
  2002. "depthTest": true,
  2003. "depthWrite": false
  2004. },
  2005. "properties": {
  2006. "mainTexture": {
  2007. "value": "grey",
  2008. "type": 28
  2009. },
  2010. "tilingOffset": {
  2011. "type": 16,
  2012. "value": [
  2013. 1,
  2014. 1,
  2015. 0,
  2016. 0
  2017. ]
  2018. },
  2019. "mainColor": {
  2020. "linear": true,
  2021. "type": 16,
  2022. "value": [
  2023. 1,
  2024. 1,
  2025. 1,
  2026. 1
  2027. ]
  2028. },
  2029. "colorScale": {
  2030. "type": 15,
  2031. "value": [
  2032. 1,
  2033. 1,
  2034. 1
  2035. ],
  2036. "handleInfo": [
  2037. "colorScaleAndCutoff",
  2038. 0,
  2039. 15
  2040. ]
  2041. },
  2042. "alphaThreshold": {
  2043. "type": 13,
  2044. "value": [
  2045. 0.5
  2046. ],
  2047. "handleInfo": [
  2048. "colorScaleAndCutoff",
  2049. 3,
  2050. 13
  2051. ]
  2052. },
  2053. "color": {
  2054. "linear": true,
  2055. "type": 16,
  2056. "handleInfo": [
  2057. "mainColor",
  2058. 0,
  2059. 16
  2060. ]
  2061. },
  2062. "colorScaleAndCutoff": {
  2063. "type": 16,
  2064. "value": [
  2065. 1,
  2066. 1,
  2067. 1,
  2068. 0.5
  2069. ]
  2070. }
  2071. }
  2072. },
  2073. {
  2074. "phase": "planar-shadow",
  2075. "propertyIndex": 0,
  2076. "program": "builtin-unlit|planar-shadow-vs:vert|planar-shadow-fs:frag",
  2077. "blendState": {
  2078. "targets": [
  2079. {
  2080. "blend": true,
  2081. "blendSrc": 2,
  2082. "blendDst": 4,
  2083. "blendDstAlpha": 4
  2084. }
  2085. ]
  2086. },
  2087. "depthStencilState": {
  2088. "depthTest": true,
  2089. "depthWrite": false,
  2090. "stencilTestFront": true,
  2091. "stencilFuncFront": 5,
  2092. "stencilPassOpFront": 2,
  2093. "stencilRefBack": 128,
  2094. "stencilRefFront": 128,
  2095. "stencilReadMaskBack": 128,
  2096. "stencilReadMaskFront": 128,
  2097. "stencilWriteMaskBack": 128,
  2098. "stencilWriteMaskFront": 128
  2099. }
  2100. },
  2101. {
  2102. "phase": "deferred-forward",
  2103. "propertyIndex": 0,
  2104. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  2105. "blendState": {
  2106. "targets": [
  2107. {
  2108. "blend": true,
  2109. "blendSrc": 2,
  2110. "blendDst": 4,
  2111. "blendDstAlpha": 4
  2112. }
  2113. ]
  2114. },
  2115. "depthStencilState": {
  2116. "depthTest": true,
  2117. "depthWrite": false
  2118. }
  2119. }
  2120. ]
  2121. },
  2122. {
  2123. "name": "add",
  2124. "passes": [
  2125. {
  2126. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  2127. "rasterizerState": {
  2128. "cullMode": 0
  2129. },
  2130. "blendState": {
  2131. "targets": [
  2132. {
  2133. "blend": true,
  2134. "blendSrc": 2,
  2135. "blendDst": 1,
  2136. "blendSrcAlpha": 2,
  2137. "blendDstAlpha": 1
  2138. }
  2139. ]
  2140. },
  2141. "depthStencilState": {
  2142. "depthTest": true,
  2143. "depthWrite": false
  2144. },
  2145. "properties": {
  2146. "mainTexture": {
  2147. "value": "grey",
  2148. "type": 28
  2149. },
  2150. "tilingOffset": {
  2151. "type": 16,
  2152. "value": [
  2153. 1,
  2154. 1,
  2155. 0,
  2156. 0
  2157. ]
  2158. },
  2159. "mainColor": {
  2160. "linear": true,
  2161. "type": 16,
  2162. "value": [
  2163. 1,
  2164. 1,
  2165. 1,
  2166. 1
  2167. ]
  2168. },
  2169. "colorScale": {
  2170. "type": 15,
  2171. "value": [
  2172. 1,
  2173. 1,
  2174. 1
  2175. ],
  2176. "handleInfo": [
  2177. "colorScaleAndCutoff",
  2178. 0,
  2179. 15
  2180. ]
  2181. },
  2182. "alphaThreshold": {
  2183. "type": 13,
  2184. "value": [
  2185. 0.5
  2186. ],
  2187. "handleInfo": [
  2188. "colorScaleAndCutoff",
  2189. 3,
  2190. 13
  2191. ]
  2192. },
  2193. "color": {
  2194. "linear": true,
  2195. "type": 16,
  2196. "handleInfo": [
  2197. "mainColor",
  2198. 0,
  2199. 16
  2200. ]
  2201. },
  2202. "colorScaleAndCutoff": {
  2203. "type": 16,
  2204. "value": [
  2205. 1,
  2206. 1,
  2207. 1,
  2208. 0.5
  2209. ]
  2210. }
  2211. }
  2212. },
  2213. {
  2214. "phase": "deferred-forward",
  2215. "propertyIndex": 0,
  2216. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  2217. "rasterizerState": {
  2218. "cullMode": 0
  2219. },
  2220. "blendState": {
  2221. "targets": [
  2222. {
  2223. "blend": true,
  2224. "blendSrc": 2,
  2225. "blendDst": 1,
  2226. "blendSrcAlpha": 2,
  2227. "blendDstAlpha": 1
  2228. }
  2229. ]
  2230. },
  2231. "depthStencilState": {
  2232. "depthTest": true,
  2233. "depthWrite": false
  2234. }
  2235. }
  2236. ]
  2237. },
  2238. {
  2239. "name": "alpha-blend",
  2240. "passes": [
  2241. {
  2242. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  2243. "rasterizerState": {
  2244. "cullMode": 0
  2245. },
  2246. "blendState": {
  2247. "targets": [
  2248. {
  2249. "blend": true,
  2250. "blendSrc": 2,
  2251. "blendDst": 4,
  2252. "blendSrcAlpha": 2,
  2253. "blendDstAlpha": 4
  2254. }
  2255. ]
  2256. },
  2257. "depthStencilState": {
  2258. "depthTest": true,
  2259. "depthWrite": false
  2260. },
  2261. "properties": {
  2262. "mainTexture": {
  2263. "value": "grey",
  2264. "type": 28
  2265. },
  2266. "tilingOffset": {
  2267. "type": 16,
  2268. "value": [
  2269. 1,
  2270. 1,
  2271. 0,
  2272. 0
  2273. ]
  2274. },
  2275. "mainColor": {
  2276. "linear": true,
  2277. "type": 16,
  2278. "value": [
  2279. 1,
  2280. 1,
  2281. 1,
  2282. 1
  2283. ]
  2284. },
  2285. "colorScale": {
  2286. "type": 15,
  2287. "value": [
  2288. 1,
  2289. 1,
  2290. 1
  2291. ],
  2292. "handleInfo": [
  2293. "colorScaleAndCutoff",
  2294. 0,
  2295. 15
  2296. ]
  2297. },
  2298. "alphaThreshold": {
  2299. "type": 13,
  2300. "value": [
  2301. 0.5
  2302. ],
  2303. "handleInfo": [
  2304. "colorScaleAndCutoff",
  2305. 3,
  2306. 13
  2307. ]
  2308. },
  2309. "color": {
  2310. "linear": true,
  2311. "type": 16,
  2312. "handleInfo": [
  2313. "mainColor",
  2314. 0,
  2315. 16
  2316. ]
  2317. },
  2318. "colorScaleAndCutoff": {
  2319. "type": 16,
  2320. "value": [
  2321. 1,
  2322. 1,
  2323. 1,
  2324. 0.5
  2325. ]
  2326. }
  2327. }
  2328. },
  2329. {
  2330. "phase": "deferred-forward",
  2331. "propertyIndex": 0,
  2332. "program": "builtin-unlit|unlit-vs:vert|unlit-fs:frag",
  2333. "rasterizerState": {
  2334. "cullMode": 0
  2335. },
  2336. "blendState": {
  2337. "targets": [
  2338. {
  2339. "blend": true,
  2340. "blendSrc": 2,
  2341. "blendDst": 4,
  2342. "blendSrcAlpha": 2,
  2343. "blendDstAlpha": 4
  2344. }
  2345. ]
  2346. },
  2347. "depthStencilState": {
  2348. "depthTest": true,
  2349. "depthWrite": false
  2350. }
  2351. }
  2352. ]
  2353. }
  2354. ]
  2355. ]
  2356. ],
  2357. 0,
  2358. 0,
  2359. [],
  2360. [],
  2361. []
  2362. ]