release.json 160 KB

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