release.json 264 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275
  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-gpu",
  29. [
  30. {
  31. "hash": 2859307513,
  32. "name": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_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": "SampleConstants",
  64. "stageFlags": 1,
  65. "binding": 1,
  66. "members": [
  67. {
  68. "name": "u_sampleInfo",
  69. "type": 16,
  70. "count": 1
  71. }
  72. ],
  73. "defines": []
  74. },
  75. {
  76. "name": "TickConstants",
  77. "stageFlags": 1,
  78. "binding": 2,
  79. "members": [
  80. {
  81. "name": "u_worldRot",
  82. "type": 16,
  83. "count": 1
  84. },
  85. {
  86. "name": "u_timeDelta",
  87. "type": 16,
  88. "count": 1
  89. }
  90. ],
  91. "defines": []
  92. },
  93. {
  94. "name": "ColorConstant",
  95. "stageFlags": 1,
  96. "binding": 3,
  97. "members": [
  98. {
  99. "name": "u_color_mode",
  100. "type": 5,
  101. "count": 1
  102. }
  103. ],
  104. "defines": [
  105. "COLOR_OVER_TIME_MODULE_ENABLE"
  106. ]
  107. },
  108. {
  109. "name": "RotationConstant",
  110. "stageFlags": 1,
  111. "binding": 4,
  112. "members": [
  113. {
  114. "name": "u_rotation_mode",
  115. "type": 5,
  116. "count": 1
  117. }
  118. ],
  119. "defines": [
  120. "ROTATION_OVER_TIME_MODULE_ENABLE"
  121. ]
  122. },
  123. {
  124. "name": "SizeConstant",
  125. "stageFlags": 1,
  126. "binding": 5,
  127. "members": [
  128. {
  129. "name": "u_size_mode",
  130. "type": 5,
  131. "count": 1
  132. }
  133. ],
  134. "defines": [
  135. "SIZE_OVER_TIME_MODULE_ENABLE"
  136. ]
  137. },
  138. {
  139. "name": "ForceConstant",
  140. "stageFlags": 1,
  141. "binding": 6,
  142. "members": [
  143. {
  144. "name": "u_force_mode",
  145. "type": 5,
  146. "count": 1
  147. },
  148. {
  149. "name": "u_force_space",
  150. "type": 5,
  151. "count": 1
  152. }
  153. ],
  154. "defines": [
  155. "FORCE_OVER_TIME_MODULE_ENABLE"
  156. ]
  157. },
  158. {
  159. "name": "VelocityConstant",
  160. "stageFlags": 1,
  161. "binding": 7,
  162. "members": [
  163. {
  164. "name": "u_velocity_mode",
  165. "type": 5,
  166. "count": 1
  167. },
  168. {
  169. "name": "u_velocity_space",
  170. "type": 5,
  171. "count": 1
  172. }
  173. ],
  174. "defines": [
  175. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  176. ]
  177. },
  178. {
  179. "name": "AnimationConstant",
  180. "stageFlags": 1,
  181. "binding": 8,
  182. "members": [
  183. {
  184. "name": "u_anim_info",
  185. "type": 16,
  186. "count": 1
  187. }
  188. ],
  189. "defines": [
  190. "TEXTURE_ANIMATION_MODULE_ENABLE"
  191. ]
  192. },
  193. {
  194. "name": "FragConstants",
  195. "stageFlags": 16,
  196. "binding": 9,
  197. "members": [
  198. {
  199. "name": "tintColor",
  200. "type": 16,
  201. "count": 1
  202. }
  203. ],
  204. "defines": []
  205. }
  206. ],
  207. "samplerTextures": [
  208. {
  209. "name": "color_over_time_tex0",
  210. "type": 28,
  211. "count": 1,
  212. "stageFlags": 1,
  213. "binding": 10,
  214. "defines": [
  215. "COLOR_OVER_TIME_MODULE_ENABLE"
  216. ]
  217. },
  218. {
  219. "name": "rotation_over_time_tex0",
  220. "type": 28,
  221. "count": 1,
  222. "stageFlags": 1,
  223. "binding": 11,
  224. "defines": [
  225. "ROTATION_OVER_TIME_MODULE_ENABLE"
  226. ]
  227. },
  228. {
  229. "name": "size_over_time_tex0",
  230. "type": 28,
  231. "count": 1,
  232. "stageFlags": 1,
  233. "binding": 12,
  234. "defines": [
  235. "SIZE_OVER_TIME_MODULE_ENABLE"
  236. ]
  237. },
  238. {
  239. "name": "force_over_time_tex0",
  240. "type": 28,
  241. "count": 1,
  242. "stageFlags": 1,
  243. "binding": 13,
  244. "defines": [
  245. "FORCE_OVER_TIME_MODULE_ENABLE"
  246. ]
  247. },
  248. {
  249. "name": "velocity_over_time_tex0",
  250. "type": 28,
  251. "count": 1,
  252. "stageFlags": 1,
  253. "binding": 14,
  254. "defines": [
  255. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  256. ]
  257. },
  258. {
  259. "name": "texture_animation_tex0",
  260. "type": 28,
  261. "count": 1,
  262. "stageFlags": 1,
  263. "binding": 15,
  264. "defines": [
  265. "TEXTURE_ANIMATION_MODULE_ENABLE"
  266. ]
  267. },
  268. {
  269. "name": "mainTexture",
  270. "type": 28,
  271. "count": 1,
  272. "stageFlags": 16,
  273. "binding": 16,
  274. "defines": []
  275. }
  276. ],
  277. "samplers": [],
  278. "textures": [],
  279. "buffers": [],
  280. "images": [],
  281. "subpassInputs": [],
  282. "attributes": [
  283. {
  284. "name": "a_position_starttime",
  285. "format": 44,
  286. "location": 0,
  287. "defines": []
  288. },
  289. {
  290. "name": "a_color",
  291. "format": 44,
  292. "location": 1,
  293. "defines": []
  294. },
  295. {
  296. "name": "a_dir_life",
  297. "format": 44,
  298. "location": 2,
  299. "defines": []
  300. },
  301. {
  302. "name": "a_rndSeed",
  303. "format": 11,
  304. "location": 3,
  305. "defines": []
  306. },
  307. {
  308. "name": "a_size_uv",
  309. "format": 44,
  310. "location": 4,
  311. "defines": [
  312. "!CC_INSTANCE_PARTICLE"
  313. ]
  314. },
  315. {
  316. "name": "a_rotation_uv",
  317. "format": 44,
  318. "location": 5,
  319. "defines": [
  320. "!CC_INSTANCE_PARTICLE"
  321. ]
  322. },
  323. {
  324. "name": "a_size_fid",
  325. "format": 44,
  326. "location": 6,
  327. "defines": [
  328. "CC_INSTANCE_PARTICLE"
  329. ]
  330. },
  331. {
  332. "name": "a_rotation",
  333. "format": 32,
  334. "location": 7,
  335. "defines": [
  336. "CC_INSTANCE_PARTICLE"
  337. ]
  338. },
  339. {
  340. "name": "a_uv",
  341. "format": 32,
  342. "location": 8,
  343. "defines": [
  344. "CC_INSTANCE_PARTICLE"
  345. ]
  346. },
  347. {
  348. "name": "a_texCoord",
  349. "format": 32,
  350. "location": 9,
  351. "defines": [
  352. "CC_RENDER_MODE"
  353. ]
  354. },
  355. {
  356. "name": "a_texCoord3",
  357. "format": 32,
  358. "location": 10,
  359. "defines": [
  360. "CC_RENDER_MODE"
  361. ]
  362. },
  363. {
  364. "name": "a_normal",
  365. "format": 32,
  366. "location": 11,
  367. "defines": [
  368. "CC_RENDER_MODE"
  369. ]
  370. },
  371. {
  372. "name": "a_color1",
  373. "format": 44,
  374. "location": 12,
  375. "defines": [
  376. "CC_RENDER_MODE"
  377. ]
  378. }
  379. ],
  380. "fragColors": [
  381. {
  382. "name": "cc_FragColor",
  383. "typename": "vec4",
  384. "type": 16,
  385. "count": 1,
  386. "stageFlags": 16,
  387. "location": 0,
  388. "defines": []
  389. }
  390. ],
  391. "descriptors": [
  392. {
  393. "rate": 0,
  394. "blocks": [
  395. {
  396. "name": "CCLocal",
  397. "stageFlags": 1,
  398. "tags": {
  399. "builtin": "local"
  400. },
  401. "members": [
  402. {
  403. "name": "cc_matWorld",
  404. "typename": "mat4",
  405. "type": 25,
  406. "count": 1,
  407. "precision": "highp "
  408. },
  409. {
  410. "name": "cc_matWorldIT",
  411. "typename": "mat4",
  412. "type": 25,
  413. "count": 1,
  414. "precision": "highp "
  415. },
  416. {
  417. "name": "cc_lightingMapUVParam",
  418. "typename": "vec4",
  419. "type": 16,
  420. "count": 1,
  421. "precision": "highp "
  422. },
  423. {
  424. "name": "cc_localShadowBias",
  425. "typename": "vec4",
  426. "type": 16,
  427. "count": 1,
  428. "precision": "highp "
  429. },
  430. {
  431. "name": "cc_reflectionProbeData1",
  432. "typename": "vec4",
  433. "type": 16,
  434. "count": 1,
  435. "precision": "highp "
  436. },
  437. {
  438. "name": "cc_reflectionProbeData2",
  439. "typename": "vec4",
  440. "type": 16,
  441. "count": 1,
  442. "precision": "highp "
  443. },
  444. {
  445. "name": "cc_reflectionProbeBlendData1",
  446. "typename": "vec4",
  447. "type": 16,
  448. "count": 1,
  449. "precision": "highp "
  450. },
  451. {
  452. "name": "cc_reflectionProbeBlendData2",
  453. "typename": "vec4",
  454. "type": 16,
  455. "count": 1,
  456. "precision": "highp "
  457. }
  458. ],
  459. "defines": []
  460. }
  461. ],
  462. "samplerTextures": [],
  463. "samplers": [],
  464. "textures": [],
  465. "buffers": [],
  466. "images": [],
  467. "subpassInputs": []
  468. },
  469. {
  470. "rate": 1,
  471. "blocks": [
  472. {
  473. "name": "Constants",
  474. "stageFlags": 1,
  475. "binding": 0,
  476. "members": [
  477. {
  478. "name": "mainTiling_Offset",
  479. "type": 16,
  480. "count": 1
  481. },
  482. {
  483. "name": "frameTile_velLenScale",
  484. "type": 16,
  485. "count": 1
  486. },
  487. {
  488. "name": "scale",
  489. "type": 16,
  490. "count": 1
  491. },
  492. {
  493. "name": "nodeRotation",
  494. "type": 16,
  495. "count": 1
  496. }
  497. ],
  498. "defines": []
  499. },
  500. {
  501. "name": "SampleConstants",
  502. "stageFlags": 1,
  503. "binding": 1,
  504. "members": [
  505. {
  506. "name": "u_sampleInfo",
  507. "type": 16,
  508. "count": 1
  509. }
  510. ],
  511. "defines": []
  512. },
  513. {
  514. "name": "TickConstants",
  515. "stageFlags": 1,
  516. "binding": 2,
  517. "members": [
  518. {
  519. "name": "u_worldRot",
  520. "type": 16,
  521. "count": 1
  522. },
  523. {
  524. "name": "u_timeDelta",
  525. "type": 16,
  526. "count": 1
  527. }
  528. ],
  529. "defines": []
  530. },
  531. {
  532. "name": "ColorConstant",
  533. "stageFlags": 1,
  534. "binding": 3,
  535. "members": [
  536. {
  537. "name": "u_color_mode",
  538. "type": 5,
  539. "count": 1
  540. }
  541. ],
  542. "defines": [
  543. "COLOR_OVER_TIME_MODULE_ENABLE"
  544. ]
  545. },
  546. {
  547. "name": "RotationConstant",
  548. "stageFlags": 1,
  549. "binding": 4,
  550. "members": [
  551. {
  552. "name": "u_rotation_mode",
  553. "type": 5,
  554. "count": 1
  555. }
  556. ],
  557. "defines": [
  558. "ROTATION_OVER_TIME_MODULE_ENABLE"
  559. ]
  560. },
  561. {
  562. "name": "SizeConstant",
  563. "stageFlags": 1,
  564. "binding": 5,
  565. "members": [
  566. {
  567. "name": "u_size_mode",
  568. "type": 5,
  569. "count": 1
  570. }
  571. ],
  572. "defines": [
  573. "SIZE_OVER_TIME_MODULE_ENABLE"
  574. ]
  575. },
  576. {
  577. "name": "ForceConstant",
  578. "stageFlags": 1,
  579. "binding": 6,
  580. "members": [
  581. {
  582. "name": "u_force_mode",
  583. "type": 5,
  584. "count": 1
  585. },
  586. {
  587. "name": "u_force_space",
  588. "type": 5,
  589. "count": 1
  590. }
  591. ],
  592. "defines": [
  593. "FORCE_OVER_TIME_MODULE_ENABLE"
  594. ]
  595. },
  596. {
  597. "name": "VelocityConstant",
  598. "stageFlags": 1,
  599. "binding": 7,
  600. "members": [
  601. {
  602. "name": "u_velocity_mode",
  603. "type": 5,
  604. "count": 1
  605. },
  606. {
  607. "name": "u_velocity_space",
  608. "type": 5,
  609. "count": 1
  610. }
  611. ],
  612. "defines": [
  613. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  614. ]
  615. },
  616. {
  617. "name": "AnimationConstant",
  618. "stageFlags": 1,
  619. "binding": 8,
  620. "members": [
  621. {
  622. "name": "u_anim_info",
  623. "type": 16,
  624. "count": 1
  625. }
  626. ],
  627. "defines": [
  628. "TEXTURE_ANIMATION_MODULE_ENABLE"
  629. ]
  630. },
  631. {
  632. "name": "FragConstants",
  633. "stageFlags": 16,
  634. "binding": 9,
  635. "members": [
  636. {
  637. "name": "tintColor",
  638. "type": 16,
  639. "count": 1
  640. }
  641. ],
  642. "defines": []
  643. }
  644. ],
  645. "samplerTextures": [
  646. {
  647. "name": "color_over_time_tex0",
  648. "type": 28,
  649. "count": 1,
  650. "stageFlags": 1,
  651. "binding": 10,
  652. "defines": [
  653. "COLOR_OVER_TIME_MODULE_ENABLE"
  654. ]
  655. },
  656. {
  657. "name": "rotation_over_time_tex0",
  658. "type": 28,
  659. "count": 1,
  660. "stageFlags": 1,
  661. "binding": 11,
  662. "defines": [
  663. "ROTATION_OVER_TIME_MODULE_ENABLE"
  664. ]
  665. },
  666. {
  667. "name": "size_over_time_tex0",
  668. "type": 28,
  669. "count": 1,
  670. "stageFlags": 1,
  671. "binding": 12,
  672. "defines": [
  673. "SIZE_OVER_TIME_MODULE_ENABLE"
  674. ]
  675. },
  676. {
  677. "name": "force_over_time_tex0",
  678. "type": 28,
  679. "count": 1,
  680. "stageFlags": 1,
  681. "binding": 13,
  682. "defines": [
  683. "FORCE_OVER_TIME_MODULE_ENABLE"
  684. ]
  685. },
  686. {
  687. "name": "velocity_over_time_tex0",
  688. "type": 28,
  689. "count": 1,
  690. "stageFlags": 1,
  691. "binding": 14,
  692. "defines": [
  693. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  694. ]
  695. },
  696. {
  697. "name": "texture_animation_tex0",
  698. "type": 28,
  699. "count": 1,
  700. "stageFlags": 1,
  701. "binding": 15,
  702. "defines": [
  703. "TEXTURE_ANIMATION_MODULE_ENABLE"
  704. ]
  705. },
  706. {
  707. "name": "mainTexture",
  708. "type": 28,
  709. "count": 1,
  710. "stageFlags": 16,
  711. "binding": 16,
  712. "defines": []
  713. }
  714. ],
  715. "samplers": [],
  716. "textures": [],
  717. "buffers": [],
  718. "images": [],
  719. "subpassInputs": []
  720. },
  721. {
  722. "rate": 2,
  723. "blocks": [],
  724. "samplerTextures": [],
  725. "samplers": [],
  726. "textures": [],
  727. "buffers": [],
  728. "images": [],
  729. "subpassInputs": []
  730. },
  731. {
  732. "rate": 3,
  733. "blocks": [
  734. {
  735. "name": "CCGlobal",
  736. "stageFlags": 17,
  737. "tags": {
  738. "builtin": "global"
  739. },
  740. "members": [
  741. {
  742. "name": "cc_time",
  743. "typename": "vec4",
  744. "type": 16,
  745. "count": 1,
  746. "precision": "highp "
  747. },
  748. {
  749. "name": "cc_screenSize",
  750. "typename": "vec4",
  751. "type": 16,
  752. "count": 1,
  753. "precision": "mediump "
  754. },
  755. {
  756. "name": "cc_nativeSize",
  757. "typename": "vec4",
  758. "type": 16,
  759. "count": 1,
  760. "precision": "mediump "
  761. },
  762. {
  763. "name": "cc_probeInfo",
  764. "typename": "vec4",
  765. "type": 16,
  766. "count": 1,
  767. "precision": "mediump "
  768. },
  769. {
  770. "name": "cc_debug_view_mode",
  771. "typename": "vec4",
  772. "type": 16,
  773. "count": 1,
  774. "precision": "mediump "
  775. }
  776. ],
  777. "defines": []
  778. },
  779. {
  780. "name": "CCCamera",
  781. "stageFlags": 17,
  782. "tags": {
  783. "builtin": "global"
  784. },
  785. "members": [
  786. {
  787. "name": "cc_matView",
  788. "typename": "mat4",
  789. "type": 25,
  790. "count": 1,
  791. "precision": "highp "
  792. },
  793. {
  794. "name": "cc_matViewInv",
  795. "typename": "mat4",
  796. "type": 25,
  797. "count": 1,
  798. "precision": "highp "
  799. },
  800. {
  801. "name": "cc_matProj",
  802. "typename": "mat4",
  803. "type": 25,
  804. "count": 1,
  805. "precision": "highp "
  806. },
  807. {
  808. "name": "cc_matProjInv",
  809. "typename": "mat4",
  810. "type": 25,
  811. "count": 1,
  812. "precision": "highp "
  813. },
  814. {
  815. "name": "cc_matViewProj",
  816. "typename": "mat4",
  817. "type": 25,
  818. "count": 1,
  819. "precision": "highp "
  820. },
  821. {
  822. "name": "cc_matViewProjInv",
  823. "typename": "mat4",
  824. "type": 25,
  825. "count": 1,
  826. "precision": "highp "
  827. },
  828. {
  829. "name": "cc_cameraPos",
  830. "typename": "vec4",
  831. "type": 16,
  832. "count": 1,
  833. "precision": "highp "
  834. },
  835. {
  836. "name": "cc_surfaceTransform",
  837. "typename": "vec4",
  838. "type": 16,
  839. "count": 1,
  840. "precision": "mediump "
  841. },
  842. {
  843. "name": "cc_screenScale",
  844. "typename": "vec4",
  845. "type": 16,
  846. "count": 1,
  847. "precision": "mediump "
  848. },
  849. {
  850. "name": "cc_exposure",
  851. "typename": "vec4",
  852. "type": 16,
  853. "count": 1,
  854. "precision": "mediump "
  855. },
  856. {
  857. "name": "cc_mainLitDir",
  858. "typename": "vec4",
  859. "type": 16,
  860. "count": 1,
  861. "precision": "mediump "
  862. },
  863. {
  864. "name": "cc_mainLitColor",
  865. "typename": "vec4",
  866. "type": 16,
  867. "count": 1,
  868. "precision": "mediump "
  869. },
  870. {
  871. "name": "cc_ambientSky",
  872. "typename": "vec4",
  873. "type": 16,
  874. "count": 1,
  875. "precision": "mediump "
  876. },
  877. {
  878. "name": "cc_ambientGround",
  879. "typename": "vec4",
  880. "type": 16,
  881. "count": 1,
  882. "precision": "mediump "
  883. },
  884. {
  885. "name": "cc_fogColor",
  886. "typename": "vec4",
  887. "type": 16,
  888. "count": 1,
  889. "precision": "mediump "
  890. },
  891. {
  892. "name": "cc_fogBase",
  893. "typename": "vec4",
  894. "type": 16,
  895. "count": 1,
  896. "precision": "mediump "
  897. },
  898. {
  899. "name": "cc_fogAdd",
  900. "typename": "vec4",
  901. "type": 16,
  902. "count": 1,
  903. "precision": "mediump "
  904. },
  905. {
  906. "name": "cc_nearFar",
  907. "typename": "vec4",
  908. "type": 16,
  909. "count": 1,
  910. "precision": "mediump "
  911. },
  912. {
  913. "name": "cc_viewPort",
  914. "typename": "vec4",
  915. "type": 16,
  916. "count": 1,
  917. "precision": "mediump "
  918. }
  919. ],
  920. "defines": []
  921. }
  922. ],
  923. "samplerTextures": [],
  924. "samplers": [],
  925. "textures": [],
  926. "buffers": [],
  927. "images": [],
  928. "subpassInputs": []
  929. }
  930. ],
  931. "glsl1": {
  932. "vert": "\nprecision mediump 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}\nvec4 eulerToQuat(vec3 euler) {\n vec3 er = euler * 0.5;\n float x = er.x, y = er.y, z = er.z;\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;\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}\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}\n uniform vec4 u_sampleInfo;\n uniform vec4 u_worldRot;\n uniform vec4 u_timeDelta;\nattribute vec4 a_position_starttime;\nattribute vec4 a_color;\nattribute vec4 a_dir_life;\nattribute float a_rndSeed;\n#if !CC_INSTANCE_PARTICLE\n attribute vec4 a_size_uv;\n attribute vec4 a_rotation_uv;\n#endif\n#if CC_INSTANCE_PARTICLE\n attribute vec4 a_size_fid;\n attribute vec3 a_rotation;\n attribute vec3 a_uv;\n#endif\n#if CC_RENDER_MODE == 4\n attribute vec3 a_texCoord;\n attribute vec3 a_texCoord3;\n attribute vec3 a_normal;\n attribute vec4 a_color1;\n#endif\nvec3 unpackCurveData (sampler2D tex, vec2 coord) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n return mix(a.xyz, b.xyz, c);\n}\nvec3 unpackCurveData (sampler2D tex, vec2 coord, out float w) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n w = mix(a.w, b.w, c);\n return mix(a.xyz, b.xyz, c);\n}\nfloat pseudoRandom(float x) {\n#if USE_VK_SHADER\n float o = x;\n x = mod(x - 1.0, 2.0) - 1.0;\n float freqVar = 10.16640753482;\n float y = sin(freqVar * floor(o * 0.5 - 0.5));\n float v = max(0.0, 1.0-abs(x));\n v *= 0.7071067812;\n v = y < 0.0 ? -v : v;\n return v;\n#endif\n#if !USE_VK_SHADER\n float seed = mod(x, 233280.);\n float q = (seed * 9301. + 49297.) / 233280.;\n return fract(q);\n#endif\n}\n#if COLOR_OVER_TIME_MODULE_ENABLE\n uniform sampler2D color_over_time_tex0;\n uniform int u_color_mode;\n#endif\n#if ROTATION_OVER_TIME_MODULE_ENABLE\n uniform sampler2D rotation_over_time_tex0;\n uniform int u_rotation_mode;\n#endif\n#if SIZE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D size_over_time_tex0;\n uniform int u_size_mode;\n#endif\n#if FORCE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D force_over_time_tex0;\n uniform int u_force_mode;\n uniform int u_force_space;\n#endif\n#if VELOCITY_OVER_TIME_MODULE_ENABLE\n uniform sampler2D velocity_over_time_tex0;\n uniform int u_velocity_mode;\n uniform int u_velocity_space;\n#endif\n#if TEXTURE_ANIMATION_MODULE_ENABLE\n uniform sampler2D texture_animation_tex0;\n uniform vec4 u_anim_info;\n#endif\nfloat repeat (float t, float length) {\n return t - floor(t / length) * length;\n}\nvec4 rotateQuat (vec4 p, vec4 q) {\n vec3 iv = cross(q.xyz, p.xyz) + q.w * p.xyz;\n vec3 res = p.xyz + 2.0 * cross(q.xyz, iv);\n return vec4(res.xyz, p.w);\n}\nvec4 gpvs_main () {\n float activeTime = u_timeDelta.x - a_position_starttime.w;\n float normalizedTime = clamp(activeTime / a_dir_life.w, 0.0, 1.0);\n vec2 timeCoord0 = vec2(normalizedTime, 0.);\n vec2 timeCoord1 = vec2(normalizedTime, 1.);\n #if CC_RENDER_MODE == 4\n vec2 vertIdx = vec2(a_texCoord.x, a_texCoord.y);\n #endif\n #if CC_RENDER_MODE != 4\n #if !CC_INSTANCE_PARTICLE\n vec2 vertIdx = vec2(a_size_uv.w, a_rotation_uv.w);\n #endif\n #if CC_INSTANCE_PARTICLE\n vec2 vertIdx = a_uv.xy;\n #endif\n #endif\n vec4 velocity = vec4(a_dir_life.xyz, 0.);\n vec4 pos = vec4(a_position_starttime.xyz, 1.);\n #if !CC_INSTANCE_PARTICLE\n vec3 size = a_size_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 size = a_size_fid.xyz;\n #endif\n #if SIZE_OVER_TIME_MODULE_ENABLE\n if (u_size_mode == 1) {\n size *= unpackCurveData(size_over_time_tex0, timeCoord0);\n } else {\n vec3 size_0 = unpackCurveData(size_over_time_tex0, timeCoord0);\n vec3 size_1 = unpackCurveData(size_over_time_tex0, timeCoord1);\n float factor_s = pseudoRandom(a_rndSeed + 39825.);\n size *= mix(size_0, size_1, factor_s);\n }\n #endif\n vec3 compScale = scale.xyz * size;\n #if FORCE_OVER_TIME_MODULE_ENABLE\n vec3 forceAnim = vec3(0.);\n if (u_force_mode == 1) {\n forceAnim = unpackCurveData(force_over_time_tex0, timeCoord0);\n } else {\n vec3 force_0 = unpackCurveData(force_over_time_tex0, timeCoord0);\n vec3 force_1 = unpackCurveData(force_over_time_tex0, timeCoord1);\n float factor_f = pseudoRandom(a_rndSeed + 212165.);\n forceAnim = mix(force_0, force_1, factor_f);\n }\n vec4 forceTrack = vec4(forceAnim, 0.);\n if (u_force_space == 0) {\n forceTrack = rotateQuat(forceTrack, u_worldRot);\n }\n velocity.xyz += forceTrack.xyz;\n #endif\n #if VELOCITY_OVER_TIME_MODULE_ENABLE\n float speedModifier0 = 1.;\n float speedModifier1 = 1.;\n vec3 velocityAnim = vec3(0.);\n if (u_velocity_mode == 1) {\n velocityAnim = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n } else {\n vec3 vectory_0 = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n vec3 vectory_1 = unpackCurveData(velocity_over_time_tex0, timeCoord1, speedModifier1);\n float factor_v = pseudoRandom(a_rndSeed + 197866.);\n velocityAnim = mix(vectory_0, vectory_1, factor_v);\n speedModifier0 = mix(speedModifier0, speedModifier1, factor_v);\n }\n vec4 velocityTrack = vec4(velocityAnim, 0.);\n if (u_velocity_space == 0) {\n velocityTrack = rotateQuat(velocityTrack, u_worldRot);\n }\n velocity.xyz += velocityTrack.xyz;\n velocity.xyz *= speedModifier0;\n #endif\n pos.xyz += velocity.xyz * normalizedTime * a_dir_life.w;\n #if !CC_USE_WORLD_SPACE\n pos = cc_matWorld * pos;\n #if CC_RENDER_MODE == 1\n velocity = rotateQuat(velocity, u_worldRot);\n #endif\n #endif\n #if !CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation;\n #endif\n #if CC_RENDER_MODE != 4\n #if CC_RENDER_MODE == 0\n vec3 rotEuler = startRotation.xyz;\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., startRotation.z);\n #endif\n vec4 rot = quaternionFromEuler(rotEuler);\n #endif\n #if CC_RENDER_MODE == 4\n vec4 rot = quaternionFromEuler(startRotation);\n #endif\n #if ROTATION_OVER_TIME_MODULE_ENABLE\n if (u_rotation_mode == 1) {\n vec3 euler = unpackCurveData(rotation_over_time_tex0, timeCoord0) * normalizedTime * a_dir_life.w;\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n } else {\n vec3 rotation_0 = unpackCurveData(rotation_over_time_tex0, timeCoord0);\n vec3 rotation_1 = unpackCurveData(rotation_over_time_tex0, timeCoord1);\n float factor_r = pseudoRandom(a_rndSeed + 125292.);\n vec3 euler = mix(rotation_0, rotation_1, factor_r) * normalizedTime * a_dir_life.w;\n #if CC_RENDER_MODE == 3 || CC_RENDER_MODE == 2\n euler = vec3(0.0, 0.0, euler.z);\n #endif\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n }\n #endif\n #if COLOR_OVER_TIME_MODULE_ENABLE\n if (u_color_mode == 1) {\n color = a_color * texture2D(color_over_time_tex0, timeCoord0);\n } else {\n vec4 color_0 = texture2D(color_over_time_tex0, timeCoord0);\n vec4 color_1 = texture2D(color_over_time_tex0, timeCoord1);\n float factor_c = pseudoRandom(a_rndSeed + 91041.);\n color = a_color * mix(color_0, color_1, factor_c);\n }\n #endif\n #if !COLOR_OVER_TIME_MODULE_ENABLE\n color = a_color;\n #endif\n #if CC_RENDER_MODE != 4\n vec2 cornerOffset = vec2((vertIdx - 0.5));\n #if CC_RENDER_MODE == 1\n rot = vec4(0.0, 0.0, 0.0, 1.0);\n #endif\n computeVertPos(pos, cornerOffset, rot, compScale\n #if CC_RENDER_MODE == 0 || CC_RENDER_MODE == 3\n , cc_matViewInv\n #endif\n #if CC_RENDER_MODE == 1\n , cc_cameraPos.xyz\n , velocity\n , frameTile_velLenScale.z\n , frameTile_velLenScale.w\n #if !CC_INSTANCE_PARTICLE\n , a_size_uv.w\n #endif\n #if CC_INSTANCE_PARTICLE\n , a_uv.x\n #endif\n #endif\n );\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_color1;\n #endif\n pos = cc_matViewProj * pos;\n float frameIndex = 0.;\n #if TEXTURE_ANIMATION_MODULE_ENABLE\n float startFrame = 0.;\n vec3 frameInfo = vec3(0.);\n if (int(u_anim_info.x) == 1) {\n frameInfo = unpackCurveData(texture_animation_tex0, timeCoord0);\n } else {\n vec3 frameInfo0 = unpackCurveData(texture_animation_tex0, timeCoord0);\n vec3 frameInfo1 = unpackCurveData(texture_animation_tex0, timeCoord1);\n float factor_t = pseudoRandom(a_rndSeed + 90794.);\n frameInfo = mix(frameInfo0, frameInfo1, factor_t);\n }\n startFrame = frameInfo.x / u_anim_info.y;\n float EPSILON = 1e-6;\n frameIndex = repeat(u_anim_info.z * (frameInfo.y + startFrame), 1. + EPSILON);\n #endif\n uv = computeUV(frameIndex, vertIdx, frameTile_velLenScale.xy) * mainTiling_Offset.xy + mainTiling_Offset.zw;\n return pos;\n}\nvoid main() { gl_Position = gpvs_main(); }",
  933. "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(); }"
  934. },
  935. "builtins": {
  936. "globals": {
  937. "blocks": [
  938. {
  939. "name": "CCGlobal",
  940. "defines": []
  941. },
  942. {
  943. "name": "CCCamera",
  944. "defines": []
  945. }
  946. ],
  947. "samplerTextures": [],
  948. "buffers": [],
  949. "images": []
  950. },
  951. "locals": {
  952. "blocks": [
  953. {
  954. "name": "CCLocal",
  955. "defines": []
  956. }
  957. ],
  958. "samplerTextures": [],
  959. "buffers": [],
  960. "images": []
  961. },
  962. "statistics": {
  963. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 71,
  964. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 43
  965. }
  966. },
  967. "defines": [
  968. {
  969. "name": "CC_RENDER_MODE",
  970. "type": "number",
  971. "range": [
  972. 0,
  973. 4
  974. ]
  975. },
  976. {
  977. "name": "CC_INSTANCE_PARTICLE",
  978. "type": "boolean"
  979. },
  980. {
  981. "name": "USE_VK_SHADER",
  982. "type": "boolean"
  983. },
  984. {
  985. "name": "COLOR_OVER_TIME_MODULE_ENABLE",
  986. "type": "boolean"
  987. },
  988. {
  989. "name": "ROTATION_OVER_TIME_MODULE_ENABLE",
  990. "type": "boolean"
  991. },
  992. {
  993. "name": "SIZE_OVER_TIME_MODULE_ENABLE",
  994. "type": "boolean"
  995. },
  996. {
  997. "name": "FORCE_OVER_TIME_MODULE_ENABLE",
  998. "type": "boolean"
  999. },
  1000. {
  1001. "name": "VELOCITY_OVER_TIME_MODULE_ENABLE",
  1002. "type": "boolean"
  1003. },
  1004. {
  1005. "name": "TEXTURE_ANIMATION_MODULE_ENABLE",
  1006. "type": "boolean"
  1007. },
  1008. {
  1009. "name": "CC_USE_WORLD_SPACE",
  1010. "type": "boolean"
  1011. }
  1012. ]
  1013. },
  1014. {
  1015. "hash": 2330235135,
  1016. "name": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|tinted-fs:multiply",
  1017. "blocks": [
  1018. {
  1019. "name": "Constants",
  1020. "stageFlags": 1,
  1021. "binding": 0,
  1022. "members": [
  1023. {
  1024. "name": "mainTiling_Offset",
  1025. "type": 16,
  1026. "count": 1
  1027. },
  1028. {
  1029. "name": "frameTile_velLenScale",
  1030. "type": 16,
  1031. "count": 1
  1032. },
  1033. {
  1034. "name": "scale",
  1035. "type": 16,
  1036. "count": 1
  1037. },
  1038. {
  1039. "name": "nodeRotation",
  1040. "type": 16,
  1041. "count": 1
  1042. }
  1043. ],
  1044. "defines": []
  1045. },
  1046. {
  1047. "name": "SampleConstants",
  1048. "stageFlags": 1,
  1049. "binding": 1,
  1050. "members": [
  1051. {
  1052. "name": "u_sampleInfo",
  1053. "type": 16,
  1054. "count": 1
  1055. }
  1056. ],
  1057. "defines": []
  1058. },
  1059. {
  1060. "name": "TickConstants",
  1061. "stageFlags": 1,
  1062. "binding": 2,
  1063. "members": [
  1064. {
  1065. "name": "u_worldRot",
  1066. "type": 16,
  1067. "count": 1
  1068. },
  1069. {
  1070. "name": "u_timeDelta",
  1071. "type": 16,
  1072. "count": 1
  1073. }
  1074. ],
  1075. "defines": []
  1076. },
  1077. {
  1078. "name": "ColorConstant",
  1079. "stageFlags": 1,
  1080. "binding": 3,
  1081. "members": [
  1082. {
  1083. "name": "u_color_mode",
  1084. "type": 5,
  1085. "count": 1
  1086. }
  1087. ],
  1088. "defines": [
  1089. "COLOR_OVER_TIME_MODULE_ENABLE"
  1090. ]
  1091. },
  1092. {
  1093. "name": "RotationConstant",
  1094. "stageFlags": 1,
  1095. "binding": 4,
  1096. "members": [
  1097. {
  1098. "name": "u_rotation_mode",
  1099. "type": 5,
  1100. "count": 1
  1101. }
  1102. ],
  1103. "defines": [
  1104. "ROTATION_OVER_TIME_MODULE_ENABLE"
  1105. ]
  1106. },
  1107. {
  1108. "name": "SizeConstant",
  1109. "stageFlags": 1,
  1110. "binding": 5,
  1111. "members": [
  1112. {
  1113. "name": "u_size_mode",
  1114. "type": 5,
  1115. "count": 1
  1116. }
  1117. ],
  1118. "defines": [
  1119. "SIZE_OVER_TIME_MODULE_ENABLE"
  1120. ]
  1121. },
  1122. {
  1123. "name": "ForceConstant",
  1124. "stageFlags": 1,
  1125. "binding": 6,
  1126. "members": [
  1127. {
  1128. "name": "u_force_mode",
  1129. "type": 5,
  1130. "count": 1
  1131. },
  1132. {
  1133. "name": "u_force_space",
  1134. "type": 5,
  1135. "count": 1
  1136. }
  1137. ],
  1138. "defines": [
  1139. "FORCE_OVER_TIME_MODULE_ENABLE"
  1140. ]
  1141. },
  1142. {
  1143. "name": "VelocityConstant",
  1144. "stageFlags": 1,
  1145. "binding": 7,
  1146. "members": [
  1147. {
  1148. "name": "u_velocity_mode",
  1149. "type": 5,
  1150. "count": 1
  1151. },
  1152. {
  1153. "name": "u_velocity_space",
  1154. "type": 5,
  1155. "count": 1
  1156. }
  1157. ],
  1158. "defines": [
  1159. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  1160. ]
  1161. },
  1162. {
  1163. "name": "AnimationConstant",
  1164. "stageFlags": 1,
  1165. "binding": 8,
  1166. "members": [
  1167. {
  1168. "name": "u_anim_info",
  1169. "type": 16,
  1170. "count": 1
  1171. }
  1172. ],
  1173. "defines": [
  1174. "TEXTURE_ANIMATION_MODULE_ENABLE"
  1175. ]
  1176. },
  1177. {
  1178. "name": "FragConstants",
  1179. "stageFlags": 16,
  1180. "binding": 9,
  1181. "members": [
  1182. {
  1183. "name": "tintColor",
  1184. "type": 16,
  1185. "count": 1
  1186. }
  1187. ],
  1188. "defines": []
  1189. }
  1190. ],
  1191. "samplerTextures": [
  1192. {
  1193. "name": "color_over_time_tex0",
  1194. "type": 28,
  1195. "count": 1,
  1196. "stageFlags": 1,
  1197. "binding": 10,
  1198. "defines": [
  1199. "COLOR_OVER_TIME_MODULE_ENABLE"
  1200. ]
  1201. },
  1202. {
  1203. "name": "rotation_over_time_tex0",
  1204. "type": 28,
  1205. "count": 1,
  1206. "stageFlags": 1,
  1207. "binding": 11,
  1208. "defines": [
  1209. "ROTATION_OVER_TIME_MODULE_ENABLE"
  1210. ]
  1211. },
  1212. {
  1213. "name": "size_over_time_tex0",
  1214. "type": 28,
  1215. "count": 1,
  1216. "stageFlags": 1,
  1217. "binding": 12,
  1218. "defines": [
  1219. "SIZE_OVER_TIME_MODULE_ENABLE"
  1220. ]
  1221. },
  1222. {
  1223. "name": "force_over_time_tex0",
  1224. "type": 28,
  1225. "count": 1,
  1226. "stageFlags": 1,
  1227. "binding": 13,
  1228. "defines": [
  1229. "FORCE_OVER_TIME_MODULE_ENABLE"
  1230. ]
  1231. },
  1232. {
  1233. "name": "velocity_over_time_tex0",
  1234. "type": 28,
  1235. "count": 1,
  1236. "stageFlags": 1,
  1237. "binding": 14,
  1238. "defines": [
  1239. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  1240. ]
  1241. },
  1242. {
  1243. "name": "texture_animation_tex0",
  1244. "type": 28,
  1245. "count": 1,
  1246. "stageFlags": 1,
  1247. "binding": 15,
  1248. "defines": [
  1249. "TEXTURE_ANIMATION_MODULE_ENABLE"
  1250. ]
  1251. },
  1252. {
  1253. "name": "mainTexture",
  1254. "type": 28,
  1255. "count": 1,
  1256. "stageFlags": 16,
  1257. "binding": 16,
  1258. "defines": []
  1259. }
  1260. ],
  1261. "samplers": [],
  1262. "textures": [],
  1263. "buffers": [],
  1264. "images": [],
  1265. "subpassInputs": [],
  1266. "attributes": [
  1267. {
  1268. "name": "a_position_starttime",
  1269. "format": 44,
  1270. "location": 0,
  1271. "defines": []
  1272. },
  1273. {
  1274. "name": "a_color",
  1275. "format": 44,
  1276. "location": 1,
  1277. "defines": []
  1278. },
  1279. {
  1280. "name": "a_dir_life",
  1281. "format": 44,
  1282. "location": 2,
  1283. "defines": []
  1284. },
  1285. {
  1286. "name": "a_rndSeed",
  1287. "format": 11,
  1288. "location": 3,
  1289. "defines": []
  1290. },
  1291. {
  1292. "name": "a_size_uv",
  1293. "format": 44,
  1294. "location": 4,
  1295. "defines": [
  1296. "!CC_INSTANCE_PARTICLE"
  1297. ]
  1298. },
  1299. {
  1300. "name": "a_rotation_uv",
  1301. "format": 44,
  1302. "location": 5,
  1303. "defines": [
  1304. "!CC_INSTANCE_PARTICLE"
  1305. ]
  1306. },
  1307. {
  1308. "name": "a_size_fid",
  1309. "format": 44,
  1310. "location": 6,
  1311. "defines": [
  1312. "CC_INSTANCE_PARTICLE"
  1313. ]
  1314. },
  1315. {
  1316. "name": "a_rotation",
  1317. "format": 32,
  1318. "location": 7,
  1319. "defines": [
  1320. "CC_INSTANCE_PARTICLE"
  1321. ]
  1322. },
  1323. {
  1324. "name": "a_uv",
  1325. "format": 32,
  1326. "location": 8,
  1327. "defines": [
  1328. "CC_INSTANCE_PARTICLE"
  1329. ]
  1330. },
  1331. {
  1332. "name": "a_texCoord",
  1333. "format": 32,
  1334. "location": 9,
  1335. "defines": [
  1336. "CC_RENDER_MODE"
  1337. ]
  1338. },
  1339. {
  1340. "name": "a_texCoord3",
  1341. "format": 32,
  1342. "location": 10,
  1343. "defines": [
  1344. "CC_RENDER_MODE"
  1345. ]
  1346. },
  1347. {
  1348. "name": "a_normal",
  1349. "format": 32,
  1350. "location": 11,
  1351. "defines": [
  1352. "CC_RENDER_MODE"
  1353. ]
  1354. },
  1355. {
  1356. "name": "a_color1",
  1357. "format": 44,
  1358. "location": 12,
  1359. "defines": [
  1360. "CC_RENDER_MODE"
  1361. ]
  1362. }
  1363. ],
  1364. "fragColors": [
  1365. {
  1366. "name": "cc_FragColor",
  1367. "typename": "vec4",
  1368. "type": 16,
  1369. "count": 1,
  1370. "stageFlags": 16,
  1371. "location": 0,
  1372. "defines": []
  1373. }
  1374. ],
  1375. "descriptors": [
  1376. {
  1377. "rate": 0,
  1378. "blocks": [
  1379. {
  1380. "name": "CCLocal",
  1381. "stageFlags": 1,
  1382. "tags": {
  1383. "builtin": "local"
  1384. },
  1385. "members": [
  1386. {
  1387. "name": "cc_matWorld",
  1388. "typename": "mat4",
  1389. "type": 25,
  1390. "count": 1,
  1391. "precision": "highp "
  1392. },
  1393. {
  1394. "name": "cc_matWorldIT",
  1395. "typename": "mat4",
  1396. "type": 25,
  1397. "count": 1,
  1398. "precision": "highp "
  1399. },
  1400. {
  1401. "name": "cc_lightingMapUVParam",
  1402. "typename": "vec4",
  1403. "type": 16,
  1404. "count": 1,
  1405. "precision": "highp "
  1406. },
  1407. {
  1408. "name": "cc_localShadowBias",
  1409. "typename": "vec4",
  1410. "type": 16,
  1411. "count": 1,
  1412. "precision": "highp "
  1413. },
  1414. {
  1415. "name": "cc_reflectionProbeData1",
  1416. "typename": "vec4",
  1417. "type": 16,
  1418. "count": 1,
  1419. "precision": "highp "
  1420. },
  1421. {
  1422. "name": "cc_reflectionProbeData2",
  1423. "typename": "vec4",
  1424. "type": 16,
  1425. "count": 1,
  1426. "precision": "highp "
  1427. },
  1428. {
  1429. "name": "cc_reflectionProbeBlendData1",
  1430. "typename": "vec4",
  1431. "type": 16,
  1432. "count": 1,
  1433. "precision": "highp "
  1434. },
  1435. {
  1436. "name": "cc_reflectionProbeBlendData2",
  1437. "typename": "vec4",
  1438. "type": 16,
  1439. "count": 1,
  1440. "precision": "highp "
  1441. }
  1442. ],
  1443. "defines": []
  1444. }
  1445. ],
  1446. "samplerTextures": [],
  1447. "samplers": [],
  1448. "textures": [],
  1449. "buffers": [],
  1450. "images": [],
  1451. "subpassInputs": []
  1452. },
  1453. {
  1454. "rate": 1,
  1455. "blocks": [
  1456. {
  1457. "name": "Constants",
  1458. "stageFlags": 1,
  1459. "binding": 0,
  1460. "members": [
  1461. {
  1462. "name": "mainTiling_Offset",
  1463. "type": 16,
  1464. "count": 1
  1465. },
  1466. {
  1467. "name": "frameTile_velLenScale",
  1468. "type": 16,
  1469. "count": 1
  1470. },
  1471. {
  1472. "name": "scale",
  1473. "type": 16,
  1474. "count": 1
  1475. },
  1476. {
  1477. "name": "nodeRotation",
  1478. "type": 16,
  1479. "count": 1
  1480. }
  1481. ],
  1482. "defines": []
  1483. },
  1484. {
  1485. "name": "SampleConstants",
  1486. "stageFlags": 1,
  1487. "binding": 1,
  1488. "members": [
  1489. {
  1490. "name": "u_sampleInfo",
  1491. "type": 16,
  1492. "count": 1
  1493. }
  1494. ],
  1495. "defines": []
  1496. },
  1497. {
  1498. "name": "TickConstants",
  1499. "stageFlags": 1,
  1500. "binding": 2,
  1501. "members": [
  1502. {
  1503. "name": "u_worldRot",
  1504. "type": 16,
  1505. "count": 1
  1506. },
  1507. {
  1508. "name": "u_timeDelta",
  1509. "type": 16,
  1510. "count": 1
  1511. }
  1512. ],
  1513. "defines": []
  1514. },
  1515. {
  1516. "name": "ColorConstant",
  1517. "stageFlags": 1,
  1518. "binding": 3,
  1519. "members": [
  1520. {
  1521. "name": "u_color_mode",
  1522. "type": 5,
  1523. "count": 1
  1524. }
  1525. ],
  1526. "defines": [
  1527. "COLOR_OVER_TIME_MODULE_ENABLE"
  1528. ]
  1529. },
  1530. {
  1531. "name": "RotationConstant",
  1532. "stageFlags": 1,
  1533. "binding": 4,
  1534. "members": [
  1535. {
  1536. "name": "u_rotation_mode",
  1537. "type": 5,
  1538. "count": 1
  1539. }
  1540. ],
  1541. "defines": [
  1542. "ROTATION_OVER_TIME_MODULE_ENABLE"
  1543. ]
  1544. },
  1545. {
  1546. "name": "SizeConstant",
  1547. "stageFlags": 1,
  1548. "binding": 5,
  1549. "members": [
  1550. {
  1551. "name": "u_size_mode",
  1552. "type": 5,
  1553. "count": 1
  1554. }
  1555. ],
  1556. "defines": [
  1557. "SIZE_OVER_TIME_MODULE_ENABLE"
  1558. ]
  1559. },
  1560. {
  1561. "name": "ForceConstant",
  1562. "stageFlags": 1,
  1563. "binding": 6,
  1564. "members": [
  1565. {
  1566. "name": "u_force_mode",
  1567. "type": 5,
  1568. "count": 1
  1569. },
  1570. {
  1571. "name": "u_force_space",
  1572. "type": 5,
  1573. "count": 1
  1574. }
  1575. ],
  1576. "defines": [
  1577. "FORCE_OVER_TIME_MODULE_ENABLE"
  1578. ]
  1579. },
  1580. {
  1581. "name": "VelocityConstant",
  1582. "stageFlags": 1,
  1583. "binding": 7,
  1584. "members": [
  1585. {
  1586. "name": "u_velocity_mode",
  1587. "type": 5,
  1588. "count": 1
  1589. },
  1590. {
  1591. "name": "u_velocity_space",
  1592. "type": 5,
  1593. "count": 1
  1594. }
  1595. ],
  1596. "defines": [
  1597. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  1598. ]
  1599. },
  1600. {
  1601. "name": "AnimationConstant",
  1602. "stageFlags": 1,
  1603. "binding": 8,
  1604. "members": [
  1605. {
  1606. "name": "u_anim_info",
  1607. "type": 16,
  1608. "count": 1
  1609. }
  1610. ],
  1611. "defines": [
  1612. "TEXTURE_ANIMATION_MODULE_ENABLE"
  1613. ]
  1614. },
  1615. {
  1616. "name": "FragConstants",
  1617. "stageFlags": 16,
  1618. "binding": 9,
  1619. "members": [
  1620. {
  1621. "name": "tintColor",
  1622. "type": 16,
  1623. "count": 1
  1624. }
  1625. ],
  1626. "defines": []
  1627. }
  1628. ],
  1629. "samplerTextures": [
  1630. {
  1631. "name": "color_over_time_tex0",
  1632. "type": 28,
  1633. "count": 1,
  1634. "stageFlags": 1,
  1635. "binding": 10,
  1636. "defines": [
  1637. "COLOR_OVER_TIME_MODULE_ENABLE"
  1638. ]
  1639. },
  1640. {
  1641. "name": "rotation_over_time_tex0",
  1642. "type": 28,
  1643. "count": 1,
  1644. "stageFlags": 1,
  1645. "binding": 11,
  1646. "defines": [
  1647. "ROTATION_OVER_TIME_MODULE_ENABLE"
  1648. ]
  1649. },
  1650. {
  1651. "name": "size_over_time_tex0",
  1652. "type": 28,
  1653. "count": 1,
  1654. "stageFlags": 1,
  1655. "binding": 12,
  1656. "defines": [
  1657. "SIZE_OVER_TIME_MODULE_ENABLE"
  1658. ]
  1659. },
  1660. {
  1661. "name": "force_over_time_tex0",
  1662. "type": 28,
  1663. "count": 1,
  1664. "stageFlags": 1,
  1665. "binding": 13,
  1666. "defines": [
  1667. "FORCE_OVER_TIME_MODULE_ENABLE"
  1668. ]
  1669. },
  1670. {
  1671. "name": "velocity_over_time_tex0",
  1672. "type": 28,
  1673. "count": 1,
  1674. "stageFlags": 1,
  1675. "binding": 14,
  1676. "defines": [
  1677. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  1678. ]
  1679. },
  1680. {
  1681. "name": "texture_animation_tex0",
  1682. "type": 28,
  1683. "count": 1,
  1684. "stageFlags": 1,
  1685. "binding": 15,
  1686. "defines": [
  1687. "TEXTURE_ANIMATION_MODULE_ENABLE"
  1688. ]
  1689. },
  1690. {
  1691. "name": "mainTexture",
  1692. "type": 28,
  1693. "count": 1,
  1694. "stageFlags": 16,
  1695. "binding": 16,
  1696. "defines": []
  1697. }
  1698. ],
  1699. "samplers": [],
  1700. "textures": [],
  1701. "buffers": [],
  1702. "images": [],
  1703. "subpassInputs": []
  1704. },
  1705. {
  1706. "rate": 2,
  1707. "blocks": [],
  1708. "samplerTextures": [],
  1709. "samplers": [],
  1710. "textures": [],
  1711. "buffers": [],
  1712. "images": [],
  1713. "subpassInputs": []
  1714. },
  1715. {
  1716. "rate": 3,
  1717. "blocks": [
  1718. {
  1719. "name": "CCGlobal",
  1720. "stageFlags": 17,
  1721. "tags": {
  1722. "builtin": "global"
  1723. },
  1724. "members": [
  1725. {
  1726. "name": "cc_time",
  1727. "typename": "vec4",
  1728. "type": 16,
  1729. "count": 1,
  1730. "precision": "highp "
  1731. },
  1732. {
  1733. "name": "cc_screenSize",
  1734. "typename": "vec4",
  1735. "type": 16,
  1736. "count": 1,
  1737. "precision": "mediump "
  1738. },
  1739. {
  1740. "name": "cc_nativeSize",
  1741. "typename": "vec4",
  1742. "type": 16,
  1743. "count": 1,
  1744. "precision": "mediump "
  1745. },
  1746. {
  1747. "name": "cc_probeInfo",
  1748. "typename": "vec4",
  1749. "type": 16,
  1750. "count": 1,
  1751. "precision": "mediump "
  1752. },
  1753. {
  1754. "name": "cc_debug_view_mode",
  1755. "typename": "vec4",
  1756. "type": 16,
  1757. "count": 1,
  1758. "precision": "mediump "
  1759. }
  1760. ],
  1761. "defines": []
  1762. },
  1763. {
  1764. "name": "CCCamera",
  1765. "stageFlags": 17,
  1766. "tags": {
  1767. "builtin": "global"
  1768. },
  1769. "members": [
  1770. {
  1771. "name": "cc_matView",
  1772. "typename": "mat4",
  1773. "type": 25,
  1774. "count": 1,
  1775. "precision": "highp "
  1776. },
  1777. {
  1778. "name": "cc_matViewInv",
  1779. "typename": "mat4",
  1780. "type": 25,
  1781. "count": 1,
  1782. "precision": "highp "
  1783. },
  1784. {
  1785. "name": "cc_matProj",
  1786. "typename": "mat4",
  1787. "type": 25,
  1788. "count": 1,
  1789. "precision": "highp "
  1790. },
  1791. {
  1792. "name": "cc_matProjInv",
  1793. "typename": "mat4",
  1794. "type": 25,
  1795. "count": 1,
  1796. "precision": "highp "
  1797. },
  1798. {
  1799. "name": "cc_matViewProj",
  1800. "typename": "mat4",
  1801. "type": 25,
  1802. "count": 1,
  1803. "precision": "highp "
  1804. },
  1805. {
  1806. "name": "cc_matViewProjInv",
  1807. "typename": "mat4",
  1808. "type": 25,
  1809. "count": 1,
  1810. "precision": "highp "
  1811. },
  1812. {
  1813. "name": "cc_cameraPos",
  1814. "typename": "vec4",
  1815. "type": 16,
  1816. "count": 1,
  1817. "precision": "highp "
  1818. },
  1819. {
  1820. "name": "cc_surfaceTransform",
  1821. "typename": "vec4",
  1822. "type": 16,
  1823. "count": 1,
  1824. "precision": "mediump "
  1825. },
  1826. {
  1827. "name": "cc_screenScale",
  1828. "typename": "vec4",
  1829. "type": 16,
  1830. "count": 1,
  1831. "precision": "mediump "
  1832. },
  1833. {
  1834. "name": "cc_exposure",
  1835. "typename": "vec4",
  1836. "type": 16,
  1837. "count": 1,
  1838. "precision": "mediump "
  1839. },
  1840. {
  1841. "name": "cc_mainLitDir",
  1842. "typename": "vec4",
  1843. "type": 16,
  1844. "count": 1,
  1845. "precision": "mediump "
  1846. },
  1847. {
  1848. "name": "cc_mainLitColor",
  1849. "typename": "vec4",
  1850. "type": 16,
  1851. "count": 1,
  1852. "precision": "mediump "
  1853. },
  1854. {
  1855. "name": "cc_ambientSky",
  1856. "typename": "vec4",
  1857. "type": 16,
  1858. "count": 1,
  1859. "precision": "mediump "
  1860. },
  1861. {
  1862. "name": "cc_ambientGround",
  1863. "typename": "vec4",
  1864. "type": 16,
  1865. "count": 1,
  1866. "precision": "mediump "
  1867. },
  1868. {
  1869. "name": "cc_fogColor",
  1870. "typename": "vec4",
  1871. "type": 16,
  1872. "count": 1,
  1873. "precision": "mediump "
  1874. },
  1875. {
  1876. "name": "cc_fogBase",
  1877. "typename": "vec4",
  1878. "type": 16,
  1879. "count": 1,
  1880. "precision": "mediump "
  1881. },
  1882. {
  1883. "name": "cc_fogAdd",
  1884. "typename": "vec4",
  1885. "type": 16,
  1886. "count": 1,
  1887. "precision": "mediump "
  1888. },
  1889. {
  1890. "name": "cc_nearFar",
  1891. "typename": "vec4",
  1892. "type": 16,
  1893. "count": 1,
  1894. "precision": "mediump "
  1895. },
  1896. {
  1897. "name": "cc_viewPort",
  1898. "typename": "vec4",
  1899. "type": 16,
  1900. "count": 1,
  1901. "precision": "mediump "
  1902. }
  1903. ],
  1904. "defines": []
  1905. }
  1906. ],
  1907. "samplerTextures": [],
  1908. "samplers": [],
  1909. "textures": [],
  1910. "buffers": [],
  1911. "images": [],
  1912. "subpassInputs": []
  1913. }
  1914. ],
  1915. "glsl1": {
  1916. "vert": "\nprecision mediump 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}\nvec4 eulerToQuat(vec3 euler) {\n vec3 er = euler * 0.5;\n float x = er.x, y = er.y, z = er.z;\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;\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}\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}\n uniform vec4 u_sampleInfo;\n uniform vec4 u_worldRot;\n uniform vec4 u_timeDelta;\nattribute vec4 a_position_starttime;\nattribute vec4 a_color;\nattribute vec4 a_dir_life;\nattribute float a_rndSeed;\n#if !CC_INSTANCE_PARTICLE\n attribute vec4 a_size_uv;\n attribute vec4 a_rotation_uv;\n#endif\n#if CC_INSTANCE_PARTICLE\n attribute vec4 a_size_fid;\n attribute vec3 a_rotation;\n attribute vec3 a_uv;\n#endif\n#if CC_RENDER_MODE == 4\n attribute vec3 a_texCoord;\n attribute vec3 a_texCoord3;\n attribute vec3 a_normal;\n attribute vec4 a_color1;\n#endif\nvec3 unpackCurveData (sampler2D tex, vec2 coord) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n return mix(a.xyz, b.xyz, c);\n}\nvec3 unpackCurveData (sampler2D tex, vec2 coord, out float w) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n w = mix(a.w, b.w, c);\n return mix(a.xyz, b.xyz, c);\n}\nfloat pseudoRandom(float x) {\n#if USE_VK_SHADER\n float o = x;\n x = mod(x - 1.0, 2.0) - 1.0;\n float freqVar = 10.16640753482;\n float y = sin(freqVar * floor(o * 0.5 - 0.5));\n float v = max(0.0, 1.0-abs(x));\n v *= 0.7071067812;\n v = y < 0.0 ? -v : v;\n return v;\n#endif\n#if !USE_VK_SHADER\n float seed = mod(x, 233280.);\n float q = (seed * 9301. + 49297.) / 233280.;\n return fract(q);\n#endif\n}\n#if COLOR_OVER_TIME_MODULE_ENABLE\n uniform sampler2D color_over_time_tex0;\n uniform int u_color_mode;\n#endif\n#if ROTATION_OVER_TIME_MODULE_ENABLE\n uniform sampler2D rotation_over_time_tex0;\n uniform int u_rotation_mode;\n#endif\n#if SIZE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D size_over_time_tex0;\n uniform int u_size_mode;\n#endif\n#if FORCE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D force_over_time_tex0;\n uniform int u_force_mode;\n uniform int u_force_space;\n#endif\n#if VELOCITY_OVER_TIME_MODULE_ENABLE\n uniform sampler2D velocity_over_time_tex0;\n uniform int u_velocity_mode;\n uniform int u_velocity_space;\n#endif\n#if TEXTURE_ANIMATION_MODULE_ENABLE\n uniform sampler2D texture_animation_tex0;\n uniform vec4 u_anim_info;\n#endif\nfloat repeat (float t, float length) {\n return t - floor(t / length) * length;\n}\nvec4 rotateQuat (vec4 p, vec4 q) {\n vec3 iv = cross(q.xyz, p.xyz) + q.w * p.xyz;\n vec3 res = p.xyz + 2.0 * cross(q.xyz, iv);\n return vec4(res.xyz, p.w);\n}\nvec4 gpvs_main () {\n float activeTime = u_timeDelta.x - a_position_starttime.w;\n float normalizedTime = clamp(activeTime / a_dir_life.w, 0.0, 1.0);\n vec2 timeCoord0 = vec2(normalizedTime, 0.);\n vec2 timeCoord1 = vec2(normalizedTime, 1.);\n #if CC_RENDER_MODE == 4\n vec2 vertIdx = vec2(a_texCoord.x, a_texCoord.y);\n #endif\n #if CC_RENDER_MODE != 4\n #if !CC_INSTANCE_PARTICLE\n vec2 vertIdx = vec2(a_size_uv.w, a_rotation_uv.w);\n #endif\n #if CC_INSTANCE_PARTICLE\n vec2 vertIdx = a_uv.xy;\n #endif\n #endif\n vec4 velocity = vec4(a_dir_life.xyz, 0.);\n vec4 pos = vec4(a_position_starttime.xyz, 1.);\n #if !CC_INSTANCE_PARTICLE\n vec3 size = a_size_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 size = a_size_fid.xyz;\n #endif\n #if SIZE_OVER_TIME_MODULE_ENABLE\n if (u_size_mode == 1) {\n size *= unpackCurveData(size_over_time_tex0, timeCoord0);\n } else {\n vec3 size_0 = unpackCurveData(size_over_time_tex0, timeCoord0);\n vec3 size_1 = unpackCurveData(size_over_time_tex0, timeCoord1);\n float factor_s = pseudoRandom(a_rndSeed + 39825.);\n size *= mix(size_0, size_1, factor_s);\n }\n #endif\n vec3 compScale = scale.xyz * size;\n #if FORCE_OVER_TIME_MODULE_ENABLE\n vec3 forceAnim = vec3(0.);\n if (u_force_mode == 1) {\n forceAnim = unpackCurveData(force_over_time_tex0, timeCoord0);\n } else {\n vec3 force_0 = unpackCurveData(force_over_time_tex0, timeCoord0);\n vec3 force_1 = unpackCurveData(force_over_time_tex0, timeCoord1);\n float factor_f = pseudoRandom(a_rndSeed + 212165.);\n forceAnim = mix(force_0, force_1, factor_f);\n }\n vec4 forceTrack = vec4(forceAnim, 0.);\n if (u_force_space == 0) {\n forceTrack = rotateQuat(forceTrack, u_worldRot);\n }\n velocity.xyz += forceTrack.xyz;\n #endif\n #if VELOCITY_OVER_TIME_MODULE_ENABLE\n float speedModifier0 = 1.;\n float speedModifier1 = 1.;\n vec3 velocityAnim = vec3(0.);\n if (u_velocity_mode == 1) {\n velocityAnim = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n } else {\n vec3 vectory_0 = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n vec3 vectory_1 = unpackCurveData(velocity_over_time_tex0, timeCoord1, speedModifier1);\n float factor_v = pseudoRandom(a_rndSeed + 197866.);\n velocityAnim = mix(vectory_0, vectory_1, factor_v);\n speedModifier0 = mix(speedModifier0, speedModifier1, factor_v);\n }\n vec4 velocityTrack = vec4(velocityAnim, 0.);\n if (u_velocity_space == 0) {\n velocityTrack = rotateQuat(velocityTrack, u_worldRot);\n }\n velocity.xyz += velocityTrack.xyz;\n velocity.xyz *= speedModifier0;\n #endif\n pos.xyz += velocity.xyz * normalizedTime * a_dir_life.w;\n #if !CC_USE_WORLD_SPACE\n pos = cc_matWorld * pos;\n #if CC_RENDER_MODE == 1\n velocity = rotateQuat(velocity, u_worldRot);\n #endif\n #endif\n #if !CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation;\n #endif\n #if CC_RENDER_MODE != 4\n #if CC_RENDER_MODE == 0\n vec3 rotEuler = startRotation.xyz;\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., startRotation.z);\n #endif\n vec4 rot = quaternionFromEuler(rotEuler);\n #endif\n #if CC_RENDER_MODE == 4\n vec4 rot = quaternionFromEuler(startRotation);\n #endif\n #if ROTATION_OVER_TIME_MODULE_ENABLE\n if (u_rotation_mode == 1) {\n vec3 euler = unpackCurveData(rotation_over_time_tex0, timeCoord0) * normalizedTime * a_dir_life.w;\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n } else {\n vec3 rotation_0 = unpackCurveData(rotation_over_time_tex0, timeCoord0);\n vec3 rotation_1 = unpackCurveData(rotation_over_time_tex0, timeCoord1);\n float factor_r = pseudoRandom(a_rndSeed + 125292.);\n vec3 euler = mix(rotation_0, rotation_1, factor_r) * normalizedTime * a_dir_life.w;\n #if CC_RENDER_MODE == 3 || CC_RENDER_MODE == 2\n euler = vec3(0.0, 0.0, euler.z);\n #endif\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n }\n #endif\n #if COLOR_OVER_TIME_MODULE_ENABLE\n if (u_color_mode == 1) {\n color = a_color * texture2D(color_over_time_tex0, timeCoord0);\n } else {\n vec4 color_0 = texture2D(color_over_time_tex0, timeCoord0);\n vec4 color_1 = texture2D(color_over_time_tex0, timeCoord1);\n float factor_c = pseudoRandom(a_rndSeed + 91041.);\n color = a_color * mix(color_0, color_1, factor_c);\n }\n #endif\n #if !COLOR_OVER_TIME_MODULE_ENABLE\n color = a_color;\n #endif\n #if CC_RENDER_MODE != 4\n vec2 cornerOffset = vec2((vertIdx - 0.5));\n #if CC_RENDER_MODE == 1\n rot = vec4(0.0, 0.0, 0.0, 1.0);\n #endif\n computeVertPos(pos, cornerOffset, rot, compScale\n #if CC_RENDER_MODE == 0 || CC_RENDER_MODE == 3\n , cc_matViewInv\n #endif\n #if CC_RENDER_MODE == 1\n , cc_cameraPos.xyz\n , velocity\n , frameTile_velLenScale.z\n , frameTile_velLenScale.w\n #if !CC_INSTANCE_PARTICLE\n , a_size_uv.w\n #endif\n #if CC_INSTANCE_PARTICLE\n , a_uv.x\n #endif\n #endif\n );\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_color1;\n #endif\n pos = cc_matViewProj * pos;\n float frameIndex = 0.;\n #if TEXTURE_ANIMATION_MODULE_ENABLE\n float startFrame = 0.;\n vec3 frameInfo = vec3(0.);\n if (int(u_anim_info.x) == 1) {\n frameInfo = unpackCurveData(texture_animation_tex0, timeCoord0);\n } else {\n vec3 frameInfo0 = unpackCurveData(texture_animation_tex0, timeCoord0);\n vec3 frameInfo1 = unpackCurveData(texture_animation_tex0, timeCoord1);\n float factor_t = pseudoRandom(a_rndSeed + 90794.);\n frameInfo = mix(frameInfo0, frameInfo1, factor_t);\n }\n startFrame = frameInfo.x / u_anim_info.y;\n float EPSILON = 1e-6;\n frameIndex = repeat(u_anim_info.z * (frameInfo.y + startFrame), 1. + EPSILON);\n #endif\n uv = computeUV(frameIndex, vertIdx, frameTile_velLenScale.xy) * mainTiling_Offset.xy + mainTiling_Offset.zw;\n return pos;\n}\nvoid main() { gl_Position = gpvs_main(); }",
  1917. "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(); }"
  1918. },
  1919. "builtins": {
  1920. "globals": {
  1921. "blocks": [
  1922. {
  1923. "name": "CCGlobal",
  1924. "defines": []
  1925. },
  1926. {
  1927. "name": "CCCamera",
  1928. "defines": []
  1929. }
  1930. ],
  1931. "samplerTextures": [],
  1932. "buffers": [],
  1933. "images": []
  1934. },
  1935. "locals": {
  1936. "blocks": [
  1937. {
  1938. "name": "CCLocal",
  1939. "defines": []
  1940. }
  1941. ],
  1942. "samplerTextures": [],
  1943. "buffers": [],
  1944. "images": []
  1945. },
  1946. "statistics": {
  1947. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 71,
  1948. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 43
  1949. }
  1950. },
  1951. "defines": [
  1952. {
  1953. "name": "CC_RENDER_MODE",
  1954. "type": "number",
  1955. "range": [
  1956. 0,
  1957. 4
  1958. ]
  1959. },
  1960. {
  1961. "name": "CC_INSTANCE_PARTICLE",
  1962. "type": "boolean"
  1963. },
  1964. {
  1965. "name": "USE_VK_SHADER",
  1966. "type": "boolean"
  1967. },
  1968. {
  1969. "name": "COLOR_OVER_TIME_MODULE_ENABLE",
  1970. "type": "boolean"
  1971. },
  1972. {
  1973. "name": "ROTATION_OVER_TIME_MODULE_ENABLE",
  1974. "type": "boolean"
  1975. },
  1976. {
  1977. "name": "SIZE_OVER_TIME_MODULE_ENABLE",
  1978. "type": "boolean"
  1979. },
  1980. {
  1981. "name": "FORCE_OVER_TIME_MODULE_ENABLE",
  1982. "type": "boolean"
  1983. },
  1984. {
  1985. "name": "VELOCITY_OVER_TIME_MODULE_ENABLE",
  1986. "type": "boolean"
  1987. },
  1988. {
  1989. "name": "TEXTURE_ANIMATION_MODULE_ENABLE",
  1990. "type": "boolean"
  1991. },
  1992. {
  1993. "name": "CC_USE_WORLD_SPACE",
  1994. "type": "boolean"
  1995. }
  1996. ]
  1997. },
  1998. {
  1999. "hash": 1067163463,
  2000. "name": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|no-tint-fs:addSmooth",
  2001. "blocks": [
  2002. {
  2003. "name": "Constants",
  2004. "stageFlags": 1,
  2005. "binding": 0,
  2006. "members": [
  2007. {
  2008. "name": "mainTiling_Offset",
  2009. "type": 16,
  2010. "count": 1
  2011. },
  2012. {
  2013. "name": "frameTile_velLenScale",
  2014. "type": 16,
  2015. "count": 1
  2016. },
  2017. {
  2018. "name": "scale",
  2019. "type": 16,
  2020. "count": 1
  2021. },
  2022. {
  2023. "name": "nodeRotation",
  2024. "type": 16,
  2025. "count": 1
  2026. }
  2027. ],
  2028. "defines": []
  2029. },
  2030. {
  2031. "name": "SampleConstants",
  2032. "stageFlags": 1,
  2033. "binding": 1,
  2034. "members": [
  2035. {
  2036. "name": "u_sampleInfo",
  2037. "type": 16,
  2038. "count": 1
  2039. }
  2040. ],
  2041. "defines": []
  2042. },
  2043. {
  2044. "name": "TickConstants",
  2045. "stageFlags": 1,
  2046. "binding": 2,
  2047. "members": [
  2048. {
  2049. "name": "u_worldRot",
  2050. "type": 16,
  2051. "count": 1
  2052. },
  2053. {
  2054. "name": "u_timeDelta",
  2055. "type": 16,
  2056. "count": 1
  2057. }
  2058. ],
  2059. "defines": []
  2060. },
  2061. {
  2062. "name": "ColorConstant",
  2063. "stageFlags": 1,
  2064. "binding": 3,
  2065. "members": [
  2066. {
  2067. "name": "u_color_mode",
  2068. "type": 5,
  2069. "count": 1
  2070. }
  2071. ],
  2072. "defines": [
  2073. "COLOR_OVER_TIME_MODULE_ENABLE"
  2074. ]
  2075. },
  2076. {
  2077. "name": "RotationConstant",
  2078. "stageFlags": 1,
  2079. "binding": 4,
  2080. "members": [
  2081. {
  2082. "name": "u_rotation_mode",
  2083. "type": 5,
  2084. "count": 1
  2085. }
  2086. ],
  2087. "defines": [
  2088. "ROTATION_OVER_TIME_MODULE_ENABLE"
  2089. ]
  2090. },
  2091. {
  2092. "name": "SizeConstant",
  2093. "stageFlags": 1,
  2094. "binding": 5,
  2095. "members": [
  2096. {
  2097. "name": "u_size_mode",
  2098. "type": 5,
  2099. "count": 1
  2100. }
  2101. ],
  2102. "defines": [
  2103. "SIZE_OVER_TIME_MODULE_ENABLE"
  2104. ]
  2105. },
  2106. {
  2107. "name": "ForceConstant",
  2108. "stageFlags": 1,
  2109. "binding": 6,
  2110. "members": [
  2111. {
  2112. "name": "u_force_mode",
  2113. "type": 5,
  2114. "count": 1
  2115. },
  2116. {
  2117. "name": "u_force_space",
  2118. "type": 5,
  2119. "count": 1
  2120. }
  2121. ],
  2122. "defines": [
  2123. "FORCE_OVER_TIME_MODULE_ENABLE"
  2124. ]
  2125. },
  2126. {
  2127. "name": "VelocityConstant",
  2128. "stageFlags": 1,
  2129. "binding": 7,
  2130. "members": [
  2131. {
  2132. "name": "u_velocity_mode",
  2133. "type": 5,
  2134. "count": 1
  2135. },
  2136. {
  2137. "name": "u_velocity_space",
  2138. "type": 5,
  2139. "count": 1
  2140. }
  2141. ],
  2142. "defines": [
  2143. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  2144. ]
  2145. },
  2146. {
  2147. "name": "AnimationConstant",
  2148. "stageFlags": 1,
  2149. "binding": 8,
  2150. "members": [
  2151. {
  2152. "name": "u_anim_info",
  2153. "type": 16,
  2154. "count": 1
  2155. }
  2156. ],
  2157. "defines": [
  2158. "TEXTURE_ANIMATION_MODULE_ENABLE"
  2159. ]
  2160. }
  2161. ],
  2162. "samplerTextures": [
  2163. {
  2164. "name": "color_over_time_tex0",
  2165. "type": 28,
  2166. "count": 1,
  2167. "stageFlags": 1,
  2168. "binding": 9,
  2169. "defines": [
  2170. "COLOR_OVER_TIME_MODULE_ENABLE"
  2171. ]
  2172. },
  2173. {
  2174. "name": "rotation_over_time_tex0",
  2175. "type": 28,
  2176. "count": 1,
  2177. "stageFlags": 1,
  2178. "binding": 10,
  2179. "defines": [
  2180. "ROTATION_OVER_TIME_MODULE_ENABLE"
  2181. ]
  2182. },
  2183. {
  2184. "name": "size_over_time_tex0",
  2185. "type": 28,
  2186. "count": 1,
  2187. "stageFlags": 1,
  2188. "binding": 11,
  2189. "defines": [
  2190. "SIZE_OVER_TIME_MODULE_ENABLE"
  2191. ]
  2192. },
  2193. {
  2194. "name": "force_over_time_tex0",
  2195. "type": 28,
  2196. "count": 1,
  2197. "stageFlags": 1,
  2198. "binding": 12,
  2199. "defines": [
  2200. "FORCE_OVER_TIME_MODULE_ENABLE"
  2201. ]
  2202. },
  2203. {
  2204. "name": "velocity_over_time_tex0",
  2205. "type": 28,
  2206. "count": 1,
  2207. "stageFlags": 1,
  2208. "binding": 13,
  2209. "defines": [
  2210. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  2211. ]
  2212. },
  2213. {
  2214. "name": "texture_animation_tex0",
  2215. "type": 28,
  2216. "count": 1,
  2217. "stageFlags": 1,
  2218. "binding": 14,
  2219. "defines": [
  2220. "TEXTURE_ANIMATION_MODULE_ENABLE"
  2221. ]
  2222. },
  2223. {
  2224. "name": "mainTexture",
  2225. "type": 28,
  2226. "count": 1,
  2227. "stageFlags": 16,
  2228. "binding": 15,
  2229. "defines": []
  2230. }
  2231. ],
  2232. "samplers": [],
  2233. "textures": [],
  2234. "buffers": [],
  2235. "images": [],
  2236. "subpassInputs": [],
  2237. "attributes": [
  2238. {
  2239. "name": "a_position_starttime",
  2240. "format": 44,
  2241. "location": 0,
  2242. "defines": []
  2243. },
  2244. {
  2245. "name": "a_color",
  2246. "format": 44,
  2247. "location": 1,
  2248. "defines": []
  2249. },
  2250. {
  2251. "name": "a_dir_life",
  2252. "format": 44,
  2253. "location": 2,
  2254. "defines": []
  2255. },
  2256. {
  2257. "name": "a_rndSeed",
  2258. "format": 11,
  2259. "location": 3,
  2260. "defines": []
  2261. },
  2262. {
  2263. "name": "a_size_uv",
  2264. "format": 44,
  2265. "location": 4,
  2266. "defines": [
  2267. "!CC_INSTANCE_PARTICLE"
  2268. ]
  2269. },
  2270. {
  2271. "name": "a_rotation_uv",
  2272. "format": 44,
  2273. "location": 5,
  2274. "defines": [
  2275. "!CC_INSTANCE_PARTICLE"
  2276. ]
  2277. },
  2278. {
  2279. "name": "a_size_fid",
  2280. "format": 44,
  2281. "location": 6,
  2282. "defines": [
  2283. "CC_INSTANCE_PARTICLE"
  2284. ]
  2285. },
  2286. {
  2287. "name": "a_rotation",
  2288. "format": 32,
  2289. "location": 7,
  2290. "defines": [
  2291. "CC_INSTANCE_PARTICLE"
  2292. ]
  2293. },
  2294. {
  2295. "name": "a_uv",
  2296. "format": 32,
  2297. "location": 8,
  2298. "defines": [
  2299. "CC_INSTANCE_PARTICLE"
  2300. ]
  2301. },
  2302. {
  2303. "name": "a_texCoord",
  2304. "format": 32,
  2305. "location": 9,
  2306. "defines": [
  2307. "CC_RENDER_MODE"
  2308. ]
  2309. },
  2310. {
  2311. "name": "a_texCoord3",
  2312. "format": 32,
  2313. "location": 10,
  2314. "defines": [
  2315. "CC_RENDER_MODE"
  2316. ]
  2317. },
  2318. {
  2319. "name": "a_normal",
  2320. "format": 32,
  2321. "location": 11,
  2322. "defines": [
  2323. "CC_RENDER_MODE"
  2324. ]
  2325. },
  2326. {
  2327. "name": "a_color1",
  2328. "format": 44,
  2329. "location": 12,
  2330. "defines": [
  2331. "CC_RENDER_MODE"
  2332. ]
  2333. }
  2334. ],
  2335. "fragColors": [
  2336. {
  2337. "name": "cc_FragColor",
  2338. "typename": "vec4",
  2339. "type": 16,
  2340. "count": 1,
  2341. "stageFlags": 16,
  2342. "location": 0,
  2343. "defines": []
  2344. }
  2345. ],
  2346. "descriptors": [
  2347. {
  2348. "rate": 0,
  2349. "blocks": [
  2350. {
  2351. "name": "CCLocal",
  2352. "stageFlags": 1,
  2353. "tags": {
  2354. "builtin": "local"
  2355. },
  2356. "members": [
  2357. {
  2358. "name": "cc_matWorld",
  2359. "typename": "mat4",
  2360. "type": 25,
  2361. "count": 1,
  2362. "precision": "highp "
  2363. },
  2364. {
  2365. "name": "cc_matWorldIT",
  2366. "typename": "mat4",
  2367. "type": 25,
  2368. "count": 1,
  2369. "precision": "highp "
  2370. },
  2371. {
  2372. "name": "cc_lightingMapUVParam",
  2373. "typename": "vec4",
  2374. "type": 16,
  2375. "count": 1,
  2376. "precision": "highp "
  2377. },
  2378. {
  2379. "name": "cc_localShadowBias",
  2380. "typename": "vec4",
  2381. "type": 16,
  2382. "count": 1,
  2383. "precision": "highp "
  2384. },
  2385. {
  2386. "name": "cc_reflectionProbeData1",
  2387. "typename": "vec4",
  2388. "type": 16,
  2389. "count": 1,
  2390. "precision": "highp "
  2391. },
  2392. {
  2393. "name": "cc_reflectionProbeData2",
  2394. "typename": "vec4",
  2395. "type": 16,
  2396. "count": 1,
  2397. "precision": "highp "
  2398. },
  2399. {
  2400. "name": "cc_reflectionProbeBlendData1",
  2401. "typename": "vec4",
  2402. "type": 16,
  2403. "count": 1,
  2404. "precision": "highp "
  2405. },
  2406. {
  2407. "name": "cc_reflectionProbeBlendData2",
  2408. "typename": "vec4",
  2409. "type": 16,
  2410. "count": 1,
  2411. "precision": "highp "
  2412. }
  2413. ],
  2414. "defines": []
  2415. }
  2416. ],
  2417. "samplerTextures": [],
  2418. "samplers": [],
  2419. "textures": [],
  2420. "buffers": [],
  2421. "images": [],
  2422. "subpassInputs": []
  2423. },
  2424. {
  2425. "rate": 1,
  2426. "blocks": [
  2427. {
  2428. "name": "Constants",
  2429. "stageFlags": 1,
  2430. "binding": 0,
  2431. "members": [
  2432. {
  2433. "name": "mainTiling_Offset",
  2434. "type": 16,
  2435. "count": 1
  2436. },
  2437. {
  2438. "name": "frameTile_velLenScale",
  2439. "type": 16,
  2440. "count": 1
  2441. },
  2442. {
  2443. "name": "scale",
  2444. "type": 16,
  2445. "count": 1
  2446. },
  2447. {
  2448. "name": "nodeRotation",
  2449. "type": 16,
  2450. "count": 1
  2451. }
  2452. ],
  2453. "defines": []
  2454. },
  2455. {
  2456. "name": "SampleConstants",
  2457. "stageFlags": 1,
  2458. "binding": 1,
  2459. "members": [
  2460. {
  2461. "name": "u_sampleInfo",
  2462. "type": 16,
  2463. "count": 1
  2464. }
  2465. ],
  2466. "defines": []
  2467. },
  2468. {
  2469. "name": "TickConstants",
  2470. "stageFlags": 1,
  2471. "binding": 2,
  2472. "members": [
  2473. {
  2474. "name": "u_worldRot",
  2475. "type": 16,
  2476. "count": 1
  2477. },
  2478. {
  2479. "name": "u_timeDelta",
  2480. "type": 16,
  2481. "count": 1
  2482. }
  2483. ],
  2484. "defines": []
  2485. },
  2486. {
  2487. "name": "ColorConstant",
  2488. "stageFlags": 1,
  2489. "binding": 3,
  2490. "members": [
  2491. {
  2492. "name": "u_color_mode",
  2493. "type": 5,
  2494. "count": 1
  2495. }
  2496. ],
  2497. "defines": [
  2498. "COLOR_OVER_TIME_MODULE_ENABLE"
  2499. ]
  2500. },
  2501. {
  2502. "name": "RotationConstant",
  2503. "stageFlags": 1,
  2504. "binding": 4,
  2505. "members": [
  2506. {
  2507. "name": "u_rotation_mode",
  2508. "type": 5,
  2509. "count": 1
  2510. }
  2511. ],
  2512. "defines": [
  2513. "ROTATION_OVER_TIME_MODULE_ENABLE"
  2514. ]
  2515. },
  2516. {
  2517. "name": "SizeConstant",
  2518. "stageFlags": 1,
  2519. "binding": 5,
  2520. "members": [
  2521. {
  2522. "name": "u_size_mode",
  2523. "type": 5,
  2524. "count": 1
  2525. }
  2526. ],
  2527. "defines": [
  2528. "SIZE_OVER_TIME_MODULE_ENABLE"
  2529. ]
  2530. },
  2531. {
  2532. "name": "ForceConstant",
  2533. "stageFlags": 1,
  2534. "binding": 6,
  2535. "members": [
  2536. {
  2537. "name": "u_force_mode",
  2538. "type": 5,
  2539. "count": 1
  2540. },
  2541. {
  2542. "name": "u_force_space",
  2543. "type": 5,
  2544. "count": 1
  2545. }
  2546. ],
  2547. "defines": [
  2548. "FORCE_OVER_TIME_MODULE_ENABLE"
  2549. ]
  2550. },
  2551. {
  2552. "name": "VelocityConstant",
  2553. "stageFlags": 1,
  2554. "binding": 7,
  2555. "members": [
  2556. {
  2557. "name": "u_velocity_mode",
  2558. "type": 5,
  2559. "count": 1
  2560. },
  2561. {
  2562. "name": "u_velocity_space",
  2563. "type": 5,
  2564. "count": 1
  2565. }
  2566. ],
  2567. "defines": [
  2568. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  2569. ]
  2570. },
  2571. {
  2572. "name": "AnimationConstant",
  2573. "stageFlags": 1,
  2574. "binding": 8,
  2575. "members": [
  2576. {
  2577. "name": "u_anim_info",
  2578. "type": 16,
  2579. "count": 1
  2580. }
  2581. ],
  2582. "defines": [
  2583. "TEXTURE_ANIMATION_MODULE_ENABLE"
  2584. ]
  2585. }
  2586. ],
  2587. "samplerTextures": [
  2588. {
  2589. "name": "color_over_time_tex0",
  2590. "type": 28,
  2591. "count": 1,
  2592. "stageFlags": 1,
  2593. "binding": 9,
  2594. "defines": [
  2595. "COLOR_OVER_TIME_MODULE_ENABLE"
  2596. ]
  2597. },
  2598. {
  2599. "name": "rotation_over_time_tex0",
  2600. "type": 28,
  2601. "count": 1,
  2602. "stageFlags": 1,
  2603. "binding": 10,
  2604. "defines": [
  2605. "ROTATION_OVER_TIME_MODULE_ENABLE"
  2606. ]
  2607. },
  2608. {
  2609. "name": "size_over_time_tex0",
  2610. "type": 28,
  2611. "count": 1,
  2612. "stageFlags": 1,
  2613. "binding": 11,
  2614. "defines": [
  2615. "SIZE_OVER_TIME_MODULE_ENABLE"
  2616. ]
  2617. },
  2618. {
  2619. "name": "force_over_time_tex0",
  2620. "type": 28,
  2621. "count": 1,
  2622. "stageFlags": 1,
  2623. "binding": 12,
  2624. "defines": [
  2625. "FORCE_OVER_TIME_MODULE_ENABLE"
  2626. ]
  2627. },
  2628. {
  2629. "name": "velocity_over_time_tex0",
  2630. "type": 28,
  2631. "count": 1,
  2632. "stageFlags": 1,
  2633. "binding": 13,
  2634. "defines": [
  2635. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  2636. ]
  2637. },
  2638. {
  2639. "name": "texture_animation_tex0",
  2640. "type": 28,
  2641. "count": 1,
  2642. "stageFlags": 1,
  2643. "binding": 14,
  2644. "defines": [
  2645. "TEXTURE_ANIMATION_MODULE_ENABLE"
  2646. ]
  2647. },
  2648. {
  2649. "name": "mainTexture",
  2650. "type": 28,
  2651. "count": 1,
  2652. "stageFlags": 16,
  2653. "binding": 15,
  2654. "defines": []
  2655. }
  2656. ],
  2657. "samplers": [],
  2658. "textures": [],
  2659. "buffers": [],
  2660. "images": [],
  2661. "subpassInputs": []
  2662. },
  2663. {
  2664. "rate": 2,
  2665. "blocks": [],
  2666. "samplerTextures": [],
  2667. "samplers": [],
  2668. "textures": [],
  2669. "buffers": [],
  2670. "images": [],
  2671. "subpassInputs": []
  2672. },
  2673. {
  2674. "rate": 3,
  2675. "blocks": [
  2676. {
  2677. "name": "CCGlobal",
  2678. "stageFlags": 17,
  2679. "tags": {
  2680. "builtin": "global"
  2681. },
  2682. "members": [
  2683. {
  2684. "name": "cc_time",
  2685. "typename": "vec4",
  2686. "type": 16,
  2687. "count": 1,
  2688. "precision": "highp "
  2689. },
  2690. {
  2691. "name": "cc_screenSize",
  2692. "typename": "vec4",
  2693. "type": 16,
  2694. "count": 1,
  2695. "precision": "mediump "
  2696. },
  2697. {
  2698. "name": "cc_nativeSize",
  2699. "typename": "vec4",
  2700. "type": 16,
  2701. "count": 1,
  2702. "precision": "mediump "
  2703. },
  2704. {
  2705. "name": "cc_probeInfo",
  2706. "typename": "vec4",
  2707. "type": 16,
  2708. "count": 1,
  2709. "precision": "mediump "
  2710. },
  2711. {
  2712. "name": "cc_debug_view_mode",
  2713. "typename": "vec4",
  2714. "type": 16,
  2715. "count": 1,
  2716. "precision": "mediump "
  2717. }
  2718. ],
  2719. "defines": []
  2720. },
  2721. {
  2722. "name": "CCCamera",
  2723. "stageFlags": 17,
  2724. "tags": {
  2725. "builtin": "global"
  2726. },
  2727. "members": [
  2728. {
  2729. "name": "cc_matView",
  2730. "typename": "mat4",
  2731. "type": 25,
  2732. "count": 1,
  2733. "precision": "highp "
  2734. },
  2735. {
  2736. "name": "cc_matViewInv",
  2737. "typename": "mat4",
  2738. "type": 25,
  2739. "count": 1,
  2740. "precision": "highp "
  2741. },
  2742. {
  2743. "name": "cc_matProj",
  2744. "typename": "mat4",
  2745. "type": 25,
  2746. "count": 1,
  2747. "precision": "highp "
  2748. },
  2749. {
  2750. "name": "cc_matProjInv",
  2751. "typename": "mat4",
  2752. "type": 25,
  2753. "count": 1,
  2754. "precision": "highp "
  2755. },
  2756. {
  2757. "name": "cc_matViewProj",
  2758. "typename": "mat4",
  2759. "type": 25,
  2760. "count": 1,
  2761. "precision": "highp "
  2762. },
  2763. {
  2764. "name": "cc_matViewProjInv",
  2765. "typename": "mat4",
  2766. "type": 25,
  2767. "count": 1,
  2768. "precision": "highp "
  2769. },
  2770. {
  2771. "name": "cc_cameraPos",
  2772. "typename": "vec4",
  2773. "type": 16,
  2774. "count": 1,
  2775. "precision": "highp "
  2776. },
  2777. {
  2778. "name": "cc_surfaceTransform",
  2779. "typename": "vec4",
  2780. "type": 16,
  2781. "count": 1,
  2782. "precision": "mediump "
  2783. },
  2784. {
  2785. "name": "cc_screenScale",
  2786. "typename": "vec4",
  2787. "type": 16,
  2788. "count": 1,
  2789. "precision": "mediump "
  2790. },
  2791. {
  2792. "name": "cc_exposure",
  2793. "typename": "vec4",
  2794. "type": 16,
  2795. "count": 1,
  2796. "precision": "mediump "
  2797. },
  2798. {
  2799. "name": "cc_mainLitDir",
  2800. "typename": "vec4",
  2801. "type": 16,
  2802. "count": 1,
  2803. "precision": "mediump "
  2804. },
  2805. {
  2806. "name": "cc_mainLitColor",
  2807. "typename": "vec4",
  2808. "type": 16,
  2809. "count": 1,
  2810. "precision": "mediump "
  2811. },
  2812. {
  2813. "name": "cc_ambientSky",
  2814. "typename": "vec4",
  2815. "type": 16,
  2816. "count": 1,
  2817. "precision": "mediump "
  2818. },
  2819. {
  2820. "name": "cc_ambientGround",
  2821. "typename": "vec4",
  2822. "type": 16,
  2823. "count": 1,
  2824. "precision": "mediump "
  2825. },
  2826. {
  2827. "name": "cc_fogColor",
  2828. "typename": "vec4",
  2829. "type": 16,
  2830. "count": 1,
  2831. "precision": "mediump "
  2832. },
  2833. {
  2834. "name": "cc_fogBase",
  2835. "typename": "vec4",
  2836. "type": 16,
  2837. "count": 1,
  2838. "precision": "mediump "
  2839. },
  2840. {
  2841. "name": "cc_fogAdd",
  2842. "typename": "vec4",
  2843. "type": 16,
  2844. "count": 1,
  2845. "precision": "mediump "
  2846. },
  2847. {
  2848. "name": "cc_nearFar",
  2849. "typename": "vec4",
  2850. "type": 16,
  2851. "count": 1,
  2852. "precision": "mediump "
  2853. },
  2854. {
  2855. "name": "cc_viewPort",
  2856. "typename": "vec4",
  2857. "type": 16,
  2858. "count": 1,
  2859. "precision": "mediump "
  2860. }
  2861. ],
  2862. "defines": []
  2863. }
  2864. ],
  2865. "samplerTextures": [],
  2866. "samplers": [],
  2867. "textures": [],
  2868. "buffers": [],
  2869. "images": [],
  2870. "subpassInputs": []
  2871. }
  2872. ],
  2873. "glsl1": {
  2874. "vert": "\nprecision mediump 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}\nvec4 eulerToQuat(vec3 euler) {\n vec3 er = euler * 0.5;\n float x = er.x, y = er.y, z = er.z;\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;\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}\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}\n uniform vec4 u_sampleInfo;\n uniform vec4 u_worldRot;\n uniform vec4 u_timeDelta;\nattribute vec4 a_position_starttime;\nattribute vec4 a_color;\nattribute vec4 a_dir_life;\nattribute float a_rndSeed;\n#if !CC_INSTANCE_PARTICLE\n attribute vec4 a_size_uv;\n attribute vec4 a_rotation_uv;\n#endif\n#if CC_INSTANCE_PARTICLE\n attribute vec4 a_size_fid;\n attribute vec3 a_rotation;\n attribute vec3 a_uv;\n#endif\n#if CC_RENDER_MODE == 4\n attribute vec3 a_texCoord;\n attribute vec3 a_texCoord3;\n attribute vec3 a_normal;\n attribute vec4 a_color1;\n#endif\nvec3 unpackCurveData (sampler2D tex, vec2 coord) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n return mix(a.xyz, b.xyz, c);\n}\nvec3 unpackCurveData (sampler2D tex, vec2 coord, out float w) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n w = mix(a.w, b.w, c);\n return mix(a.xyz, b.xyz, c);\n}\nfloat pseudoRandom(float x) {\n#if USE_VK_SHADER\n float o = x;\n x = mod(x - 1.0, 2.0) - 1.0;\n float freqVar = 10.16640753482;\n float y = sin(freqVar * floor(o * 0.5 - 0.5));\n float v = max(0.0, 1.0-abs(x));\n v *= 0.7071067812;\n v = y < 0.0 ? -v : v;\n return v;\n#endif\n#if !USE_VK_SHADER\n float seed = mod(x, 233280.);\n float q = (seed * 9301. + 49297.) / 233280.;\n return fract(q);\n#endif\n}\n#if COLOR_OVER_TIME_MODULE_ENABLE\n uniform sampler2D color_over_time_tex0;\n uniform int u_color_mode;\n#endif\n#if ROTATION_OVER_TIME_MODULE_ENABLE\n uniform sampler2D rotation_over_time_tex0;\n uniform int u_rotation_mode;\n#endif\n#if SIZE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D size_over_time_tex0;\n uniform int u_size_mode;\n#endif\n#if FORCE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D force_over_time_tex0;\n uniform int u_force_mode;\n uniform int u_force_space;\n#endif\n#if VELOCITY_OVER_TIME_MODULE_ENABLE\n uniform sampler2D velocity_over_time_tex0;\n uniform int u_velocity_mode;\n uniform int u_velocity_space;\n#endif\n#if TEXTURE_ANIMATION_MODULE_ENABLE\n uniform sampler2D texture_animation_tex0;\n uniform vec4 u_anim_info;\n#endif\nfloat repeat (float t, float length) {\n return t - floor(t / length) * length;\n}\nvec4 rotateQuat (vec4 p, vec4 q) {\n vec3 iv = cross(q.xyz, p.xyz) + q.w * p.xyz;\n vec3 res = p.xyz + 2.0 * cross(q.xyz, iv);\n return vec4(res.xyz, p.w);\n}\nvec4 gpvs_main () {\n float activeTime = u_timeDelta.x - a_position_starttime.w;\n float normalizedTime = clamp(activeTime / a_dir_life.w, 0.0, 1.0);\n vec2 timeCoord0 = vec2(normalizedTime, 0.);\n vec2 timeCoord1 = vec2(normalizedTime, 1.);\n #if CC_RENDER_MODE == 4\n vec2 vertIdx = vec2(a_texCoord.x, a_texCoord.y);\n #endif\n #if CC_RENDER_MODE != 4\n #if !CC_INSTANCE_PARTICLE\n vec2 vertIdx = vec2(a_size_uv.w, a_rotation_uv.w);\n #endif\n #if CC_INSTANCE_PARTICLE\n vec2 vertIdx = a_uv.xy;\n #endif\n #endif\n vec4 velocity = vec4(a_dir_life.xyz, 0.);\n vec4 pos = vec4(a_position_starttime.xyz, 1.);\n #if !CC_INSTANCE_PARTICLE\n vec3 size = a_size_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 size = a_size_fid.xyz;\n #endif\n #if SIZE_OVER_TIME_MODULE_ENABLE\n if (u_size_mode == 1) {\n size *= unpackCurveData(size_over_time_tex0, timeCoord0);\n } else {\n vec3 size_0 = unpackCurveData(size_over_time_tex0, timeCoord0);\n vec3 size_1 = unpackCurveData(size_over_time_tex0, timeCoord1);\n float factor_s = pseudoRandom(a_rndSeed + 39825.);\n size *= mix(size_0, size_1, factor_s);\n }\n #endif\n vec3 compScale = scale.xyz * size;\n #if FORCE_OVER_TIME_MODULE_ENABLE\n vec3 forceAnim = vec3(0.);\n if (u_force_mode == 1) {\n forceAnim = unpackCurveData(force_over_time_tex0, timeCoord0);\n } else {\n vec3 force_0 = unpackCurveData(force_over_time_tex0, timeCoord0);\n vec3 force_1 = unpackCurveData(force_over_time_tex0, timeCoord1);\n float factor_f = pseudoRandom(a_rndSeed + 212165.);\n forceAnim = mix(force_0, force_1, factor_f);\n }\n vec4 forceTrack = vec4(forceAnim, 0.);\n if (u_force_space == 0) {\n forceTrack = rotateQuat(forceTrack, u_worldRot);\n }\n velocity.xyz += forceTrack.xyz;\n #endif\n #if VELOCITY_OVER_TIME_MODULE_ENABLE\n float speedModifier0 = 1.;\n float speedModifier1 = 1.;\n vec3 velocityAnim = vec3(0.);\n if (u_velocity_mode == 1) {\n velocityAnim = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n } else {\n vec3 vectory_0 = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n vec3 vectory_1 = unpackCurveData(velocity_over_time_tex0, timeCoord1, speedModifier1);\n float factor_v = pseudoRandom(a_rndSeed + 197866.);\n velocityAnim = mix(vectory_0, vectory_1, factor_v);\n speedModifier0 = mix(speedModifier0, speedModifier1, factor_v);\n }\n vec4 velocityTrack = vec4(velocityAnim, 0.);\n if (u_velocity_space == 0) {\n velocityTrack = rotateQuat(velocityTrack, u_worldRot);\n }\n velocity.xyz += velocityTrack.xyz;\n velocity.xyz *= speedModifier0;\n #endif\n pos.xyz += velocity.xyz * normalizedTime * a_dir_life.w;\n #if !CC_USE_WORLD_SPACE\n pos = cc_matWorld * pos;\n #if CC_RENDER_MODE == 1\n velocity = rotateQuat(velocity, u_worldRot);\n #endif\n #endif\n #if !CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation;\n #endif\n #if CC_RENDER_MODE != 4\n #if CC_RENDER_MODE == 0\n vec3 rotEuler = startRotation.xyz;\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., startRotation.z);\n #endif\n vec4 rot = quaternionFromEuler(rotEuler);\n #endif\n #if CC_RENDER_MODE == 4\n vec4 rot = quaternionFromEuler(startRotation);\n #endif\n #if ROTATION_OVER_TIME_MODULE_ENABLE\n if (u_rotation_mode == 1) {\n vec3 euler = unpackCurveData(rotation_over_time_tex0, timeCoord0) * normalizedTime * a_dir_life.w;\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n } else {\n vec3 rotation_0 = unpackCurveData(rotation_over_time_tex0, timeCoord0);\n vec3 rotation_1 = unpackCurveData(rotation_over_time_tex0, timeCoord1);\n float factor_r = pseudoRandom(a_rndSeed + 125292.);\n vec3 euler = mix(rotation_0, rotation_1, factor_r) * normalizedTime * a_dir_life.w;\n #if CC_RENDER_MODE == 3 || CC_RENDER_MODE == 2\n euler = vec3(0.0, 0.0, euler.z);\n #endif\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n }\n #endif\n #if COLOR_OVER_TIME_MODULE_ENABLE\n if (u_color_mode == 1) {\n color = a_color * texture2D(color_over_time_tex0, timeCoord0);\n } else {\n vec4 color_0 = texture2D(color_over_time_tex0, timeCoord0);\n vec4 color_1 = texture2D(color_over_time_tex0, timeCoord1);\n float factor_c = pseudoRandom(a_rndSeed + 91041.);\n color = a_color * mix(color_0, color_1, factor_c);\n }\n #endif\n #if !COLOR_OVER_TIME_MODULE_ENABLE\n color = a_color;\n #endif\n #if CC_RENDER_MODE != 4\n vec2 cornerOffset = vec2((vertIdx - 0.5));\n #if CC_RENDER_MODE == 1\n rot = vec4(0.0, 0.0, 0.0, 1.0);\n #endif\n computeVertPos(pos, cornerOffset, rot, compScale\n #if CC_RENDER_MODE == 0 || CC_RENDER_MODE == 3\n , cc_matViewInv\n #endif\n #if CC_RENDER_MODE == 1\n , cc_cameraPos.xyz\n , velocity\n , frameTile_velLenScale.z\n , frameTile_velLenScale.w\n #if !CC_INSTANCE_PARTICLE\n , a_size_uv.w\n #endif\n #if CC_INSTANCE_PARTICLE\n , a_uv.x\n #endif\n #endif\n );\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_color1;\n #endif\n pos = cc_matViewProj * pos;\n float frameIndex = 0.;\n #if TEXTURE_ANIMATION_MODULE_ENABLE\n float startFrame = 0.;\n vec3 frameInfo = vec3(0.);\n if (int(u_anim_info.x) == 1) {\n frameInfo = unpackCurveData(texture_animation_tex0, timeCoord0);\n } else {\n vec3 frameInfo0 = unpackCurveData(texture_animation_tex0, timeCoord0);\n vec3 frameInfo1 = unpackCurveData(texture_animation_tex0, timeCoord1);\n float factor_t = pseudoRandom(a_rndSeed + 90794.);\n frameInfo = mix(frameInfo0, frameInfo1, factor_t);\n }\n startFrame = frameInfo.x / u_anim_info.y;\n float EPSILON = 1e-6;\n frameIndex = repeat(u_anim_info.z * (frameInfo.y + startFrame), 1. + EPSILON);\n #endif\n uv = computeUV(frameIndex, vertIdx, frameTile_velLenScale.xy) * mainTiling_Offset.xy + mainTiling_Offset.zw;\n return pos;\n}\nvoid main() { gl_Position = gpvs_main(); }",
  2875. "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(); }"
  2876. },
  2877. "builtins": {
  2878. "globals": {
  2879. "blocks": [
  2880. {
  2881. "name": "CCGlobal",
  2882. "defines": []
  2883. },
  2884. {
  2885. "name": "CCCamera",
  2886. "defines": []
  2887. }
  2888. ],
  2889. "samplerTextures": [],
  2890. "buffers": [],
  2891. "images": []
  2892. },
  2893. "locals": {
  2894. "blocks": [
  2895. {
  2896. "name": "CCLocal",
  2897. "defines": []
  2898. }
  2899. ],
  2900. "samplerTextures": [],
  2901. "buffers": [],
  2902. "images": []
  2903. },
  2904. "statistics": {
  2905. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 71,
  2906. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 42
  2907. }
  2908. },
  2909. "defines": [
  2910. {
  2911. "name": "CC_RENDER_MODE",
  2912. "type": "number",
  2913. "range": [
  2914. 0,
  2915. 4
  2916. ]
  2917. },
  2918. {
  2919. "name": "CC_INSTANCE_PARTICLE",
  2920. "type": "boolean"
  2921. },
  2922. {
  2923. "name": "USE_VK_SHADER",
  2924. "type": "boolean"
  2925. },
  2926. {
  2927. "name": "COLOR_OVER_TIME_MODULE_ENABLE",
  2928. "type": "boolean"
  2929. },
  2930. {
  2931. "name": "ROTATION_OVER_TIME_MODULE_ENABLE",
  2932. "type": "boolean"
  2933. },
  2934. {
  2935. "name": "SIZE_OVER_TIME_MODULE_ENABLE",
  2936. "type": "boolean"
  2937. },
  2938. {
  2939. "name": "FORCE_OVER_TIME_MODULE_ENABLE",
  2940. "type": "boolean"
  2941. },
  2942. {
  2943. "name": "VELOCITY_OVER_TIME_MODULE_ENABLE",
  2944. "type": "boolean"
  2945. },
  2946. {
  2947. "name": "TEXTURE_ANIMATION_MODULE_ENABLE",
  2948. "type": "boolean"
  2949. },
  2950. {
  2951. "name": "CC_USE_WORLD_SPACE",
  2952. "type": "boolean"
  2953. }
  2954. ]
  2955. },
  2956. {
  2957. "hash": 3967087977,
  2958. "name": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|no-tint-fs:premultiplied",
  2959. "blocks": [
  2960. {
  2961. "name": "Constants",
  2962. "stageFlags": 1,
  2963. "binding": 0,
  2964. "members": [
  2965. {
  2966. "name": "mainTiling_Offset",
  2967. "type": 16,
  2968. "count": 1
  2969. },
  2970. {
  2971. "name": "frameTile_velLenScale",
  2972. "type": 16,
  2973. "count": 1
  2974. },
  2975. {
  2976. "name": "scale",
  2977. "type": 16,
  2978. "count": 1
  2979. },
  2980. {
  2981. "name": "nodeRotation",
  2982. "type": 16,
  2983. "count": 1
  2984. }
  2985. ],
  2986. "defines": []
  2987. },
  2988. {
  2989. "name": "SampleConstants",
  2990. "stageFlags": 1,
  2991. "binding": 1,
  2992. "members": [
  2993. {
  2994. "name": "u_sampleInfo",
  2995. "type": 16,
  2996. "count": 1
  2997. }
  2998. ],
  2999. "defines": []
  3000. },
  3001. {
  3002. "name": "TickConstants",
  3003. "stageFlags": 1,
  3004. "binding": 2,
  3005. "members": [
  3006. {
  3007. "name": "u_worldRot",
  3008. "type": 16,
  3009. "count": 1
  3010. },
  3011. {
  3012. "name": "u_timeDelta",
  3013. "type": 16,
  3014. "count": 1
  3015. }
  3016. ],
  3017. "defines": []
  3018. },
  3019. {
  3020. "name": "ColorConstant",
  3021. "stageFlags": 1,
  3022. "binding": 3,
  3023. "members": [
  3024. {
  3025. "name": "u_color_mode",
  3026. "type": 5,
  3027. "count": 1
  3028. }
  3029. ],
  3030. "defines": [
  3031. "COLOR_OVER_TIME_MODULE_ENABLE"
  3032. ]
  3033. },
  3034. {
  3035. "name": "RotationConstant",
  3036. "stageFlags": 1,
  3037. "binding": 4,
  3038. "members": [
  3039. {
  3040. "name": "u_rotation_mode",
  3041. "type": 5,
  3042. "count": 1
  3043. }
  3044. ],
  3045. "defines": [
  3046. "ROTATION_OVER_TIME_MODULE_ENABLE"
  3047. ]
  3048. },
  3049. {
  3050. "name": "SizeConstant",
  3051. "stageFlags": 1,
  3052. "binding": 5,
  3053. "members": [
  3054. {
  3055. "name": "u_size_mode",
  3056. "type": 5,
  3057. "count": 1
  3058. }
  3059. ],
  3060. "defines": [
  3061. "SIZE_OVER_TIME_MODULE_ENABLE"
  3062. ]
  3063. },
  3064. {
  3065. "name": "ForceConstant",
  3066. "stageFlags": 1,
  3067. "binding": 6,
  3068. "members": [
  3069. {
  3070. "name": "u_force_mode",
  3071. "type": 5,
  3072. "count": 1
  3073. },
  3074. {
  3075. "name": "u_force_space",
  3076. "type": 5,
  3077. "count": 1
  3078. }
  3079. ],
  3080. "defines": [
  3081. "FORCE_OVER_TIME_MODULE_ENABLE"
  3082. ]
  3083. },
  3084. {
  3085. "name": "VelocityConstant",
  3086. "stageFlags": 1,
  3087. "binding": 7,
  3088. "members": [
  3089. {
  3090. "name": "u_velocity_mode",
  3091. "type": 5,
  3092. "count": 1
  3093. },
  3094. {
  3095. "name": "u_velocity_space",
  3096. "type": 5,
  3097. "count": 1
  3098. }
  3099. ],
  3100. "defines": [
  3101. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  3102. ]
  3103. },
  3104. {
  3105. "name": "AnimationConstant",
  3106. "stageFlags": 1,
  3107. "binding": 8,
  3108. "members": [
  3109. {
  3110. "name": "u_anim_info",
  3111. "type": 16,
  3112. "count": 1
  3113. }
  3114. ],
  3115. "defines": [
  3116. "TEXTURE_ANIMATION_MODULE_ENABLE"
  3117. ]
  3118. }
  3119. ],
  3120. "samplerTextures": [
  3121. {
  3122. "name": "color_over_time_tex0",
  3123. "type": 28,
  3124. "count": 1,
  3125. "stageFlags": 1,
  3126. "binding": 9,
  3127. "defines": [
  3128. "COLOR_OVER_TIME_MODULE_ENABLE"
  3129. ]
  3130. },
  3131. {
  3132. "name": "rotation_over_time_tex0",
  3133. "type": 28,
  3134. "count": 1,
  3135. "stageFlags": 1,
  3136. "binding": 10,
  3137. "defines": [
  3138. "ROTATION_OVER_TIME_MODULE_ENABLE"
  3139. ]
  3140. },
  3141. {
  3142. "name": "size_over_time_tex0",
  3143. "type": 28,
  3144. "count": 1,
  3145. "stageFlags": 1,
  3146. "binding": 11,
  3147. "defines": [
  3148. "SIZE_OVER_TIME_MODULE_ENABLE"
  3149. ]
  3150. },
  3151. {
  3152. "name": "force_over_time_tex0",
  3153. "type": 28,
  3154. "count": 1,
  3155. "stageFlags": 1,
  3156. "binding": 12,
  3157. "defines": [
  3158. "FORCE_OVER_TIME_MODULE_ENABLE"
  3159. ]
  3160. },
  3161. {
  3162. "name": "velocity_over_time_tex0",
  3163. "type": 28,
  3164. "count": 1,
  3165. "stageFlags": 1,
  3166. "binding": 13,
  3167. "defines": [
  3168. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  3169. ]
  3170. },
  3171. {
  3172. "name": "texture_animation_tex0",
  3173. "type": 28,
  3174. "count": 1,
  3175. "stageFlags": 1,
  3176. "binding": 14,
  3177. "defines": [
  3178. "TEXTURE_ANIMATION_MODULE_ENABLE"
  3179. ]
  3180. },
  3181. {
  3182. "name": "mainTexture",
  3183. "type": 28,
  3184. "count": 1,
  3185. "stageFlags": 16,
  3186. "binding": 15,
  3187. "defines": []
  3188. }
  3189. ],
  3190. "samplers": [],
  3191. "textures": [],
  3192. "buffers": [],
  3193. "images": [],
  3194. "subpassInputs": [],
  3195. "attributes": [
  3196. {
  3197. "name": "a_position_starttime",
  3198. "format": 44,
  3199. "location": 0,
  3200. "defines": []
  3201. },
  3202. {
  3203. "name": "a_color",
  3204. "format": 44,
  3205. "location": 1,
  3206. "defines": []
  3207. },
  3208. {
  3209. "name": "a_dir_life",
  3210. "format": 44,
  3211. "location": 2,
  3212. "defines": []
  3213. },
  3214. {
  3215. "name": "a_rndSeed",
  3216. "format": 11,
  3217. "location": 3,
  3218. "defines": []
  3219. },
  3220. {
  3221. "name": "a_size_uv",
  3222. "format": 44,
  3223. "location": 4,
  3224. "defines": [
  3225. "!CC_INSTANCE_PARTICLE"
  3226. ]
  3227. },
  3228. {
  3229. "name": "a_rotation_uv",
  3230. "format": 44,
  3231. "location": 5,
  3232. "defines": [
  3233. "!CC_INSTANCE_PARTICLE"
  3234. ]
  3235. },
  3236. {
  3237. "name": "a_size_fid",
  3238. "format": 44,
  3239. "location": 6,
  3240. "defines": [
  3241. "CC_INSTANCE_PARTICLE"
  3242. ]
  3243. },
  3244. {
  3245. "name": "a_rotation",
  3246. "format": 32,
  3247. "location": 7,
  3248. "defines": [
  3249. "CC_INSTANCE_PARTICLE"
  3250. ]
  3251. },
  3252. {
  3253. "name": "a_uv",
  3254. "format": 32,
  3255. "location": 8,
  3256. "defines": [
  3257. "CC_INSTANCE_PARTICLE"
  3258. ]
  3259. },
  3260. {
  3261. "name": "a_texCoord",
  3262. "format": 32,
  3263. "location": 9,
  3264. "defines": [
  3265. "CC_RENDER_MODE"
  3266. ]
  3267. },
  3268. {
  3269. "name": "a_texCoord3",
  3270. "format": 32,
  3271. "location": 10,
  3272. "defines": [
  3273. "CC_RENDER_MODE"
  3274. ]
  3275. },
  3276. {
  3277. "name": "a_normal",
  3278. "format": 32,
  3279. "location": 11,
  3280. "defines": [
  3281. "CC_RENDER_MODE"
  3282. ]
  3283. },
  3284. {
  3285. "name": "a_color1",
  3286. "format": 44,
  3287. "location": 12,
  3288. "defines": [
  3289. "CC_RENDER_MODE"
  3290. ]
  3291. }
  3292. ],
  3293. "fragColors": [
  3294. {
  3295. "name": "cc_FragColor",
  3296. "typename": "vec4",
  3297. "type": 16,
  3298. "count": 1,
  3299. "stageFlags": 16,
  3300. "location": 0,
  3301. "defines": []
  3302. }
  3303. ],
  3304. "descriptors": [
  3305. {
  3306. "rate": 0,
  3307. "blocks": [
  3308. {
  3309. "name": "CCLocal",
  3310. "stageFlags": 1,
  3311. "tags": {
  3312. "builtin": "local"
  3313. },
  3314. "members": [
  3315. {
  3316. "name": "cc_matWorld",
  3317. "typename": "mat4",
  3318. "type": 25,
  3319. "count": 1,
  3320. "precision": "highp "
  3321. },
  3322. {
  3323. "name": "cc_matWorldIT",
  3324. "typename": "mat4",
  3325. "type": 25,
  3326. "count": 1,
  3327. "precision": "highp "
  3328. },
  3329. {
  3330. "name": "cc_lightingMapUVParam",
  3331. "typename": "vec4",
  3332. "type": 16,
  3333. "count": 1,
  3334. "precision": "highp "
  3335. },
  3336. {
  3337. "name": "cc_localShadowBias",
  3338. "typename": "vec4",
  3339. "type": 16,
  3340. "count": 1,
  3341. "precision": "highp "
  3342. },
  3343. {
  3344. "name": "cc_reflectionProbeData1",
  3345. "typename": "vec4",
  3346. "type": 16,
  3347. "count": 1,
  3348. "precision": "highp "
  3349. },
  3350. {
  3351. "name": "cc_reflectionProbeData2",
  3352. "typename": "vec4",
  3353. "type": 16,
  3354. "count": 1,
  3355. "precision": "highp "
  3356. },
  3357. {
  3358. "name": "cc_reflectionProbeBlendData1",
  3359. "typename": "vec4",
  3360. "type": 16,
  3361. "count": 1,
  3362. "precision": "highp "
  3363. },
  3364. {
  3365. "name": "cc_reflectionProbeBlendData2",
  3366. "typename": "vec4",
  3367. "type": 16,
  3368. "count": 1,
  3369. "precision": "highp "
  3370. }
  3371. ],
  3372. "defines": []
  3373. }
  3374. ],
  3375. "samplerTextures": [],
  3376. "samplers": [],
  3377. "textures": [],
  3378. "buffers": [],
  3379. "images": [],
  3380. "subpassInputs": []
  3381. },
  3382. {
  3383. "rate": 1,
  3384. "blocks": [
  3385. {
  3386. "name": "Constants",
  3387. "stageFlags": 1,
  3388. "binding": 0,
  3389. "members": [
  3390. {
  3391. "name": "mainTiling_Offset",
  3392. "type": 16,
  3393. "count": 1
  3394. },
  3395. {
  3396. "name": "frameTile_velLenScale",
  3397. "type": 16,
  3398. "count": 1
  3399. },
  3400. {
  3401. "name": "scale",
  3402. "type": 16,
  3403. "count": 1
  3404. },
  3405. {
  3406. "name": "nodeRotation",
  3407. "type": 16,
  3408. "count": 1
  3409. }
  3410. ],
  3411. "defines": []
  3412. },
  3413. {
  3414. "name": "SampleConstants",
  3415. "stageFlags": 1,
  3416. "binding": 1,
  3417. "members": [
  3418. {
  3419. "name": "u_sampleInfo",
  3420. "type": 16,
  3421. "count": 1
  3422. }
  3423. ],
  3424. "defines": []
  3425. },
  3426. {
  3427. "name": "TickConstants",
  3428. "stageFlags": 1,
  3429. "binding": 2,
  3430. "members": [
  3431. {
  3432. "name": "u_worldRot",
  3433. "type": 16,
  3434. "count": 1
  3435. },
  3436. {
  3437. "name": "u_timeDelta",
  3438. "type": 16,
  3439. "count": 1
  3440. }
  3441. ],
  3442. "defines": []
  3443. },
  3444. {
  3445. "name": "ColorConstant",
  3446. "stageFlags": 1,
  3447. "binding": 3,
  3448. "members": [
  3449. {
  3450. "name": "u_color_mode",
  3451. "type": 5,
  3452. "count": 1
  3453. }
  3454. ],
  3455. "defines": [
  3456. "COLOR_OVER_TIME_MODULE_ENABLE"
  3457. ]
  3458. },
  3459. {
  3460. "name": "RotationConstant",
  3461. "stageFlags": 1,
  3462. "binding": 4,
  3463. "members": [
  3464. {
  3465. "name": "u_rotation_mode",
  3466. "type": 5,
  3467. "count": 1
  3468. }
  3469. ],
  3470. "defines": [
  3471. "ROTATION_OVER_TIME_MODULE_ENABLE"
  3472. ]
  3473. },
  3474. {
  3475. "name": "SizeConstant",
  3476. "stageFlags": 1,
  3477. "binding": 5,
  3478. "members": [
  3479. {
  3480. "name": "u_size_mode",
  3481. "type": 5,
  3482. "count": 1
  3483. }
  3484. ],
  3485. "defines": [
  3486. "SIZE_OVER_TIME_MODULE_ENABLE"
  3487. ]
  3488. },
  3489. {
  3490. "name": "ForceConstant",
  3491. "stageFlags": 1,
  3492. "binding": 6,
  3493. "members": [
  3494. {
  3495. "name": "u_force_mode",
  3496. "type": 5,
  3497. "count": 1
  3498. },
  3499. {
  3500. "name": "u_force_space",
  3501. "type": 5,
  3502. "count": 1
  3503. }
  3504. ],
  3505. "defines": [
  3506. "FORCE_OVER_TIME_MODULE_ENABLE"
  3507. ]
  3508. },
  3509. {
  3510. "name": "VelocityConstant",
  3511. "stageFlags": 1,
  3512. "binding": 7,
  3513. "members": [
  3514. {
  3515. "name": "u_velocity_mode",
  3516. "type": 5,
  3517. "count": 1
  3518. },
  3519. {
  3520. "name": "u_velocity_space",
  3521. "type": 5,
  3522. "count": 1
  3523. }
  3524. ],
  3525. "defines": [
  3526. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  3527. ]
  3528. },
  3529. {
  3530. "name": "AnimationConstant",
  3531. "stageFlags": 1,
  3532. "binding": 8,
  3533. "members": [
  3534. {
  3535. "name": "u_anim_info",
  3536. "type": 16,
  3537. "count": 1
  3538. }
  3539. ],
  3540. "defines": [
  3541. "TEXTURE_ANIMATION_MODULE_ENABLE"
  3542. ]
  3543. }
  3544. ],
  3545. "samplerTextures": [
  3546. {
  3547. "name": "color_over_time_tex0",
  3548. "type": 28,
  3549. "count": 1,
  3550. "stageFlags": 1,
  3551. "binding": 9,
  3552. "defines": [
  3553. "COLOR_OVER_TIME_MODULE_ENABLE"
  3554. ]
  3555. },
  3556. {
  3557. "name": "rotation_over_time_tex0",
  3558. "type": 28,
  3559. "count": 1,
  3560. "stageFlags": 1,
  3561. "binding": 10,
  3562. "defines": [
  3563. "ROTATION_OVER_TIME_MODULE_ENABLE"
  3564. ]
  3565. },
  3566. {
  3567. "name": "size_over_time_tex0",
  3568. "type": 28,
  3569. "count": 1,
  3570. "stageFlags": 1,
  3571. "binding": 11,
  3572. "defines": [
  3573. "SIZE_OVER_TIME_MODULE_ENABLE"
  3574. ]
  3575. },
  3576. {
  3577. "name": "force_over_time_tex0",
  3578. "type": 28,
  3579. "count": 1,
  3580. "stageFlags": 1,
  3581. "binding": 12,
  3582. "defines": [
  3583. "FORCE_OVER_TIME_MODULE_ENABLE"
  3584. ]
  3585. },
  3586. {
  3587. "name": "velocity_over_time_tex0",
  3588. "type": 28,
  3589. "count": 1,
  3590. "stageFlags": 1,
  3591. "binding": 13,
  3592. "defines": [
  3593. "VELOCITY_OVER_TIME_MODULE_ENABLE"
  3594. ]
  3595. },
  3596. {
  3597. "name": "texture_animation_tex0",
  3598. "type": 28,
  3599. "count": 1,
  3600. "stageFlags": 1,
  3601. "binding": 14,
  3602. "defines": [
  3603. "TEXTURE_ANIMATION_MODULE_ENABLE"
  3604. ]
  3605. },
  3606. {
  3607. "name": "mainTexture",
  3608. "type": 28,
  3609. "count": 1,
  3610. "stageFlags": 16,
  3611. "binding": 15,
  3612. "defines": []
  3613. }
  3614. ],
  3615. "samplers": [],
  3616. "textures": [],
  3617. "buffers": [],
  3618. "images": [],
  3619. "subpassInputs": []
  3620. },
  3621. {
  3622. "rate": 2,
  3623. "blocks": [],
  3624. "samplerTextures": [],
  3625. "samplers": [],
  3626. "textures": [],
  3627. "buffers": [],
  3628. "images": [],
  3629. "subpassInputs": []
  3630. },
  3631. {
  3632. "rate": 3,
  3633. "blocks": [
  3634. {
  3635. "name": "CCGlobal",
  3636. "stageFlags": 17,
  3637. "tags": {
  3638. "builtin": "global"
  3639. },
  3640. "members": [
  3641. {
  3642. "name": "cc_time",
  3643. "typename": "vec4",
  3644. "type": 16,
  3645. "count": 1,
  3646. "precision": "highp "
  3647. },
  3648. {
  3649. "name": "cc_screenSize",
  3650. "typename": "vec4",
  3651. "type": 16,
  3652. "count": 1,
  3653. "precision": "mediump "
  3654. },
  3655. {
  3656. "name": "cc_nativeSize",
  3657. "typename": "vec4",
  3658. "type": 16,
  3659. "count": 1,
  3660. "precision": "mediump "
  3661. },
  3662. {
  3663. "name": "cc_probeInfo",
  3664. "typename": "vec4",
  3665. "type": 16,
  3666. "count": 1,
  3667. "precision": "mediump "
  3668. },
  3669. {
  3670. "name": "cc_debug_view_mode",
  3671. "typename": "vec4",
  3672. "type": 16,
  3673. "count": 1,
  3674. "precision": "mediump "
  3675. }
  3676. ],
  3677. "defines": []
  3678. },
  3679. {
  3680. "name": "CCCamera",
  3681. "stageFlags": 17,
  3682. "tags": {
  3683. "builtin": "global"
  3684. },
  3685. "members": [
  3686. {
  3687. "name": "cc_matView",
  3688. "typename": "mat4",
  3689. "type": 25,
  3690. "count": 1,
  3691. "precision": "highp "
  3692. },
  3693. {
  3694. "name": "cc_matViewInv",
  3695. "typename": "mat4",
  3696. "type": 25,
  3697. "count": 1,
  3698. "precision": "highp "
  3699. },
  3700. {
  3701. "name": "cc_matProj",
  3702. "typename": "mat4",
  3703. "type": 25,
  3704. "count": 1,
  3705. "precision": "highp "
  3706. },
  3707. {
  3708. "name": "cc_matProjInv",
  3709. "typename": "mat4",
  3710. "type": 25,
  3711. "count": 1,
  3712. "precision": "highp "
  3713. },
  3714. {
  3715. "name": "cc_matViewProj",
  3716. "typename": "mat4",
  3717. "type": 25,
  3718. "count": 1,
  3719. "precision": "highp "
  3720. },
  3721. {
  3722. "name": "cc_matViewProjInv",
  3723. "typename": "mat4",
  3724. "type": 25,
  3725. "count": 1,
  3726. "precision": "highp "
  3727. },
  3728. {
  3729. "name": "cc_cameraPos",
  3730. "typename": "vec4",
  3731. "type": 16,
  3732. "count": 1,
  3733. "precision": "highp "
  3734. },
  3735. {
  3736. "name": "cc_surfaceTransform",
  3737. "typename": "vec4",
  3738. "type": 16,
  3739. "count": 1,
  3740. "precision": "mediump "
  3741. },
  3742. {
  3743. "name": "cc_screenScale",
  3744. "typename": "vec4",
  3745. "type": 16,
  3746. "count": 1,
  3747. "precision": "mediump "
  3748. },
  3749. {
  3750. "name": "cc_exposure",
  3751. "typename": "vec4",
  3752. "type": 16,
  3753. "count": 1,
  3754. "precision": "mediump "
  3755. },
  3756. {
  3757. "name": "cc_mainLitDir",
  3758. "typename": "vec4",
  3759. "type": 16,
  3760. "count": 1,
  3761. "precision": "mediump "
  3762. },
  3763. {
  3764. "name": "cc_mainLitColor",
  3765. "typename": "vec4",
  3766. "type": 16,
  3767. "count": 1,
  3768. "precision": "mediump "
  3769. },
  3770. {
  3771. "name": "cc_ambientSky",
  3772. "typename": "vec4",
  3773. "type": 16,
  3774. "count": 1,
  3775. "precision": "mediump "
  3776. },
  3777. {
  3778. "name": "cc_ambientGround",
  3779. "typename": "vec4",
  3780. "type": 16,
  3781. "count": 1,
  3782. "precision": "mediump "
  3783. },
  3784. {
  3785. "name": "cc_fogColor",
  3786. "typename": "vec4",
  3787. "type": 16,
  3788. "count": 1,
  3789. "precision": "mediump "
  3790. },
  3791. {
  3792. "name": "cc_fogBase",
  3793. "typename": "vec4",
  3794. "type": 16,
  3795. "count": 1,
  3796. "precision": "mediump "
  3797. },
  3798. {
  3799. "name": "cc_fogAdd",
  3800. "typename": "vec4",
  3801. "type": 16,
  3802. "count": 1,
  3803. "precision": "mediump "
  3804. },
  3805. {
  3806. "name": "cc_nearFar",
  3807. "typename": "vec4",
  3808. "type": 16,
  3809. "count": 1,
  3810. "precision": "mediump "
  3811. },
  3812. {
  3813. "name": "cc_viewPort",
  3814. "typename": "vec4",
  3815. "type": 16,
  3816. "count": 1,
  3817. "precision": "mediump "
  3818. }
  3819. ],
  3820. "defines": []
  3821. }
  3822. ],
  3823. "samplerTextures": [],
  3824. "samplers": [],
  3825. "textures": [],
  3826. "buffers": [],
  3827. "images": [],
  3828. "subpassInputs": []
  3829. }
  3830. ],
  3831. "glsl1": {
  3832. "vert": "\nprecision mediump 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}\nvec4 eulerToQuat(vec3 euler) {\n vec3 er = euler * 0.5;\n float x = er.x, y = er.y, z = er.z;\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;\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}\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}\n uniform vec4 u_sampleInfo;\n uniform vec4 u_worldRot;\n uniform vec4 u_timeDelta;\nattribute vec4 a_position_starttime;\nattribute vec4 a_color;\nattribute vec4 a_dir_life;\nattribute float a_rndSeed;\n#if !CC_INSTANCE_PARTICLE\n attribute vec4 a_size_uv;\n attribute vec4 a_rotation_uv;\n#endif\n#if CC_INSTANCE_PARTICLE\n attribute vec4 a_size_fid;\n attribute vec3 a_rotation;\n attribute vec3 a_uv;\n#endif\n#if CC_RENDER_MODE == 4\n attribute vec3 a_texCoord;\n attribute vec3 a_texCoord3;\n attribute vec3 a_normal;\n attribute vec4 a_color1;\n#endif\nvec3 unpackCurveData (sampler2D tex, vec2 coord) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n return mix(a.xyz, b.xyz, c);\n}\nvec3 unpackCurveData (sampler2D tex, vec2 coord, out float w) {\n vec4 a = texture2D(tex, coord);\n vec4 b = texture2D(tex, coord + u_sampleInfo.y);\n float c = fract(coord.x * u_sampleInfo.x);\n w = mix(a.w, b.w, c);\n return mix(a.xyz, b.xyz, c);\n}\nfloat pseudoRandom(float x) {\n#if USE_VK_SHADER\n float o = x;\n x = mod(x - 1.0, 2.0) - 1.0;\n float freqVar = 10.16640753482;\n float y = sin(freqVar * floor(o * 0.5 - 0.5));\n float v = max(0.0, 1.0-abs(x));\n v *= 0.7071067812;\n v = y < 0.0 ? -v : v;\n return v;\n#endif\n#if !USE_VK_SHADER\n float seed = mod(x, 233280.);\n float q = (seed * 9301. + 49297.) / 233280.;\n return fract(q);\n#endif\n}\n#if COLOR_OVER_TIME_MODULE_ENABLE\n uniform sampler2D color_over_time_tex0;\n uniform int u_color_mode;\n#endif\n#if ROTATION_OVER_TIME_MODULE_ENABLE\n uniform sampler2D rotation_over_time_tex0;\n uniform int u_rotation_mode;\n#endif\n#if SIZE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D size_over_time_tex0;\n uniform int u_size_mode;\n#endif\n#if FORCE_OVER_TIME_MODULE_ENABLE\n uniform sampler2D force_over_time_tex0;\n uniform int u_force_mode;\n uniform int u_force_space;\n#endif\n#if VELOCITY_OVER_TIME_MODULE_ENABLE\n uniform sampler2D velocity_over_time_tex0;\n uniform int u_velocity_mode;\n uniform int u_velocity_space;\n#endif\n#if TEXTURE_ANIMATION_MODULE_ENABLE\n uniform sampler2D texture_animation_tex0;\n uniform vec4 u_anim_info;\n#endif\nfloat repeat (float t, float length) {\n return t - floor(t / length) * length;\n}\nvec4 rotateQuat (vec4 p, vec4 q) {\n vec3 iv = cross(q.xyz, p.xyz) + q.w * p.xyz;\n vec3 res = p.xyz + 2.0 * cross(q.xyz, iv);\n return vec4(res.xyz, p.w);\n}\nvec4 gpvs_main () {\n float activeTime = u_timeDelta.x - a_position_starttime.w;\n float normalizedTime = clamp(activeTime / a_dir_life.w, 0.0, 1.0);\n vec2 timeCoord0 = vec2(normalizedTime, 0.);\n vec2 timeCoord1 = vec2(normalizedTime, 1.);\n #if CC_RENDER_MODE == 4\n vec2 vertIdx = vec2(a_texCoord.x, a_texCoord.y);\n #endif\n #if CC_RENDER_MODE != 4\n #if !CC_INSTANCE_PARTICLE\n vec2 vertIdx = vec2(a_size_uv.w, a_rotation_uv.w);\n #endif\n #if CC_INSTANCE_PARTICLE\n vec2 vertIdx = a_uv.xy;\n #endif\n #endif\n vec4 velocity = vec4(a_dir_life.xyz, 0.);\n vec4 pos = vec4(a_position_starttime.xyz, 1.);\n #if !CC_INSTANCE_PARTICLE\n vec3 size = a_size_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 size = a_size_fid.xyz;\n #endif\n #if SIZE_OVER_TIME_MODULE_ENABLE\n if (u_size_mode == 1) {\n size *= unpackCurveData(size_over_time_tex0, timeCoord0);\n } else {\n vec3 size_0 = unpackCurveData(size_over_time_tex0, timeCoord0);\n vec3 size_1 = unpackCurveData(size_over_time_tex0, timeCoord1);\n float factor_s = pseudoRandom(a_rndSeed + 39825.);\n size *= mix(size_0, size_1, factor_s);\n }\n #endif\n vec3 compScale = scale.xyz * size;\n #if FORCE_OVER_TIME_MODULE_ENABLE\n vec3 forceAnim = vec3(0.);\n if (u_force_mode == 1) {\n forceAnim = unpackCurveData(force_over_time_tex0, timeCoord0);\n } else {\n vec3 force_0 = unpackCurveData(force_over_time_tex0, timeCoord0);\n vec3 force_1 = unpackCurveData(force_over_time_tex0, timeCoord1);\n float factor_f = pseudoRandom(a_rndSeed + 212165.);\n forceAnim = mix(force_0, force_1, factor_f);\n }\n vec4 forceTrack = vec4(forceAnim, 0.);\n if (u_force_space == 0) {\n forceTrack = rotateQuat(forceTrack, u_worldRot);\n }\n velocity.xyz += forceTrack.xyz;\n #endif\n #if VELOCITY_OVER_TIME_MODULE_ENABLE\n float speedModifier0 = 1.;\n float speedModifier1 = 1.;\n vec3 velocityAnim = vec3(0.);\n if (u_velocity_mode == 1) {\n velocityAnim = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n } else {\n vec3 vectory_0 = unpackCurveData(velocity_over_time_tex0, timeCoord0, speedModifier0);\n vec3 vectory_1 = unpackCurveData(velocity_over_time_tex0, timeCoord1, speedModifier1);\n float factor_v = pseudoRandom(a_rndSeed + 197866.);\n velocityAnim = mix(vectory_0, vectory_1, factor_v);\n speedModifier0 = mix(speedModifier0, speedModifier1, factor_v);\n }\n vec4 velocityTrack = vec4(velocityAnim, 0.);\n if (u_velocity_space == 0) {\n velocityTrack = rotateQuat(velocityTrack, u_worldRot);\n }\n velocity.xyz += velocityTrack.xyz;\n velocity.xyz *= speedModifier0;\n #endif\n pos.xyz += velocity.xyz * normalizedTime * a_dir_life.w;\n #if !CC_USE_WORLD_SPACE\n pos = cc_matWorld * pos;\n #if CC_RENDER_MODE == 1\n velocity = rotateQuat(velocity, u_worldRot);\n #endif\n #endif\n #if !CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation_uv.xyz;\n #endif\n #if CC_INSTANCE_PARTICLE\n vec3 startRotation = a_rotation;\n #endif\n #if CC_RENDER_MODE != 4\n #if CC_RENDER_MODE == 0\n vec3 rotEuler = startRotation.xyz;\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., startRotation.z);\n #endif\n vec4 rot = quaternionFromEuler(rotEuler);\n #endif\n #if CC_RENDER_MODE == 4\n vec4 rot = quaternionFromEuler(startRotation);\n #endif\n #if ROTATION_OVER_TIME_MODULE_ENABLE\n if (u_rotation_mode == 1) {\n vec3 euler = unpackCurveData(rotation_over_time_tex0, timeCoord0) * normalizedTime * a_dir_life.w;\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n } else {\n vec3 rotation_0 = unpackCurveData(rotation_over_time_tex0, timeCoord0);\n vec3 rotation_1 = unpackCurveData(rotation_over_time_tex0, timeCoord1);\n float factor_r = pseudoRandom(a_rndSeed + 125292.);\n vec3 euler = mix(rotation_0, rotation_1, factor_r) * normalizedTime * a_dir_life.w;\n #if CC_RENDER_MODE == 3 || CC_RENDER_MODE == 2\n euler = vec3(0.0, 0.0, euler.z);\n #endif\n vec4 quat = eulerToQuat(euler);\n mat3 mLocal = quatToMat3(quat);\n mat3 mStart = quatToMat3(rot);\n rot = mat3ToQuat(mStart * mLocal);\n }\n #endif\n #if COLOR_OVER_TIME_MODULE_ENABLE\n if (u_color_mode == 1) {\n color = a_color * texture2D(color_over_time_tex0, timeCoord0);\n } else {\n vec4 color_0 = texture2D(color_over_time_tex0, timeCoord0);\n vec4 color_1 = texture2D(color_over_time_tex0, timeCoord1);\n float factor_c = pseudoRandom(a_rndSeed + 91041.);\n color = a_color * mix(color_0, color_1, factor_c);\n }\n #endif\n #if !COLOR_OVER_TIME_MODULE_ENABLE\n color = a_color;\n #endif\n #if CC_RENDER_MODE != 4\n vec2 cornerOffset = vec2((vertIdx - 0.5));\n #if CC_RENDER_MODE == 1\n rot = vec4(0.0, 0.0, 0.0, 1.0);\n #endif\n computeVertPos(pos, cornerOffset, rot, compScale\n #if CC_RENDER_MODE == 0 || CC_RENDER_MODE == 3\n , cc_matViewInv\n #endif\n #if CC_RENDER_MODE == 1\n , cc_cameraPos.xyz\n , velocity\n , frameTile_velLenScale.z\n , frameTile_velLenScale.w\n #if !CC_INSTANCE_PARTICLE\n , a_size_uv.w\n #endif\n #if CC_INSTANCE_PARTICLE\n , a_uv.x\n #endif\n #endif\n );\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_color1;\n #endif\n pos = cc_matViewProj * pos;\n float frameIndex = 0.;\n #if TEXTURE_ANIMATION_MODULE_ENABLE\n float startFrame = 0.;\n vec3 frameInfo = vec3(0.);\n if (int(u_anim_info.x) == 1) {\n frameInfo = unpackCurveData(texture_animation_tex0, timeCoord0);\n } else {\n vec3 frameInfo0 = unpackCurveData(texture_animation_tex0, timeCoord0);\n vec3 frameInfo1 = unpackCurveData(texture_animation_tex0, timeCoord1);\n float factor_t = pseudoRandom(a_rndSeed + 90794.);\n frameInfo = mix(frameInfo0, frameInfo1, factor_t);\n }\n startFrame = frameInfo.x / u_anim_info.y;\n float EPSILON = 1e-6;\n frameIndex = repeat(u_anim_info.z * (frameInfo.y + startFrame), 1. + EPSILON);\n #endif\n uv = computeUV(frameIndex, vertIdx, frameTile_velLenScale.xy) * mainTiling_Offset.xy + mainTiling_Offset.zw;\n return pos;\n}\nvoid main() { gl_Position = gpvs_main(); }",
  3833. "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(); }"
  3834. },
  3835. "builtins": {
  3836. "globals": {
  3837. "blocks": [
  3838. {
  3839. "name": "CCGlobal",
  3840. "defines": []
  3841. },
  3842. {
  3843. "name": "CCCamera",
  3844. "defines": []
  3845. }
  3846. ],
  3847. "samplerTextures": [],
  3848. "buffers": [],
  3849. "images": []
  3850. },
  3851. "locals": {
  3852. "blocks": [
  3853. {
  3854. "name": "CCLocal",
  3855. "defines": []
  3856. }
  3857. ],
  3858. "samplerTextures": [],
  3859. "buffers": [],
  3860. "images": []
  3861. },
  3862. "statistics": {
  3863. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 71,
  3864. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 42
  3865. }
  3866. },
  3867. "defines": [
  3868. {
  3869. "name": "CC_RENDER_MODE",
  3870. "type": "number",
  3871. "range": [
  3872. 0,
  3873. 4
  3874. ]
  3875. },
  3876. {
  3877. "name": "CC_INSTANCE_PARTICLE",
  3878. "type": "boolean"
  3879. },
  3880. {
  3881. "name": "USE_VK_SHADER",
  3882. "type": "boolean"
  3883. },
  3884. {
  3885. "name": "COLOR_OVER_TIME_MODULE_ENABLE",
  3886. "type": "boolean"
  3887. },
  3888. {
  3889. "name": "ROTATION_OVER_TIME_MODULE_ENABLE",
  3890. "type": "boolean"
  3891. },
  3892. {
  3893. "name": "SIZE_OVER_TIME_MODULE_ENABLE",
  3894. "type": "boolean"
  3895. },
  3896. {
  3897. "name": "FORCE_OVER_TIME_MODULE_ENABLE",
  3898. "type": "boolean"
  3899. },
  3900. {
  3901. "name": "VELOCITY_OVER_TIME_MODULE_ENABLE",
  3902. "type": "boolean"
  3903. },
  3904. {
  3905. "name": "TEXTURE_ANIMATION_MODULE_ENABLE",
  3906. "type": "boolean"
  3907. },
  3908. {
  3909. "name": "CC_USE_WORLD_SPACE",
  3910. "type": "boolean"
  3911. }
  3912. ]
  3913. }
  3914. ],
  3915. [
  3916. {
  3917. "name": "add",
  3918. "passes": [
  3919. {
  3920. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|tinted-fs:add",
  3921. "rasterizerState": {
  3922. "cullMode": 0
  3923. },
  3924. "blendState": {
  3925. "targets": [
  3926. {
  3927. "blend": true,
  3928. "blendSrc": 2,
  3929. "blendDst": 1,
  3930. "blendSrcAlpha": 2,
  3931. "blendDstAlpha": 1
  3932. }
  3933. ]
  3934. },
  3935. "depthStencilState": {
  3936. "depthTest": true,
  3937. "depthWrite": false
  3938. },
  3939. "properties": {
  3940. "mainTexture": {
  3941. "value": "grey",
  3942. "type": 28
  3943. },
  3944. "mainTiling_Offset": {
  3945. "type": 16,
  3946. "value": [
  3947. 1,
  3948. 1,
  3949. 0,
  3950. 0
  3951. ]
  3952. },
  3953. "tintColor": {
  3954. "type": 16,
  3955. "value": [
  3956. 0.5,
  3957. 0.5,
  3958. 0.5,
  3959. 0.5
  3960. ]
  3961. }
  3962. }
  3963. },
  3964. {
  3965. "phase": "deferred-forward",
  3966. "propertyIndex": 0,
  3967. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|tinted-fs:add",
  3968. "rasterizerState": {
  3969. "cullMode": 0
  3970. },
  3971. "blendState": {
  3972. "targets": [
  3973. {
  3974. "blend": true,
  3975. "blendSrc": 2,
  3976. "blendDst": 1,
  3977. "blendSrcAlpha": 2,
  3978. "blendDstAlpha": 1
  3979. }
  3980. ]
  3981. },
  3982. "depthStencilState": {
  3983. "depthTest": true,
  3984. "depthWrite": false
  3985. }
  3986. }
  3987. ]
  3988. },
  3989. {
  3990. "name": "alpha-blend",
  3991. "passes": [
  3992. {
  3993. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|tinted-fs:add",
  3994. "rasterizerState": {
  3995. "cullMode": 0
  3996. },
  3997. "blendState": {
  3998. "targets": [
  3999. {
  4000. "blend": true,
  4001. "blendSrc": 2,
  4002. "blendDst": 4,
  4003. "blendSrcAlpha": 0,
  4004. "blendDstAlpha": 1,
  4005. "blendAlphaEq": 4
  4006. }
  4007. ]
  4008. },
  4009. "depthStencilState": {
  4010. "depthTest": true,
  4011. "depthWrite": false
  4012. },
  4013. "properties": {
  4014. "mainTexture": {
  4015. "value": "grey",
  4016. "type": 28
  4017. },
  4018. "mainTiling_Offset": {
  4019. "type": 16,
  4020. "value": [
  4021. 1,
  4022. 1,
  4023. 0,
  4024. 0
  4025. ]
  4026. },
  4027. "tintColor": {
  4028. "type": 16,
  4029. "value": [
  4030. 0.5,
  4031. 0.5,
  4032. 0.5,
  4033. 0.5
  4034. ]
  4035. }
  4036. }
  4037. },
  4038. {
  4039. "phase": "deferred-forward",
  4040. "propertyIndex": 0,
  4041. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|tinted-fs:add",
  4042. "rasterizerState": {
  4043. "cullMode": 0
  4044. },
  4045. "blendState": {
  4046. "targets": [
  4047. {
  4048. "blend": true,
  4049. "blendSrc": 2,
  4050. "blendDst": 4,
  4051. "blendSrcAlpha": 0,
  4052. "blendDstAlpha": 1,
  4053. "blendAlphaEq": 4
  4054. }
  4055. ]
  4056. },
  4057. "depthStencilState": {
  4058. "depthTest": true,
  4059. "depthWrite": false
  4060. }
  4061. }
  4062. ]
  4063. },
  4064. {
  4065. "name": "add-multiply",
  4066. "passes": [
  4067. {
  4068. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|tinted-fs:multiply",
  4069. "rasterizerState": {
  4070. "cullMode": 0
  4071. },
  4072. "blendState": {
  4073. "targets": [
  4074. {
  4075. "blend": true,
  4076. "blendSrc": 7,
  4077. "blendDst": 1,
  4078. "blendSrcAlpha": 0,
  4079. "blendDstAlpha": 3
  4080. }
  4081. ]
  4082. },
  4083. "depthStencilState": {
  4084. "depthTest": true,
  4085. "depthWrite": false
  4086. },
  4087. "properties": {
  4088. "mainTexture": {
  4089. "value": "grey",
  4090. "type": 28
  4091. },
  4092. "mainTiling_Offset": {
  4093. "type": 16,
  4094. "value": [
  4095. 1,
  4096. 1,
  4097. 0,
  4098. 0
  4099. ]
  4100. },
  4101. "tintColor": {
  4102. "type": 16,
  4103. "value": [
  4104. 0.5,
  4105. 0.5,
  4106. 0.5,
  4107. 0.5
  4108. ]
  4109. }
  4110. }
  4111. },
  4112. {
  4113. "phase": "deferred-forward",
  4114. "propertyIndex": 0,
  4115. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|tinted-fs:multiply",
  4116. "rasterizerState": {
  4117. "cullMode": 0
  4118. },
  4119. "blendState": {
  4120. "targets": [
  4121. {
  4122. "blend": true,
  4123. "blendSrc": 7,
  4124. "blendDst": 1,
  4125. "blendSrcAlpha": 0,
  4126. "blendDstAlpha": 3
  4127. }
  4128. ]
  4129. },
  4130. "depthStencilState": {
  4131. "depthTest": true,
  4132. "depthWrite": false
  4133. }
  4134. }
  4135. ]
  4136. },
  4137. {
  4138. "name": "add-smooth",
  4139. "passes": [
  4140. {
  4141. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|no-tint-fs:addSmooth",
  4142. "rasterizerState": {
  4143. "cullMode": 0
  4144. },
  4145. "blendState": {
  4146. "targets": [
  4147. {
  4148. "blend": true,
  4149. "blendSrc": 2,
  4150. "blendDst": 1,
  4151. "blendSrcAlpha": 2,
  4152. "blendDstAlpha": 1
  4153. }
  4154. ]
  4155. },
  4156. "depthStencilState": {
  4157. "depthTest": true,
  4158. "depthWrite": false
  4159. },
  4160. "properties": {
  4161. "mainTexture": {
  4162. "value": "grey",
  4163. "type": 28
  4164. },
  4165. "mainTiling_Offset": {
  4166. "type": 16,
  4167. "value": [
  4168. 1,
  4169. 1,
  4170. 0,
  4171. 0
  4172. ]
  4173. }
  4174. }
  4175. },
  4176. {
  4177. "phase": "deferred-forward",
  4178. "propertyIndex": 0,
  4179. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|no-tint-fs:addSmooth",
  4180. "rasterizerState": {
  4181. "cullMode": 0
  4182. },
  4183. "blendState": {
  4184. "targets": [
  4185. {
  4186. "blend": true,
  4187. "blendSrc": 2,
  4188. "blendDst": 1,
  4189. "blendSrcAlpha": 2,
  4190. "blendDstAlpha": 1
  4191. }
  4192. ]
  4193. },
  4194. "depthStencilState": {
  4195. "depthTest": true,
  4196. "depthWrite": false
  4197. }
  4198. }
  4199. ]
  4200. },
  4201. {
  4202. "name": "premultiply-blend",
  4203. "passes": [
  4204. {
  4205. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|no-tint-fs:premultiplied",
  4206. "rasterizerState": {
  4207. "cullMode": 0
  4208. },
  4209. "blendState": {
  4210. "targets": [
  4211. {
  4212. "blend": true,
  4213. "blendSrc": 2,
  4214. "blendDst": 4,
  4215. "blendSrcAlpha": 0,
  4216. "blendDstAlpha": 1,
  4217. "blendAlphaEq": 4
  4218. }
  4219. ]
  4220. },
  4221. "depthStencilState": {
  4222. "depthTest": true,
  4223. "depthWrite": false
  4224. },
  4225. "properties": {
  4226. "mainTexture": {
  4227. "value": "grey",
  4228. "type": 28
  4229. },
  4230. "mainTiling_Offset": {
  4231. "type": 16,
  4232. "value": [
  4233. 1,
  4234. 1,
  4235. 0,
  4236. 0
  4237. ]
  4238. }
  4239. }
  4240. },
  4241. {
  4242. "phase": "deferred-forward",
  4243. "propertyIndex": 0,
  4244. "program": "particles/builtin-particle-gpu|builtin/internal/particle-vs-gpu:gpvs_main|no-tint-fs:premultiplied",
  4245. "rasterizerState": {
  4246. "cullMode": 0
  4247. },
  4248. "blendState": {
  4249. "targets": [
  4250. {
  4251. "blend": true,
  4252. "blendSrc": 2,
  4253. "blendDst": 4,
  4254. "blendSrcAlpha": 0,
  4255. "blendDstAlpha": 1,
  4256. "blendAlphaEq": 4
  4257. }
  4258. ]
  4259. },
  4260. "depthStencilState": {
  4261. "depthTest": true,
  4262. "depthWrite": false
  4263. }
  4264. }
  4265. ]
  4266. }
  4267. ]
  4268. ]
  4269. ],
  4270. 0,
  4271. 0,
  4272. [],
  4273. [],
  4274. []
  4275. ]