81127eb0-7556-453c-b147-670782dd5e53.json 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "internal/builtin-wireframe",
  4. "_objFlags": 0,
  5. "__editorExtras__": {},
  6. "_native": "",
  7. "techniques": [
  8. {
  9. "name": "opaque",
  10. "passes": [
  11. {
  12. "program": "internal/builtin-wireframe|wireframe-vs:vert|wireframe-fs:frag",
  13. "properties": {
  14. "lineColor": {
  15. "value": [
  16. 1,
  17. 1,
  18. 1,
  19. 1
  20. ],
  21. "type": 16
  22. }
  23. }
  24. }
  25. ]
  26. }
  27. ],
  28. "shaders": [
  29. {
  30. "blocks": [
  31. {
  32. "name": "TexCoords",
  33. "members": [
  34. {
  35. "name": "lineColor",
  36. "type": 16,
  37. "count": 1
  38. }
  39. ],
  40. "defines": [],
  41. "stageFlags": 1,
  42. "binding": 0
  43. }
  44. ],
  45. "samplerTextures": [],
  46. "samplers": [],
  47. "textures": [],
  48. "buffers": [],
  49. "images": [],
  50. "subpassInputs": [],
  51. "attributes": [
  52. {
  53. "name": "a_position",
  54. "defines": [],
  55. "format": 32,
  56. "location": 0
  57. },
  58. {
  59. "name": "a_normal",
  60. "defines": [],
  61. "format": 32,
  62. "location": 1
  63. },
  64. {
  65. "name": "a_texCoord",
  66. "defines": [],
  67. "format": 21,
  68. "location": 2
  69. },
  70. {
  71. "name": "a_tangent",
  72. "defines": [],
  73. "format": 44,
  74. "location": 3
  75. },
  76. {
  77. "name": "a_joints",
  78. "defines": [
  79. "CC_USE_SKINNING"
  80. ],
  81. "location": 4
  82. },
  83. {
  84. "name": "a_weights",
  85. "defines": [
  86. "CC_USE_SKINNING"
  87. ],
  88. "format": 44,
  89. "location": 5
  90. },
  91. {
  92. "name": "a_jointAnimInfo",
  93. "defines": [
  94. "USE_INSTANCING",
  95. "CC_USE_BAKED_ANIMATION"
  96. ],
  97. "format": 44,
  98. "isInstanced": true,
  99. "location": 6
  100. },
  101. {
  102. "name": "a_matWorld0",
  103. "defines": [
  104. "USE_INSTANCING"
  105. ],
  106. "format": 44,
  107. "isInstanced": true,
  108. "location": 7
  109. },
  110. {
  111. "name": "a_matWorld1",
  112. "defines": [
  113. "USE_INSTANCING"
  114. ],
  115. "format": 44,
  116. "isInstanced": true,
  117. "location": 8
  118. },
  119. {
  120. "name": "a_matWorld2",
  121. "defines": [
  122. "USE_INSTANCING"
  123. ],
  124. "format": 44,
  125. "isInstanced": true,
  126. "location": 9
  127. },
  128. {
  129. "name": "a_lightingMapUVParam",
  130. "defines": [
  131. "USE_INSTANCING",
  132. "CC_USE_LIGHTMAP"
  133. ],
  134. "format": 44,
  135. "isInstanced": true,
  136. "location": 10
  137. },
  138. {
  139. "name": "a_localShadowBiasAndProbeId",
  140. "defines": [
  141. "USE_INSTANCING"
  142. ],
  143. "format": 44,
  144. "isInstanced": true,
  145. "location": 11
  146. },
  147. {
  148. "name": "a_reflectionProbeData",
  149. "defines": [
  150. "USE_INSTANCING",
  151. "CC_USE_REFLECTION_PROBE"
  152. ],
  153. "format": 44,
  154. "isInstanced": true,
  155. "location": 12
  156. },
  157. {
  158. "name": "a_sh_linear_const_r",
  159. "defines": [
  160. "USE_INSTANCING",
  161. "CC_USE_LIGHT_PROBE"
  162. ],
  163. "format": 44,
  164. "isInstanced": true,
  165. "location": 13
  166. },
  167. {
  168. "name": "a_sh_linear_const_g",
  169. "defines": [
  170. "USE_INSTANCING",
  171. "CC_USE_LIGHT_PROBE"
  172. ],
  173. "format": 44,
  174. "isInstanced": true,
  175. "location": 14
  176. },
  177. {
  178. "name": "a_sh_linear_const_b",
  179. "defines": [
  180. "USE_INSTANCING",
  181. "CC_USE_LIGHT_PROBE"
  182. ],
  183. "format": 44,
  184. "isInstanced": true,
  185. "location": 15
  186. },
  187. {
  188. "name": "a_vertexId",
  189. "defines": [
  190. "CC_USE_MORPH"
  191. ],
  192. "format": 11,
  193. "location": 16
  194. }
  195. ],
  196. "varyings": [
  197. {
  198. "name": "bary",
  199. "type": 14,
  200. "count": 1,
  201. "defines": [],
  202. "stageFlags": 17,
  203. "location": 0
  204. },
  205. {
  206. "name": "lineCol",
  207. "type": 16,
  208. "count": 1,
  209. "defines": [],
  210. "stageFlags": 17,
  211. "location": 1
  212. }
  213. ],
  214. "fragColors": [
  215. {
  216. "name": "cc_FragColor",
  217. "typename": "vec4",
  218. "type": 16,
  219. "count": 1,
  220. "defines": [],
  221. "stageFlags": 16,
  222. "location": 0
  223. }
  224. ],
  225. "descriptors": [
  226. {
  227. "rate": 0,
  228. "blocks": [
  229. {
  230. "tags": {
  231. "builtin": "local"
  232. },
  233. "name": "CCLocal",
  234. "members": [
  235. {
  236. "name": "cc_matWorld",
  237. "typename": "mat4",
  238. "type": 25,
  239. "count": 1,
  240. "precision": "highp "
  241. },
  242. {
  243. "name": "cc_matWorldIT",
  244. "typename": "mat4",
  245. "type": 25,
  246. "count": 1,
  247. "precision": "highp "
  248. },
  249. {
  250. "name": "cc_lightingMapUVParam",
  251. "typename": "vec4",
  252. "type": 16,
  253. "count": 1,
  254. "precision": "highp "
  255. },
  256. {
  257. "name": "cc_localShadowBias",
  258. "typename": "vec4",
  259. "type": 16,
  260. "count": 1,
  261. "precision": "highp "
  262. },
  263. {
  264. "name": "cc_reflectionProbeData1",
  265. "typename": "vec4",
  266. "type": 16,
  267. "count": 1,
  268. "precision": "highp "
  269. },
  270. {
  271. "name": "cc_reflectionProbeData2",
  272. "typename": "vec4",
  273. "type": 16,
  274. "count": 1,
  275. "precision": "highp "
  276. },
  277. {
  278. "name": "cc_reflectionProbeBlendData1",
  279. "typename": "vec4",
  280. "type": 16,
  281. "count": 1,
  282. "precision": "highp "
  283. },
  284. {
  285. "name": "cc_reflectionProbeBlendData2",
  286. "typename": "vec4",
  287. "type": 16,
  288. "count": 1,
  289. "precision": "highp "
  290. }
  291. ],
  292. "defines": [
  293. "!USE_INSTANCING"
  294. ],
  295. "stageFlags": 1
  296. },
  297. {
  298. "tags": {
  299. "builtin": "local"
  300. },
  301. "name": "CCMorph",
  302. "members": [
  303. {
  304. "name": "cc_displacementWeights",
  305. "typename": "vec4",
  306. "type": 16,
  307. "count": 15,
  308. "isArray": true
  309. },
  310. {
  311. "name": "cc_displacementTextureInfo",
  312. "typename": "vec4",
  313. "type": 16,
  314. "count": 1
  315. }
  316. ],
  317. "defines": [
  318. "CC_USE_MORPH"
  319. ],
  320. "stageFlags": 1
  321. },
  322. {
  323. "tags": {
  324. "builtin": "local"
  325. },
  326. "name": "CCSkinningTexture",
  327. "members": [
  328. {
  329. "name": "cc_jointTextureInfo",
  330. "typename": "vec4",
  331. "type": 16,
  332. "count": 1,
  333. "precision": "highp "
  334. }
  335. ],
  336. "defines": [
  337. "CC_USE_SKINNING",
  338. "CC_USE_BAKED_ANIMATION"
  339. ],
  340. "stageFlags": 1
  341. },
  342. {
  343. "tags": {
  344. "builtin": "local"
  345. },
  346. "name": "CCSkinningAnimation",
  347. "members": [
  348. {
  349. "name": "cc_jointAnimInfo",
  350. "typename": "vec4",
  351. "type": 16,
  352. "count": 1,
  353. "precision": "highp "
  354. }
  355. ],
  356. "defines": [
  357. "CC_USE_SKINNING",
  358. "CC_USE_BAKED_ANIMATION"
  359. ],
  360. "stageFlags": 1
  361. },
  362. {
  363. "tags": {
  364. "builtin": "local"
  365. },
  366. "name": "CCSkinning",
  367. "members": [
  368. {
  369. "name": "cc_joints",
  370. "typename": "vec4",
  371. "type": 16,
  372. "count": 0,
  373. "precision": "highp ",
  374. "isArray": true
  375. }
  376. ],
  377. "defines": [
  378. "CC_USE_SKINNING",
  379. "!CC_USE_BAKED_ANIMATION",
  380. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  381. ],
  382. "stageFlags": 1
  383. }
  384. ],
  385. "samplerTextures": [
  386. {
  387. "tags": {
  388. "builtin": "local"
  389. },
  390. "name": "cc_PositionDisplacements",
  391. "typename": "sampler2D",
  392. "type": 28,
  393. "count": 1,
  394. "defines": [
  395. "CC_USE_MORPH",
  396. "CC_MORPH_TARGET_HAS_POSITION"
  397. ],
  398. "stageFlags": 1
  399. },
  400. {
  401. "tags": {
  402. "builtin": "local"
  403. },
  404. "name": "cc_NormalDisplacements",
  405. "typename": "sampler2D",
  406. "type": 28,
  407. "count": 1,
  408. "defines": [
  409. "CC_USE_MORPH",
  410. "CC_MORPH_TARGET_HAS_NORMAL"
  411. ],
  412. "stageFlags": 1
  413. },
  414. {
  415. "tags": {
  416. "builtin": "local"
  417. },
  418. "name": "cc_TangentDisplacements",
  419. "typename": "sampler2D",
  420. "type": 28,
  421. "count": 1,
  422. "defines": [
  423. "CC_USE_MORPH",
  424. "CC_MORPH_TARGET_HAS_TANGENT"
  425. ],
  426. "stageFlags": 1
  427. },
  428. {
  429. "tags": {
  430. "builtin": "local"
  431. },
  432. "name": "cc_jointTexture",
  433. "typename": "sampler2D",
  434. "type": 28,
  435. "count": 1,
  436. "precision": "highp ",
  437. "defines": [
  438. "CC_USE_SKINNING",
  439. "CC_USE_BAKED_ANIMATION"
  440. ],
  441. "stageFlags": 1
  442. },
  443. {
  444. "tags": {
  445. "builtin": "local"
  446. },
  447. "name": "cc_realtimeJoint",
  448. "typename": "sampler2D",
  449. "type": 28,
  450. "count": 1,
  451. "precision": "highp ",
  452. "defines": [
  453. "CC_USE_SKINNING",
  454. "!CC_USE_BAKED_ANIMATION",
  455. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  456. ],
  457. "stageFlags": 1
  458. }
  459. ],
  460. "samplers": [],
  461. "textures": [],
  462. "buffers": [],
  463. "images": [],
  464. "subpassInputs": []
  465. },
  466. {
  467. "rate": 1,
  468. "blocks": [
  469. {
  470. "name": "TexCoords",
  471. "members": [
  472. {
  473. "name": "lineColor",
  474. "type": 16,
  475. "count": 1
  476. }
  477. ],
  478. "defines": [],
  479. "stageFlags": 1,
  480. "binding": 0
  481. }
  482. ],
  483. "samplerTextures": [],
  484. "samplers": [],
  485. "textures": [],
  486. "buffers": [],
  487. "images": [],
  488. "subpassInputs": []
  489. },
  490. {
  491. "rate": 2,
  492. "blocks": [],
  493. "samplerTextures": [],
  494. "samplers": [],
  495. "textures": [],
  496. "buffers": [],
  497. "images": [],
  498. "subpassInputs": []
  499. },
  500. {
  501. "rate": 3,
  502. "blocks": [
  503. {
  504. "tags": {
  505. "builtin": "global"
  506. },
  507. "name": "CCGlobal",
  508. "members": [
  509. {
  510. "name": "cc_time",
  511. "typename": "vec4",
  512. "type": 16,
  513. "count": 1,
  514. "precision": "highp "
  515. },
  516. {
  517. "name": "cc_screenSize",
  518. "typename": "vec4",
  519. "type": 16,
  520. "count": 1,
  521. "precision": "mediump "
  522. },
  523. {
  524. "name": "cc_nativeSize",
  525. "typename": "vec4",
  526. "type": 16,
  527. "count": 1,
  528. "precision": "mediump "
  529. },
  530. {
  531. "name": "cc_probeInfo",
  532. "typename": "vec4",
  533. "type": 16,
  534. "count": 1,
  535. "precision": "mediump "
  536. },
  537. {
  538. "name": "cc_debug_view_mode",
  539. "typename": "vec4",
  540. "type": 16,
  541. "count": 1,
  542. "precision": "mediump "
  543. }
  544. ],
  545. "defines": [],
  546. "stageFlags": 17
  547. },
  548. {
  549. "tags": {
  550. "builtin": "global"
  551. },
  552. "name": "CCCamera",
  553. "members": [
  554. {
  555. "name": "cc_matView",
  556. "typename": "mat4",
  557. "type": 25,
  558. "count": 1,
  559. "precision": "highp "
  560. },
  561. {
  562. "name": "cc_matViewInv",
  563. "typename": "mat4",
  564. "type": 25,
  565. "count": 1,
  566. "precision": "highp "
  567. },
  568. {
  569. "name": "cc_matProj",
  570. "typename": "mat4",
  571. "type": 25,
  572. "count": 1,
  573. "precision": "highp "
  574. },
  575. {
  576. "name": "cc_matProjInv",
  577. "typename": "mat4",
  578. "type": 25,
  579. "count": 1,
  580. "precision": "highp "
  581. },
  582. {
  583. "name": "cc_matViewProj",
  584. "typename": "mat4",
  585. "type": 25,
  586. "count": 1,
  587. "precision": "highp "
  588. },
  589. {
  590. "name": "cc_matViewProjInv",
  591. "typename": "mat4",
  592. "type": 25,
  593. "count": 1,
  594. "precision": "highp "
  595. },
  596. {
  597. "name": "cc_cameraPos",
  598. "typename": "vec4",
  599. "type": 16,
  600. "count": 1,
  601. "precision": "highp "
  602. },
  603. {
  604. "name": "cc_surfaceTransform",
  605. "typename": "vec4",
  606. "type": 16,
  607. "count": 1,
  608. "precision": "mediump "
  609. },
  610. {
  611. "name": "cc_screenScale",
  612. "typename": "vec4",
  613. "type": 16,
  614. "count": 1,
  615. "precision": "mediump "
  616. },
  617. {
  618. "name": "cc_exposure",
  619. "typename": "vec4",
  620. "type": 16,
  621. "count": 1,
  622. "precision": "mediump "
  623. },
  624. {
  625. "name": "cc_mainLitDir",
  626. "typename": "vec4",
  627. "type": 16,
  628. "count": 1,
  629. "precision": "mediump "
  630. },
  631. {
  632. "name": "cc_mainLitColor",
  633. "typename": "vec4",
  634. "type": 16,
  635. "count": 1,
  636. "precision": "mediump "
  637. },
  638. {
  639. "name": "cc_ambientSky",
  640. "typename": "vec4",
  641. "type": 16,
  642. "count": 1,
  643. "precision": "mediump "
  644. },
  645. {
  646. "name": "cc_ambientGround",
  647. "typename": "vec4",
  648. "type": 16,
  649. "count": 1,
  650. "precision": "mediump "
  651. },
  652. {
  653. "name": "cc_fogColor",
  654. "typename": "vec4",
  655. "type": 16,
  656. "count": 1,
  657. "precision": "mediump "
  658. },
  659. {
  660. "name": "cc_fogBase",
  661. "typename": "vec4",
  662. "type": 16,
  663. "count": 1,
  664. "precision": "mediump "
  665. },
  666. {
  667. "name": "cc_fogAdd",
  668. "typename": "vec4",
  669. "type": 16,
  670. "count": 1,
  671. "precision": "mediump "
  672. },
  673. {
  674. "name": "cc_nearFar",
  675. "typename": "vec4",
  676. "type": 16,
  677. "count": 1,
  678. "precision": "mediump "
  679. },
  680. {
  681. "name": "cc_viewPort",
  682. "typename": "vec4",
  683. "type": 16,
  684. "count": 1,
  685. "precision": "mediump "
  686. }
  687. ],
  688. "defines": [],
  689. "stageFlags": 17
  690. }
  691. ],
  692. "samplerTextures": [],
  693. "samplers": [],
  694. "textures": [],
  695. "buffers": [],
  696. "images": [],
  697. "subpassInputs": []
  698. }
  699. ],
  700. "hash": 3478882548,
  701. "glsl4": {
  702. "vert": "#extension GL_EXT_shader_explicit_arithmetic_types_int32: require\nprecision mediump float;\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nlayout(location = 0) in vec3 a_position;\nlayout(location = 1) in vec3 a_normal;\nlayout(location = 2) in vec2 a_texCoord;\nlayout(location = 3) in vec4 a_tangent;\n#if CC_USE_SKINNING\n layout(location = 4) in u32vec4 a_joints;\n layout(location = 5) in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n layout(location = 6) in highp vec4 a_jointAnimInfo;\n #endif\n layout(location = 7) in vec4 a_matWorld0;\n layout(location = 8) in vec4 a_matWorld1;\n layout(location = 9) in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n layout(location = 10) in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n layout(location = 11) in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n layout(location = 12) in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n layout(location = 13) in vec4 a_sh_linear_const_r;\n layout(location = 14) in vec4 a_sh_linear_const_g;\n layout(location = 15) in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n int getVertexId() {\n return gl_VertexIndex;\n }\n#endif\n#if !USE_INSTANCING\n layout(set = 2, binding = 0) uniform CCLocal {\n highp mat4 cc_matWorld;\n highp mat4 cc_matWorldIT;\n highp vec4 cc_lightingMapUVParam;\n highp vec4 cc_localShadowBias;\n highp vec4 cc_reflectionProbeData1;\n highp vec4 cc_reflectionProbeData2;\n highp vec4 cc_reflectionProbeBlendData1;\n highp vec4 cc_reflectionProbeBlendData2;\n };\n#endif\nvoid CCGetWorldMatrix(out mat4 matWorld)\n{\n #if USE_INSTANCING\n matWorld = mat4(\n vec4(a_matWorld0.xyz, 0.0),\n vec4(a_matWorld1.xyz, 0.0),\n vec4(a_matWorld2.xyz, 0.0),\n vec4(a_matWorld0.w, a_matWorld1.w, a_matWorld2.w, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n #endif\n}\nhighp float decode32 (highp vec4 rgba) {\n rgba = rgba * 255.0;\n highp float Sign = 1.0 - (step(128.0, (rgba[3]) + 0.5)) * 2.0;\n highp float Exponent = 2.0 * (mod(float(int((rgba[3]) + 0.5)), 128.0)) + (step(128.0, (rgba[2]) + 0.5)) - 127.0;\n highp float Mantissa = (mod(float(int((rgba[2]) + 0.5)), 128.0)) * 65536.0 + rgba[1] * 256.0 + rgba[0] + 8388608.0;\n return Sign * exp2(Exponent - 23.0) * Mantissa;\n}\n#if CC_USE_MORPH\n layout(set = 2, binding = 4) uniform CCMorph {\n vec4 cc_displacementWeights[15];\n vec4 cc_displacementTextureInfo;\n };\n #if CC_MORPH_TARGET_HAS_POSITION\n layout(set = 2, binding = 8) uniform sampler2D cc_PositionDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n layout(set = 2, binding = 9) uniform sampler2D cc_NormalDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n layout(set = 2, binding = 10) uniform sampler2D cc_TangentDisplacements;\n #endif\n vec2 getPixelLocation(vec2 textureResolution, int pixelIndex) {\n float pixelIndexF = float(pixelIndex);\n float x = mod(pixelIndexF, textureResolution.x);\n float y = floor(pixelIndexF / textureResolution.x);\n return vec2(x, y);\n }\n vec2 getPixelCoordFromLocation(vec2 location, vec2 textureResolution) {\n return (vec2(location.x, location.y) + .5) / textureResolution;\n }\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int pixelIndex) {\n ivec2 texSize = textureSize(tex, 0);\n return texelFetch(tex, ivec2(pixelIndex % texSize.x, pixelIndex / texSize.x), 0);\n }\n #else\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex * 4;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 x = getPixelCoordFromLocation(location + vec2(0.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 y = getPixelCoordFromLocation(location + vec2(1.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 z = getPixelCoordFromLocation(location + vec2(2.0, 0.0), cc_displacementTextureInfo.xy);\n return vec4(\n decode32(texture(tex, x)),\n decode32(texture(tex, y)),\n decode32(texture(tex, z)),\n 1.0\n );\n }\n #endif\n float getDisplacementWeight(int index) {\n int quot = index / 4;\n int remainder = index - quot * 4;\n if (remainder == 0) {\n return cc_displacementWeights[quot].x;\n } else if (remainder == 1) {\n return cc_displacementWeights[quot].y;\n } else if (remainder == 2) {\n return cc_displacementWeights[quot].z;\n } else {\n return cc_displacementWeights[quot].w;\n }\n }\n vec3 getVec3DisplacementFromTexture(sampler2D tex, int vertexIndex) {\n #if CC_MORPH_PRECOMPUTED\n return fetchVec3ArrayFromTexture(tex, vertexIndex).rgb;\n #else\n vec3 result = vec3(0, 0, 0);\n int nVertices = int(cc_displacementTextureInfo.z);\n for (int iTarget = 0; iTarget < CC_MORPH_TARGET_COUNT; ++iTarget) {\n result += (fetchVec3ArrayFromTexture(tex, nVertices * iTarget + vertexIndex).rgb * getDisplacementWeight(iTarget));\n }\n return result;\n #endif\n }\n #if CC_MORPH_TARGET_HAS_POSITION\n vec3 getPositionDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_PositionDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n vec3 getNormalDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_NormalDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n vec3 getTangentDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_TangentDisplacements, vertexId);\n }\n #endif\n void applyMorph (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n int vertexId = getVertexId();\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n normal.xyz = normal.xyz + getNormalDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n tangent.xyz = tangent.xyz + getTangentDisplacement(vertexId);\n #endif\n }\n void applyMorph (inout vec4 position) {\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(getVertexId());\n #endif\n }\n#endif\n#if CC_USE_SKINNING\n #if CC_USE_BAKED_ANIMATION\n layout(set = 2, binding = 3) uniform CCSkinningTexture {\n highp vec4 cc_jointTextureInfo;\n };\n layout(set = 2, binding = 2) uniform CCSkinningAnimation {\n highp vec4 cc_jointAnimInfo;\n };\n layout(set = 2, binding = 7) uniform highp sampler2D cc_jointTexture;\n void CCGetJointTextureCoords(float pixelsPerJoint, float jointIdx, out highp float x, out highp float y, out highp float invSize)\n {\n #if USE_INSTANCING\n highp float temp = pixelsPerJoint * (a_jointAnimInfo.x * a_jointAnimInfo.y + jointIdx) + a_jointAnimInfo.z;\n #else\n highp float temp = pixelsPerJoint * (cc_jointAnimInfo.x * cc_jointTextureInfo.y + jointIdx) + cc_jointTextureInfo.z;\n #endif\n invSize = cc_jointTextureInfo.w;\n highp float tempY = floor(temp * invSize);\n x = floor(temp - tempY * cc_jointTextureInfo.x);\n y = (tempY + 0.5) * invSize;\n }\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n layout(set = 2, binding = 7) uniform highp sampler2D cc_realtimeJoint;\n #else\n layout(set = 2, binding = 3) uniform CCSkinning {\n highp vec4 cc_joints[CC_JOINT_UNIFORM_CAPACITY * 3];\n };\n #endif\n #endif\n #if CC_USE_BAKED_ANIMATION\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(3.0, i, x, y, invSize);\n vec4 v1 = texture(cc_jointTexture, vec2((x + 0.5) * invSize, y));\n vec4 v2 = texture(cc_jointTexture, vec2((x + 1.5) * invSize, y));\n vec4 v3 = texture(cc_jointTexture, vec2((x + 2.5) * invSize, y));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(12.0, i, x, y, invSize);\n vec4 v1 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 0.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 1.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 2.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 3.5) * invSize, y)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 4.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 5.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 6.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 7.5) * invSize, y)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 8.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 9.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 10.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 11.5) * invSize, y)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n float x = i;\n vec4 v1 = texture(cc_realtimeJoint, vec2( x / 256.0, 0.5 / 3.0));\n vec4 v2 = texture(cc_realtimeJoint, vec2( x / 256.0, 1.5 / 3.0));\n vec4 v3 = texture(cc_realtimeJoint, vec2( x / 256.0, 2.5 / 3.0));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n float x = 4.0 * i;\n vec4 v1 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 0.5 / 3.0)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 1.5 / 3.0)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 2.5 / 3.0)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n mat4 getJointMatrix (float i) {\n int idx = int(i);\n vec4 v1 = cc_joints[idx * 3];\n vec4 v2 = cc_joints[idx * 3 + 1];\n vec4 v3 = cc_joints[idx * 3 + 2];\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #endif\n mat4 skinMatrix () {\n vec4 joints = vec4(a_joints);\n return getJointMatrix(joints.x) * a_weights.x\n + getJointMatrix(joints.y) * a_weights.y\n + getJointMatrix(joints.z) * a_weights.z\n + getJointMatrix(joints.w) * a_weights.w;\n }\n void CCSkin (inout vec4 position) {\n mat4 m = skinMatrix();\n position = m * position;\n }\n void CCSkin (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n mat4 m = skinMatrix();\n position = m * position;\n normal = (m * vec4(normal, 0.0)).xyz;\n tangent.xyz = (m * vec4(tangent.xyz, 0.0)).xyz;\n }\n#endif\nvoid CCVertInput(inout vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\nlayout(set = 1, binding = 0) uniform TexCoords {\n vec4 lineColor;\n};\nlayout(location = 0) out vec2 bary;\nlayout(location = 1) out vec4 lineCol;\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld;\n CCGetWorldMatrix(matWorld);\n bary = a_texCoord;\n lineCol = lineColor;\n return cc_matProj * (cc_matView * matWorld) * position;;\n}\nvoid main() { gl_Position = vert(); }",
  703. "frag": "\nprecision mediump float;\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nlayout(location = 0) in vec2 bary;\nlayout(location = 1) in vec4 lineCol;\nvec4 frag () {\n return CCFragOutput(lineCol);\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  704. },
  705. "glsl3": {
  706. "vert": "\nprecision mediump float;\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nin vec3 a_position;\nin vec3 a_normal;\nin vec2 a_texCoord;\nin vec4 a_tangent;\n#if CC_USE_SKINNING\n in vec4 a_joints;\n in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n in highp vec4 a_jointAnimInfo;\n #endif\n in vec4 a_matWorld0;\n in vec4 a_matWorld1;\n in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n in vec4 a_sh_linear_const_r;\n in vec4 a_sh_linear_const_g;\n in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n in float a_vertexId;\n int getVertexId() {\n return int(a_vertexId);\n }\n#endif\n#if !USE_INSTANCING\n layout(std140) uniform CCLocal {\n highp mat4 cc_matWorld;\n highp mat4 cc_matWorldIT;\n highp vec4 cc_lightingMapUVParam;\n highp vec4 cc_localShadowBias;\n highp vec4 cc_reflectionProbeData1;\n highp vec4 cc_reflectionProbeData2;\n highp vec4 cc_reflectionProbeBlendData1;\n highp vec4 cc_reflectionProbeBlendData2;\n };\n#endif\nvoid CCGetWorldMatrix(out mat4 matWorld)\n{\n #if USE_INSTANCING\n matWorld = mat4(\n vec4(a_matWorld0.xyz, 0.0),\n vec4(a_matWorld1.xyz, 0.0),\n vec4(a_matWorld2.xyz, 0.0),\n vec4(a_matWorld0.w, a_matWorld1.w, a_matWorld2.w, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n #endif\n}\nhighp float decode32 (highp vec4 rgba) {\n rgba = rgba * 255.0;\n highp float Sign = 1.0 - (step(128.0, (rgba[3]) + 0.5)) * 2.0;\n highp float Exponent = 2.0 * (mod(float(int((rgba[3]) + 0.5)), 128.0)) + (step(128.0, (rgba[2]) + 0.5)) - 127.0;\n highp float Mantissa = (mod(float(int((rgba[2]) + 0.5)), 128.0)) * 65536.0 + rgba[1] * 256.0 + rgba[0] + 8388608.0;\n return Sign * exp2(Exponent - 23.0) * Mantissa;\n}\n#if CC_USE_MORPH\n layout(std140) uniform CCMorph {\n vec4 cc_displacementWeights[15];\n vec4 cc_displacementTextureInfo;\n };\n #if CC_MORPH_TARGET_HAS_POSITION\n uniform sampler2D cc_PositionDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n uniform sampler2D cc_NormalDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n uniform sampler2D cc_TangentDisplacements;\n #endif\n vec2 getPixelLocation(vec2 textureResolution, int pixelIndex) {\n float pixelIndexF = float(pixelIndex);\n float x = mod(pixelIndexF, textureResolution.x);\n float y = floor(pixelIndexF / textureResolution.x);\n return vec2(x, y);\n }\n vec2 getPixelCoordFromLocation(vec2 location, vec2 textureResolution) {\n return (vec2(location.x, location.y) + .5) / textureResolution;\n }\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int pixelIndex) {\n ivec2 texSize = textureSize(tex, 0);\n return texelFetch(tex, ivec2(pixelIndex % texSize.x, pixelIndex / texSize.x), 0);\n }\n #else\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex * 4;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 x = getPixelCoordFromLocation(location + vec2(0.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 y = getPixelCoordFromLocation(location + vec2(1.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 z = getPixelCoordFromLocation(location + vec2(2.0, 0.0), cc_displacementTextureInfo.xy);\n return vec4(\n decode32(texture(tex, x)),\n decode32(texture(tex, y)),\n decode32(texture(tex, z)),\n 1.0\n );\n }\n #endif\n float getDisplacementWeight(int index) {\n int quot = index / 4;\n int remainder = index - quot * 4;\n if (remainder == 0) {\n return cc_displacementWeights[quot].x;\n } else if (remainder == 1) {\n return cc_displacementWeights[quot].y;\n } else if (remainder == 2) {\n return cc_displacementWeights[quot].z;\n } else {\n return cc_displacementWeights[quot].w;\n }\n }\n vec3 getVec3DisplacementFromTexture(sampler2D tex, int vertexIndex) {\n #if CC_MORPH_PRECOMPUTED\n return fetchVec3ArrayFromTexture(tex, vertexIndex).rgb;\n #else\n vec3 result = vec3(0, 0, 0);\n int nVertices = int(cc_displacementTextureInfo.z);\n for (int iTarget = 0; iTarget < CC_MORPH_TARGET_COUNT; ++iTarget) {\n result += (fetchVec3ArrayFromTexture(tex, nVertices * iTarget + vertexIndex).rgb * getDisplacementWeight(iTarget));\n }\n return result;\n #endif\n }\n #if CC_MORPH_TARGET_HAS_POSITION\n vec3 getPositionDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_PositionDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n vec3 getNormalDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_NormalDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n vec3 getTangentDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_TangentDisplacements, vertexId);\n }\n #endif\n void applyMorph (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n int vertexId = getVertexId();\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n normal.xyz = normal.xyz + getNormalDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n tangent.xyz = tangent.xyz + getTangentDisplacement(vertexId);\n #endif\n }\n void applyMorph (inout vec4 position) {\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(getVertexId());\n #endif\n }\n#endif\n#if CC_USE_SKINNING\n #if CC_USE_BAKED_ANIMATION\n layout(std140) uniform CCSkinningTexture {\n highp vec4 cc_jointTextureInfo;\n };\n layout(std140) uniform CCSkinningAnimation {\n highp vec4 cc_jointAnimInfo;\n };\n uniform highp sampler2D cc_jointTexture;\n void CCGetJointTextureCoords(float pixelsPerJoint, float jointIdx, out highp float x, out highp float y, out highp float invSize)\n {\n #if USE_INSTANCING\n highp float temp = pixelsPerJoint * (a_jointAnimInfo.x * a_jointAnimInfo.y + jointIdx) + a_jointAnimInfo.z;\n #else\n highp float temp = pixelsPerJoint * (cc_jointAnimInfo.x * cc_jointTextureInfo.y + jointIdx) + cc_jointTextureInfo.z;\n #endif\n invSize = cc_jointTextureInfo.w;\n highp float tempY = floor(temp * invSize);\n x = floor(temp - tempY * cc_jointTextureInfo.x);\n y = (tempY + 0.5) * invSize;\n }\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n uniform highp sampler2D cc_realtimeJoint;\n #else\n layout(std140) uniform CCSkinning {\n highp vec4 cc_joints[CC_JOINT_UNIFORM_CAPACITY * 3];\n };\n #endif\n #endif\n #if CC_USE_BAKED_ANIMATION\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(3.0, i, x, y, invSize);\n vec4 v1 = texture(cc_jointTexture, vec2((x + 0.5) * invSize, y));\n vec4 v2 = texture(cc_jointTexture, vec2((x + 1.5) * invSize, y));\n vec4 v3 = texture(cc_jointTexture, vec2((x + 2.5) * invSize, y));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(12.0, i, x, y, invSize);\n vec4 v1 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 0.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 1.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 2.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 3.5) * invSize, y)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 4.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 5.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 6.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 7.5) * invSize, y)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 8.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 9.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 10.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 11.5) * invSize, y)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n float x = i;\n vec4 v1 = texture(cc_realtimeJoint, vec2( x / 256.0, 0.5 / 3.0));\n vec4 v2 = texture(cc_realtimeJoint, vec2( x / 256.0, 1.5 / 3.0));\n vec4 v3 = texture(cc_realtimeJoint, vec2( x / 256.0, 2.5 / 3.0));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n float x = 4.0 * i;\n vec4 v1 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 0.5 / 3.0)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 1.5 / 3.0)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 2.5 / 3.0)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n mat4 getJointMatrix (float i) {\n int idx = int(i);\n vec4 v1 = cc_joints[idx * 3];\n vec4 v2 = cc_joints[idx * 3 + 1];\n vec4 v3 = cc_joints[idx * 3 + 2];\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #endif\n mat4 skinMatrix () {\n vec4 joints = vec4(a_joints);\n return getJointMatrix(joints.x) * a_weights.x\n + getJointMatrix(joints.y) * a_weights.y\n + getJointMatrix(joints.z) * a_weights.z\n + getJointMatrix(joints.w) * a_weights.w;\n }\n void CCSkin (inout vec4 position) {\n mat4 m = skinMatrix();\n position = m * position;\n }\n void CCSkin (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n mat4 m = skinMatrix();\n position = m * position;\n normal = (m * vec4(normal, 0.0)).xyz;\n tangent.xyz = (m * vec4(tangent.xyz, 0.0)).xyz;\n }\n#endif\nvoid CCVertInput(inout vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\nlayout(std140) uniform TexCoords {\n vec4 lineColor;\n};\nout vec2 bary;\nout vec4 lineCol;\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld;\n CCGetWorldMatrix(matWorld);\n bary = a_texCoord;\n lineCol = lineColor;\n return cc_matProj * (cc_matView * matWorld) * position;;\n}\nvoid main() { gl_Position = vert(); }",
  707. "frag": "\nprecision mediump float;\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nin vec2 bary;\nin vec4 lineCol;\nvec4 frag () {\n return CCFragOutput(lineCol);\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  708. },
  709. "glsl1": {
  710. "vert": "\nprecision mediump float;\nuniform highp mat4 cc_matView;\n uniform highp mat4 cc_matProj;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nattribute vec3 a_position;\nattribute vec3 a_normal;\nattribute vec2 a_texCoord;\nattribute vec4 a_tangent;\n#if CC_USE_SKINNING\n attribute vec4 a_joints;\n attribute vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n attribute highp vec4 a_jointAnimInfo;\n #endif\n attribute vec4 a_matWorld0;\n attribute vec4 a_matWorld1;\n attribute vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n attribute vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n attribute vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n attribute vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n attribute vec4 a_sh_linear_const_r;\n attribute vec4 a_sh_linear_const_g;\n attribute vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n attribute float a_vertexId;\n int getVertexId() {\n return int(a_vertexId);\n }\n#endif\n#if !USE_INSTANCING\n uniform highp mat4 cc_matWorld;\n#endif\nvoid CCGetWorldMatrix(out mat4 matWorld)\n{\n #if USE_INSTANCING\n matWorld = mat4(\n vec4(a_matWorld0.xyz, 0.0),\n vec4(a_matWorld1.xyz, 0.0),\n vec4(a_matWorld2.xyz, 0.0),\n vec4(a_matWorld0.w, a_matWorld1.w, a_matWorld2.w, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n #endif\n}\nhighp float decode32 (highp vec4 rgba) {\n rgba = rgba * 255.0;\n highp float Sign = 1.0 - (step(128.0, (rgba[3]) + 0.5)) * 2.0;\n highp float Exponent = 2.0 * (mod(float(int((rgba[3]) + 0.5)), 128.0)) + (step(128.0, (rgba[2]) + 0.5)) - 127.0;\n highp float Mantissa = (mod(float(int((rgba[2]) + 0.5)), 128.0)) * 65536.0 + rgba[1] * 256.0 + rgba[0] + 8388608.0;\n return Sign * exp2(Exponent - 23.0) * Mantissa;\n}\n#if CC_USE_MORPH\n uniform vec4 cc_displacementWeights[15];\n uniform vec4 cc_displacementTextureInfo;\n #if CC_MORPH_TARGET_HAS_POSITION\n uniform sampler2D cc_PositionDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n uniform sampler2D cc_NormalDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n uniform sampler2D cc_TangentDisplacements;\n #endif\n vec2 getPixelLocation(vec2 textureResolution, int pixelIndex) {\n float pixelIndexF = float(pixelIndex);\n float x = mod(pixelIndexF, textureResolution.x);\n float y = floor(pixelIndexF / textureResolution.x);\n return vec2(x, y);\n }\n vec2 getPixelCoordFromLocation(vec2 location, vec2 textureResolution) {\n return (vec2(location.x, location.y) + .5) / textureResolution;\n }\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 uv = getPixelCoordFromLocation(location, cc_displacementTextureInfo.xy);\n return texture2D(tex, uv);\n }\n #else\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex * 4;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 x = getPixelCoordFromLocation(location + vec2(0.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 y = getPixelCoordFromLocation(location + vec2(1.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 z = getPixelCoordFromLocation(location + vec2(2.0, 0.0), cc_displacementTextureInfo.xy);\n return vec4(\n decode32(texture2D(tex, x)),\n decode32(texture2D(tex, y)),\n decode32(texture2D(tex, z)),\n 1.0\n );\n }\n #endif\n float getDisplacementWeight(int index) {\n int quot = index / 4;\n int remainder = index - quot * 4;\n if (remainder == 0) {\n return cc_displacementWeights[quot].x;\n } else if (remainder == 1) {\n return cc_displacementWeights[quot].y;\n } else if (remainder == 2) {\n return cc_displacementWeights[quot].z;\n } else {\n return cc_displacementWeights[quot].w;\n }\n }\n vec3 getVec3DisplacementFromTexture(sampler2D tex, int vertexIndex) {\n #if CC_MORPH_PRECOMPUTED\n return fetchVec3ArrayFromTexture(tex, vertexIndex).rgb;\n #else\n vec3 result = vec3(0, 0, 0);\n int nVertices = int(cc_displacementTextureInfo.z);\n for (int iTarget = 0; iTarget < CC_MORPH_TARGET_COUNT; ++iTarget) {\n result += (fetchVec3ArrayFromTexture(tex, nVertices * iTarget + vertexIndex).rgb * getDisplacementWeight(iTarget));\n }\n return result;\n #endif\n }\n #if CC_MORPH_TARGET_HAS_POSITION\n vec3 getPositionDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_PositionDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n vec3 getNormalDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_NormalDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n vec3 getTangentDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_TangentDisplacements, vertexId);\n }\n #endif\n void applyMorph (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n int vertexId = getVertexId();\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n normal.xyz = normal.xyz + getNormalDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n tangent.xyz = tangent.xyz + getTangentDisplacement(vertexId);\n #endif\n }\n void applyMorph (inout vec4 position) {\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(getVertexId());\n #endif\n }\n#endif\n#if CC_USE_SKINNING\n #if CC_USE_BAKED_ANIMATION\n uniform highp vec4 cc_jointTextureInfo;\n uniform highp vec4 cc_jointAnimInfo;\n uniform highp sampler2D cc_jointTexture;\n void CCGetJointTextureCoords(float pixelsPerJoint, float jointIdx, out highp float x, out highp float y, out highp float invSize)\n {\n #if USE_INSTANCING\n highp float temp = pixelsPerJoint * (a_jointAnimInfo.x * a_jointAnimInfo.y + jointIdx) + a_jointAnimInfo.z;\n #else\n highp float temp = pixelsPerJoint * (cc_jointAnimInfo.x * cc_jointTextureInfo.y + jointIdx) + cc_jointTextureInfo.z;\n #endif\n invSize = cc_jointTextureInfo.w;\n highp float tempY = floor(temp * invSize);\n x = floor(temp - tempY * cc_jointTextureInfo.x);\n y = (tempY + 0.5) * invSize;\n }\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n uniform highp sampler2D cc_realtimeJoint;\n #else\n uniform highp vec4 cc_joints[CC_JOINT_UNIFORM_CAPACITY * 3];\n #endif\n #endif\n #if CC_USE_BAKED_ANIMATION\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(3.0, i, x, y, invSize);\n vec4 v1 = texture2D(cc_jointTexture, vec2((x + 0.5) * invSize, y));\n vec4 v2 = texture2D(cc_jointTexture, vec2((x + 1.5) * invSize, y));\n vec4 v3 = texture2D(cc_jointTexture, vec2((x + 2.5) * invSize, y));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(12.0, i, x, y, invSize);\n vec4 v1 = vec4(\n decode32(texture2D(cc_jointTexture, vec2((x + 0.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 1.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 2.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 3.5) * invSize, y)))\n );\n vec4 v2 = vec4(\n decode32(texture2D(cc_jointTexture, vec2((x + 4.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 5.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 6.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 7.5) * invSize, y)))\n );\n vec4 v3 = vec4(\n decode32(texture2D(cc_jointTexture, vec2((x + 8.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 9.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 10.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 11.5) * invSize, y)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n float x = i;\n vec4 v1 = texture2D(cc_realtimeJoint, vec2( x / 256.0, 0.5 / 3.0));\n vec4 v2 = texture2D(cc_realtimeJoint, vec2( x / 256.0, 1.5 / 3.0));\n vec4 v3 = texture2D(cc_realtimeJoint, vec2( x / 256.0, 2.5 / 3.0));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n float x = 4.0 * i;\n vec4 v1 = vec4(\n decode32(texture2D(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 0.5 / 3.0)))\n );\n vec4 v2 = vec4(\n decode32(texture2D(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 1.5 / 3.0)))\n );\n vec4 v3 = vec4(\n decode32(texture2D(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 2.5 / 3.0)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n mat4 getJointMatrix (float i) {\n int idx = int(i);\n vec4 v1 = cc_joints[idx * 3];\n vec4 v2 = cc_joints[idx * 3 + 1];\n vec4 v3 = cc_joints[idx * 3 + 2];\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #endif\n mat4 skinMatrix () {\n vec4 joints = vec4(a_joints);\n return getJointMatrix(joints.x) * a_weights.x\n + getJointMatrix(joints.y) * a_weights.y\n + getJointMatrix(joints.z) * a_weights.z\n + getJointMatrix(joints.w) * a_weights.w;\n }\n void CCSkin (inout vec4 position) {\n mat4 m = skinMatrix();\n position = m * position;\n }\n void CCSkin (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n mat4 m = skinMatrix();\n position = m * position;\n normal = (m * vec4(normal, 0.0)).xyz;\n tangent.xyz = (m * vec4(tangent.xyz, 0.0)).xyz;\n }\n#endif\nvoid CCVertInput(inout vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\n uniform vec4 lineColor;\nvarying vec2 bary;\nvarying vec4 lineCol;\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld;\n CCGetWorldMatrix(matWorld);\n bary = a_texCoord;\n lineCol = lineColor;\n return cc_matProj * (cc_matView * matWorld) * position;;\n}\nvoid main() { gl_Position = vert(); }",
  711. "frag": "\nprecision mediump float;\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nvarying vec2 bary;\nvarying vec4 lineCol;\nvec4 frag () {\n return CCFragOutput(lineCol);\n}\nvoid main() { gl_FragColor = frag(); }"
  712. },
  713. "builtins": {
  714. "globals": {
  715. "blocks": [
  716. {
  717. "name": "CCGlobal",
  718. "defines": []
  719. },
  720. {
  721. "name": "CCCamera",
  722. "defines": []
  723. }
  724. ],
  725. "samplerTextures": [],
  726. "buffers": [],
  727. "images": []
  728. },
  729. "locals": {
  730. "blocks": [
  731. {
  732. "name": "CCLocal",
  733. "defines": [
  734. "!USE_INSTANCING"
  735. ]
  736. },
  737. {
  738. "name": "CCMorph",
  739. "defines": [
  740. "CC_USE_MORPH"
  741. ]
  742. },
  743. {
  744. "name": "CCSkinningTexture",
  745. "defines": [
  746. "CC_USE_SKINNING",
  747. "CC_USE_BAKED_ANIMATION"
  748. ]
  749. },
  750. {
  751. "name": "CCSkinningAnimation",
  752. "defines": [
  753. "CC_USE_SKINNING",
  754. "CC_USE_BAKED_ANIMATION"
  755. ]
  756. },
  757. {
  758. "name": "CCSkinning",
  759. "defines": [
  760. "CC_USE_SKINNING",
  761. "!CC_USE_BAKED_ANIMATION",
  762. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  763. ]
  764. }
  765. ],
  766. "samplerTextures": [
  767. {
  768. "name": "cc_PositionDisplacements",
  769. "defines": [
  770. "CC_USE_MORPH",
  771. "CC_MORPH_TARGET_HAS_POSITION"
  772. ]
  773. },
  774. {
  775. "name": "cc_NormalDisplacements",
  776. "defines": [
  777. "CC_USE_MORPH",
  778. "CC_MORPH_TARGET_HAS_NORMAL"
  779. ]
  780. },
  781. {
  782. "name": "cc_TangentDisplacements",
  783. "defines": [
  784. "CC_USE_MORPH",
  785. "CC_MORPH_TARGET_HAS_TANGENT"
  786. ]
  787. },
  788. {
  789. "name": "cc_jointTexture",
  790. "defines": [
  791. "CC_USE_SKINNING",
  792. "CC_USE_BAKED_ANIMATION"
  793. ]
  794. },
  795. {
  796. "name": "cc_realtimeJoint",
  797. "defines": [
  798. "CC_USE_SKINNING",
  799. "!CC_USE_BAKED_ANIMATION",
  800. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  801. ]
  802. }
  803. ],
  804. "buffers": [],
  805. "images": []
  806. },
  807. "statistics": {
  808. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 75,
  809. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 42
  810. }
  811. },
  812. "defines": [
  813. {
  814. "name": "USE_INSTANCING",
  815. "type": "boolean",
  816. "defines": [],
  817. "editor": {
  818. "elevated": true
  819. }
  820. },
  821. {
  822. "name": "CC_USE_SKINNING",
  823. "type": "boolean",
  824. "defines": []
  825. },
  826. {
  827. "name": "CC_USE_BAKED_ANIMATION",
  828. "type": "boolean",
  829. "defines": [
  830. "USE_INSTANCING"
  831. ]
  832. },
  833. {
  834. "name": "CC_USE_LIGHTMAP",
  835. "type": "boolean",
  836. "defines": [
  837. "USE_INSTANCING"
  838. ]
  839. },
  840. {
  841. "name": "CC_USE_REFLECTION_PROBE",
  842. "type": "boolean",
  843. "defines": [
  844. "USE_INSTANCING"
  845. ]
  846. },
  847. {
  848. "name": "CC_RECEIVE_SHADOW",
  849. "type": "boolean",
  850. "defines": [
  851. "USE_INSTANCING"
  852. ]
  853. },
  854. {
  855. "name": "CC_USE_LIGHT_PROBE",
  856. "type": "boolean",
  857. "defines": [
  858. "USE_INSTANCING"
  859. ]
  860. },
  861. {
  862. "name": "CC_USE_MORPH",
  863. "type": "boolean",
  864. "defines": []
  865. },
  866. {
  867. "name": "CC_MORPH_TARGET_COUNT",
  868. "type": "number",
  869. "defines": [
  870. "CC_USE_MORPH"
  871. ],
  872. "range": [
  873. 2,
  874. 8
  875. ]
  876. },
  877. {
  878. "name": "CC_MORPH_TARGET_HAS_POSITION",
  879. "type": "boolean",
  880. "defines": [
  881. "CC_USE_MORPH"
  882. ]
  883. },
  884. {
  885. "name": "CC_MORPH_TARGET_HAS_NORMAL",
  886. "type": "boolean",
  887. "defines": [
  888. "CC_USE_MORPH"
  889. ]
  890. },
  891. {
  892. "name": "CC_MORPH_TARGET_HAS_TANGENT",
  893. "type": "boolean",
  894. "defines": [
  895. "CC_USE_MORPH"
  896. ]
  897. },
  898. {
  899. "name": "CC_MORPH_PRECOMPUTED",
  900. "type": "boolean",
  901. "defines": [
  902. "CC_USE_MORPH"
  903. ]
  904. },
  905. {
  906. "name": "CC_USE_REAL_TIME_JOINT_TEXTURE",
  907. "type": "boolean",
  908. "defines": [
  909. "CC_USE_SKINNING",
  910. "!CC_USE_BAKED_ANIMATION"
  911. ]
  912. }
  913. ],
  914. "name": "internal/builtin-wireframe|wireframe-vs:vert|wireframe-fs:frag"
  915. }
  916. ],
  917. "combinations": [],
  918. "hideInEditor": false
  919. }