711ebe11-f673-4cd9-9a83-63c60ba54c5b.json 130 KB

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