27cc5a0b-ec0b-4a67-98cf-b42d4fa971de.json 91 KB

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