fe0128c2-5496-4330-880a-cfee413aabf2.json 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "builtin-reflection-probe-preview",
  4. "_objFlags": 0,
  5. "__editorExtras__": {},
  6. "_native": "",
  7. "techniques": [
  8. {
  9. "name": "opaque",
  10. "passes": [
  11. {
  12. "properties": null,
  13. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  14. "migrations": {
  15. "properties": {
  16. "mainColor": {
  17. "formerlySerializedAs": "color"
  18. }
  19. }
  20. }
  21. },
  22. {
  23. "phase": "deferred-forward",
  24. "propertyIndex": 0,
  25. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  26. "migrations": {
  27. "properties": {
  28. "mainColor": {
  29. "formerlySerializedAs": "color"
  30. }
  31. }
  32. }
  33. }
  34. ]
  35. },
  36. {
  37. "name": "transparent",
  38. "passes": [
  39. {
  40. "blendState": {
  41. "targets": [
  42. {
  43. "blend": true,
  44. "blendSrc": 2,
  45. "blendDst": 4,
  46. "blendDstAlpha": 4
  47. }
  48. ]
  49. },
  50. "properties": null,
  51. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  52. "depthStencilState": {
  53. "depthTest": true,
  54. "depthWrite": false
  55. },
  56. "migrations": {
  57. "properties": {
  58. "mainColor": {
  59. "formerlySerializedAs": "color"
  60. }
  61. }
  62. }
  63. },
  64. {
  65. "phase": "deferred-forward",
  66. "blendState": {
  67. "targets": [
  68. {
  69. "blend": true,
  70. "blendSrc": 2,
  71. "blendDst": 4,
  72. "blendDstAlpha": 4
  73. }
  74. ]
  75. },
  76. "propertyIndex": 0,
  77. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  78. "depthStencilState": {
  79. "depthTest": true,
  80. "depthWrite": false
  81. },
  82. "migrations": {
  83. "properties": {
  84. "mainColor": {
  85. "formerlySerializedAs": "color"
  86. }
  87. }
  88. }
  89. }
  90. ]
  91. },
  92. {
  93. "name": "add",
  94. "passes": [
  95. {
  96. "rasterizerState": {
  97. "cullMode": 0
  98. },
  99. "blendState": {
  100. "targets": [
  101. {
  102. "blend": true,
  103. "blendSrc": 2,
  104. "blendDst": 1,
  105. "blendSrcAlpha": 2,
  106. "blendDstAlpha": 1
  107. }
  108. ]
  109. },
  110. "properties": null,
  111. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  112. "depthStencilState": {
  113. "depthTest": true,
  114. "depthWrite": false
  115. },
  116. "migrations": {
  117. "properties": {
  118. "mainColor": {
  119. "formerlySerializedAs": "color"
  120. }
  121. }
  122. }
  123. },
  124. {
  125. "phase": "deferred-forward",
  126. "blendState": {
  127. "targets": [
  128. {
  129. "blend": true,
  130. "blendSrc": 2,
  131. "blendDst": 1,
  132. "blendSrcAlpha": 2,
  133. "blendDstAlpha": 1
  134. }
  135. ]
  136. },
  137. "propertyIndex": 0,
  138. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  139. "depthStencilState": {
  140. "depthTest": true,
  141. "depthWrite": false
  142. },
  143. "migrations": {
  144. "properties": {
  145. "mainColor": {
  146. "formerlySerializedAs": "color"
  147. }
  148. }
  149. }
  150. }
  151. ]
  152. },
  153. {
  154. "name": "alpha-blend",
  155. "passes": [
  156. {
  157. "rasterizerState": {
  158. "cullMode": 0
  159. },
  160. "blendState": {
  161. "targets": [
  162. {
  163. "blend": true,
  164. "blendSrc": 2,
  165. "blendDst": 4,
  166. "blendSrcAlpha": 2,
  167. "blendDstAlpha": 4
  168. }
  169. ]
  170. },
  171. "properties": null,
  172. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  173. "depthStencilState": {
  174. "depthTest": true,
  175. "depthWrite": false
  176. },
  177. "migrations": {
  178. "properties": {
  179. "mainColor": {
  180. "formerlySerializedAs": "color"
  181. }
  182. }
  183. }
  184. },
  185. {
  186. "phase": "deferred-forward",
  187. "blendState": {
  188. "targets": [
  189. {
  190. "blend": true,
  191. "blendSrc": 2,
  192. "blendDst": 4,
  193. "blendSrcAlpha": 2,
  194. "blendDstAlpha": 4
  195. }
  196. ]
  197. },
  198. "propertyIndex": 0,
  199. "program": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag",
  200. "depthStencilState": {
  201. "depthTest": true,
  202. "depthWrite": false
  203. },
  204. "migrations": {
  205. "properties": {
  206. "mainColor": {
  207. "formerlySerializedAs": "color"
  208. }
  209. }
  210. }
  211. }
  212. ]
  213. }
  214. ],
  215. "shaders": [
  216. {
  217. "blocks": [],
  218. "samplerTextures": [],
  219. "samplers": [],
  220. "textures": [],
  221. "buffers": [],
  222. "images": [],
  223. "subpassInputs": [],
  224. "attributes": [
  225. {
  226. "name": "a_position",
  227. "defines": [],
  228. "format": 32,
  229. "location": 0
  230. },
  231. {
  232. "name": "a_normal",
  233. "defines": [],
  234. "format": 32,
  235. "location": 1
  236. },
  237. {
  238. "name": "a_texCoord",
  239. "defines": [],
  240. "format": 21,
  241. "location": 2
  242. },
  243. {
  244. "name": "a_tangent",
  245. "defines": [],
  246. "format": 44,
  247. "location": 3
  248. },
  249. {
  250. "name": "a_joints",
  251. "defines": [
  252. "CC_USE_SKINNING"
  253. ],
  254. "location": 4
  255. },
  256. {
  257. "name": "a_weights",
  258. "defines": [
  259. "CC_USE_SKINNING"
  260. ],
  261. "format": 44,
  262. "location": 5
  263. },
  264. {
  265. "name": "a_jointAnimInfo",
  266. "defines": [
  267. "USE_INSTANCING",
  268. "CC_USE_BAKED_ANIMATION"
  269. ],
  270. "format": 44,
  271. "isInstanced": true,
  272. "location": 6
  273. },
  274. {
  275. "name": "a_matWorld0",
  276. "defines": [
  277. "USE_INSTANCING"
  278. ],
  279. "format": 44,
  280. "isInstanced": true,
  281. "location": 7
  282. },
  283. {
  284. "name": "a_matWorld1",
  285. "defines": [
  286. "USE_INSTANCING"
  287. ],
  288. "format": 44,
  289. "isInstanced": true,
  290. "location": 8
  291. },
  292. {
  293. "name": "a_matWorld2",
  294. "defines": [
  295. "USE_INSTANCING"
  296. ],
  297. "format": 44,
  298. "isInstanced": true,
  299. "location": 9
  300. },
  301. {
  302. "name": "a_lightingMapUVParam",
  303. "defines": [
  304. "USE_INSTANCING",
  305. "CC_USE_LIGHTMAP"
  306. ],
  307. "format": 44,
  308. "isInstanced": true,
  309. "location": 10
  310. },
  311. {
  312. "name": "a_localShadowBiasAndProbeId",
  313. "defines": [
  314. "USE_INSTANCING"
  315. ],
  316. "format": 44,
  317. "isInstanced": true,
  318. "location": 11
  319. },
  320. {
  321. "name": "a_reflectionProbeData",
  322. "defines": [
  323. "USE_INSTANCING",
  324. "CC_USE_REFLECTION_PROBE"
  325. ],
  326. "format": 44,
  327. "isInstanced": true,
  328. "location": 12
  329. },
  330. {
  331. "name": "a_sh_linear_const_r",
  332. "defines": [
  333. "USE_INSTANCING",
  334. "CC_USE_LIGHT_PROBE"
  335. ],
  336. "format": 44,
  337. "isInstanced": true,
  338. "location": 13
  339. },
  340. {
  341. "name": "a_sh_linear_const_g",
  342. "defines": [
  343. "USE_INSTANCING",
  344. "CC_USE_LIGHT_PROBE"
  345. ],
  346. "format": 44,
  347. "isInstanced": true,
  348. "location": 14
  349. },
  350. {
  351. "name": "a_sh_linear_const_b",
  352. "defines": [
  353. "USE_INSTANCING",
  354. "CC_USE_LIGHT_PROBE"
  355. ],
  356. "format": 44,
  357. "isInstanced": true,
  358. "location": 15
  359. },
  360. {
  361. "name": "a_vertexId",
  362. "defines": [
  363. "CC_USE_MORPH"
  364. ],
  365. "format": 11,
  366. "location": 16
  367. }
  368. ],
  369. "varyings": [
  370. {
  371. "name": "v_shadowBiasAndProbeId",
  372. "type": 16,
  373. "count": 1,
  374. "defines": [
  375. "CC_USE_REFLECTION_PROBE"
  376. ],
  377. "stageFlags": 17,
  378. "location": 0
  379. },
  380. {
  381. "name": "v_position",
  382. "type": 15,
  383. "count": 1,
  384. "defines": [],
  385. "stageFlags": 17,
  386. "location": 1
  387. },
  388. {
  389. "name": "v_normal",
  390. "type": 15,
  391. "count": 1,
  392. "defines": [],
  393. "stageFlags": 17,
  394. "location": 2
  395. }
  396. ],
  397. "fragColors": [
  398. {
  399. "name": "cc_FragColor",
  400. "typename": "vec4",
  401. "type": 16,
  402. "count": 1,
  403. "defines": [],
  404. "stageFlags": 16,
  405. "location": 0
  406. }
  407. ],
  408. "descriptors": [
  409. {
  410. "rate": 0,
  411. "blocks": [
  412. {
  413. "tags": {
  414. "builtin": "local"
  415. },
  416. "name": "CCMorph",
  417. "members": [
  418. {
  419. "name": "cc_displacementWeights",
  420. "typename": "vec4",
  421. "type": 16,
  422. "count": 15,
  423. "isArray": true
  424. },
  425. {
  426. "name": "cc_displacementTextureInfo",
  427. "typename": "vec4",
  428. "type": 16,
  429. "count": 1
  430. }
  431. ],
  432. "defines": [
  433. "CC_USE_MORPH"
  434. ],
  435. "stageFlags": 1
  436. },
  437. {
  438. "tags": {
  439. "builtin": "local"
  440. },
  441. "name": "CCSkinningTexture",
  442. "members": [
  443. {
  444. "name": "cc_jointTextureInfo",
  445. "typename": "vec4",
  446. "type": 16,
  447. "count": 1,
  448. "precision": "highp "
  449. }
  450. ],
  451. "defines": [
  452. "CC_USE_SKINNING",
  453. "CC_USE_BAKED_ANIMATION"
  454. ],
  455. "stageFlags": 1
  456. },
  457. {
  458. "tags": {
  459. "builtin": "local"
  460. },
  461. "name": "CCSkinningAnimation",
  462. "members": [
  463. {
  464. "name": "cc_jointAnimInfo",
  465. "typename": "vec4",
  466. "type": 16,
  467. "count": 1,
  468. "precision": "highp "
  469. }
  470. ],
  471. "defines": [
  472. "CC_USE_SKINNING",
  473. "CC_USE_BAKED_ANIMATION"
  474. ],
  475. "stageFlags": 1
  476. },
  477. {
  478. "tags": {
  479. "builtin": "local"
  480. },
  481. "name": "CCSkinning",
  482. "members": [
  483. {
  484. "name": "cc_joints",
  485. "typename": "vec4",
  486. "type": 16,
  487. "count": 0,
  488. "precision": "highp ",
  489. "isArray": true
  490. }
  491. ],
  492. "defines": [
  493. "CC_USE_SKINNING",
  494. "!CC_USE_BAKED_ANIMATION",
  495. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  496. ],
  497. "stageFlags": 1
  498. },
  499. {
  500. "tags": {
  501. "builtin": "local"
  502. },
  503. "name": "CCLocal",
  504. "members": [
  505. {
  506. "name": "cc_matWorld",
  507. "typename": "mat4",
  508. "type": 25,
  509. "count": 1,
  510. "precision": "highp "
  511. },
  512. {
  513. "name": "cc_matWorldIT",
  514. "typename": "mat4",
  515. "type": 25,
  516. "count": 1,
  517. "precision": "highp "
  518. },
  519. {
  520. "name": "cc_lightingMapUVParam",
  521. "typename": "vec4",
  522. "type": 16,
  523. "count": 1,
  524. "precision": "highp "
  525. },
  526. {
  527. "name": "cc_localShadowBias",
  528. "typename": "vec4",
  529. "type": 16,
  530. "count": 1,
  531. "precision": "highp "
  532. },
  533. {
  534. "name": "cc_reflectionProbeData1",
  535. "typename": "vec4",
  536. "type": 16,
  537. "count": 1,
  538. "precision": "highp "
  539. },
  540. {
  541. "name": "cc_reflectionProbeData2",
  542. "typename": "vec4",
  543. "type": 16,
  544. "count": 1,
  545. "precision": "highp "
  546. },
  547. {
  548. "name": "cc_reflectionProbeBlendData1",
  549. "typename": "vec4",
  550. "type": 16,
  551. "count": 1,
  552. "precision": "highp "
  553. },
  554. {
  555. "name": "cc_reflectionProbeBlendData2",
  556. "typename": "vec4",
  557. "type": 16,
  558. "count": 1,
  559. "precision": "highp "
  560. }
  561. ],
  562. "defines": [
  563. "!USE_INSTANCING"
  564. ],
  565. "stageFlags": 1
  566. }
  567. ],
  568. "samplerTextures": [
  569. {
  570. "tags": {
  571. "builtin": "local"
  572. },
  573. "name": "cc_PositionDisplacements",
  574. "typename": "sampler2D",
  575. "type": 28,
  576. "count": 1,
  577. "defines": [
  578. "CC_USE_MORPH",
  579. "CC_MORPH_TARGET_HAS_POSITION"
  580. ],
  581. "stageFlags": 1
  582. },
  583. {
  584. "tags": {
  585. "builtin": "local"
  586. },
  587. "name": "cc_NormalDisplacements",
  588. "typename": "sampler2D",
  589. "type": 28,
  590. "count": 1,
  591. "defines": [
  592. "CC_USE_MORPH",
  593. "CC_MORPH_TARGET_HAS_NORMAL"
  594. ],
  595. "stageFlags": 1
  596. },
  597. {
  598. "tags": {
  599. "builtin": "local"
  600. },
  601. "name": "cc_TangentDisplacements",
  602. "typename": "sampler2D",
  603. "type": 28,
  604. "count": 1,
  605. "defines": [
  606. "CC_USE_MORPH",
  607. "CC_MORPH_TARGET_HAS_TANGENT"
  608. ],
  609. "stageFlags": 1
  610. },
  611. {
  612. "tags": {
  613. "builtin": "local"
  614. },
  615. "name": "cc_jointTexture",
  616. "typename": "sampler2D",
  617. "type": 28,
  618. "count": 1,
  619. "precision": "highp ",
  620. "defines": [
  621. "CC_USE_SKINNING",
  622. "CC_USE_BAKED_ANIMATION"
  623. ],
  624. "stageFlags": 1
  625. },
  626. {
  627. "tags": {
  628. "builtin": "local"
  629. },
  630. "name": "cc_realtimeJoint",
  631. "typename": "sampler2D",
  632. "type": 28,
  633. "count": 1,
  634. "precision": "highp ",
  635. "defines": [
  636. "CC_USE_SKINNING",
  637. "!CC_USE_BAKED_ANIMATION",
  638. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  639. ],
  640. "stageFlags": 1
  641. },
  642. {
  643. "tags": {
  644. "builtin": "local"
  645. },
  646. "name": "cc_reflectionProbeCubemap",
  647. "typename": "samplerCube",
  648. "type": 31,
  649. "count": 1,
  650. "defines": [],
  651. "stageFlags": 16
  652. },
  653. {
  654. "tags": {
  655. "builtin": "local"
  656. },
  657. "name": "cc_reflectionProbePlanarMap",
  658. "typename": "sampler2D",
  659. "type": 28,
  660. "count": 1,
  661. "defines": [],
  662. "stageFlags": 16
  663. },
  664. {
  665. "tags": {
  666. "builtin": "local"
  667. },
  668. "name": "cc_reflectionProbeDataMap",
  669. "typename": "sampler2D",
  670. "type": 28,
  671. "count": 1,
  672. "defines": [],
  673. "stageFlags": 16
  674. },
  675. {
  676. "tags": {
  677. "builtin": "local"
  678. },
  679. "name": "cc_reflectionProbeBlendCubemap",
  680. "typename": "samplerCube",
  681. "type": 31,
  682. "count": 1,
  683. "defines": [],
  684. "stageFlags": 16
  685. }
  686. ],
  687. "samplers": [],
  688. "textures": [],
  689. "buffers": [],
  690. "images": [],
  691. "subpassInputs": []
  692. },
  693. {
  694. "rate": 1,
  695. "blocks": [],
  696. "samplerTextures": [],
  697. "samplers": [],
  698. "textures": [],
  699. "buffers": [],
  700. "images": [],
  701. "subpassInputs": []
  702. },
  703. {
  704. "rate": 2,
  705. "blocks": [],
  706. "samplerTextures": [],
  707. "samplers": [],
  708. "textures": [],
  709. "buffers": [],
  710. "images": [],
  711. "subpassInputs": []
  712. },
  713. {
  714. "rate": 3,
  715. "blocks": [
  716. {
  717. "tags": {
  718. "builtin": "global"
  719. },
  720. "name": "CCGlobal",
  721. "members": [
  722. {
  723. "name": "cc_time",
  724. "typename": "vec4",
  725. "type": 16,
  726. "count": 1,
  727. "precision": "highp "
  728. },
  729. {
  730. "name": "cc_screenSize",
  731. "typename": "vec4",
  732. "type": 16,
  733. "count": 1,
  734. "precision": "mediump "
  735. },
  736. {
  737. "name": "cc_nativeSize",
  738. "typename": "vec4",
  739. "type": 16,
  740. "count": 1,
  741. "precision": "mediump "
  742. },
  743. {
  744. "name": "cc_probeInfo",
  745. "typename": "vec4",
  746. "type": 16,
  747. "count": 1,
  748. "precision": "mediump "
  749. },
  750. {
  751. "name": "cc_debug_view_mode",
  752. "typename": "vec4",
  753. "type": 16,
  754. "count": 1,
  755. "precision": "mediump "
  756. }
  757. ],
  758. "defines": [],
  759. "stageFlags": 17
  760. },
  761. {
  762. "tags": {
  763. "builtin": "global"
  764. },
  765. "name": "CCCamera",
  766. "members": [
  767. {
  768. "name": "cc_matView",
  769. "typename": "mat4",
  770. "type": 25,
  771. "count": 1,
  772. "precision": "highp "
  773. },
  774. {
  775. "name": "cc_matViewInv",
  776. "typename": "mat4",
  777. "type": 25,
  778. "count": 1,
  779. "precision": "highp "
  780. },
  781. {
  782. "name": "cc_matProj",
  783. "typename": "mat4",
  784. "type": 25,
  785. "count": 1,
  786. "precision": "highp "
  787. },
  788. {
  789. "name": "cc_matProjInv",
  790. "typename": "mat4",
  791. "type": 25,
  792. "count": 1,
  793. "precision": "highp "
  794. },
  795. {
  796. "name": "cc_matViewProj",
  797. "typename": "mat4",
  798. "type": 25,
  799. "count": 1,
  800. "precision": "highp "
  801. },
  802. {
  803. "name": "cc_matViewProjInv",
  804. "typename": "mat4",
  805. "type": 25,
  806. "count": 1,
  807. "precision": "highp "
  808. },
  809. {
  810. "name": "cc_cameraPos",
  811. "typename": "vec4",
  812. "type": 16,
  813. "count": 1,
  814. "precision": "highp "
  815. },
  816. {
  817. "name": "cc_surfaceTransform",
  818. "typename": "vec4",
  819. "type": 16,
  820. "count": 1,
  821. "precision": "mediump "
  822. },
  823. {
  824. "name": "cc_screenScale",
  825. "typename": "vec4",
  826. "type": 16,
  827. "count": 1,
  828. "precision": "mediump "
  829. },
  830. {
  831. "name": "cc_exposure",
  832. "typename": "vec4",
  833. "type": 16,
  834. "count": 1,
  835. "precision": "mediump "
  836. },
  837. {
  838. "name": "cc_mainLitDir",
  839. "typename": "vec4",
  840. "type": 16,
  841. "count": 1,
  842. "precision": "mediump "
  843. },
  844. {
  845. "name": "cc_mainLitColor",
  846. "typename": "vec4",
  847. "type": 16,
  848. "count": 1,
  849. "precision": "mediump "
  850. },
  851. {
  852. "name": "cc_ambientSky",
  853. "typename": "vec4",
  854. "type": 16,
  855. "count": 1,
  856. "precision": "mediump "
  857. },
  858. {
  859. "name": "cc_ambientGround",
  860. "typename": "vec4",
  861. "type": 16,
  862. "count": 1,
  863. "precision": "mediump "
  864. },
  865. {
  866. "name": "cc_fogColor",
  867. "typename": "vec4",
  868. "type": 16,
  869. "count": 1,
  870. "precision": "mediump "
  871. },
  872. {
  873. "name": "cc_fogBase",
  874. "typename": "vec4",
  875. "type": 16,
  876. "count": 1,
  877. "precision": "mediump "
  878. },
  879. {
  880. "name": "cc_fogAdd",
  881. "typename": "vec4",
  882. "type": 16,
  883. "count": 1,
  884. "precision": "mediump "
  885. },
  886. {
  887. "name": "cc_nearFar",
  888. "typename": "vec4",
  889. "type": 16,
  890. "count": 1,
  891. "precision": "mediump "
  892. },
  893. {
  894. "name": "cc_viewPort",
  895. "typename": "vec4",
  896. "type": 16,
  897. "count": 1,
  898. "precision": "mediump "
  899. }
  900. ],
  901. "defines": [],
  902. "stageFlags": 17
  903. }
  904. ],
  905. "samplerTextures": [
  906. {
  907. "tags": {
  908. "builtin": "global"
  909. },
  910. "name": "cc_environment",
  911. "typename": "samplerCube",
  912. "type": 31,
  913. "count": 1,
  914. "defines": [],
  915. "stageFlags": 16
  916. }
  917. ],
  918. "samplers": [],
  919. "textures": [],
  920. "buffers": [],
  921. "images": [],
  922. "subpassInputs": []
  923. }
  924. ],
  925. "hash": 3480756966,
  926. "glsl4": {
  927. "vert": "#extension GL_EXT_shader_explicit_arithmetic_types_int32: require\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nlayout(location = 0) in vec3 a_position;\nlayout(location = 1) in vec3 a_normal;\nlayout(location = 2) in vec2 a_texCoord;\nlayout(location = 3) in vec4 a_tangent;\n#if CC_USE_SKINNING\n layout(location = 4) in u32vec4 a_joints;\n layout(location = 5) in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n layout(location = 6) in highp vec4 a_jointAnimInfo;\n #endif\n layout(location = 7) in vec4 a_matWorld0;\n layout(location = 8) in vec4 a_matWorld1;\n layout(location = 9) in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n layout(location = 10) in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n layout(location = 11) in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n layout(location = 12) in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n layout(location = 13) in vec4 a_sh_linear_const_r;\n layout(location = 14) in vec4 a_sh_linear_const_g;\n layout(location = 15) in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n int getVertexId() {\n return gl_VertexIndex;\n }\n#endif\nhighp float decode32 (highp vec4 rgba) {\n rgba = rgba * 255.0;\n highp float Sign = 1.0 - (step(128.0, (rgba[3]) + 0.5)) * 2.0;\n highp float Exponent = 2.0 * (mod(float(int((rgba[3]) + 0.5)), 128.0)) + (step(128.0, (rgba[2]) + 0.5)) - 127.0;\n highp float Mantissa = (mod(float(int((rgba[2]) + 0.5)), 128.0)) * 65536.0 + rgba[1] * 256.0 + rgba[0] + 8388608.0;\n return Sign * exp2(Exponent - 23.0) * Mantissa;\n}\n#if CC_USE_MORPH\n layout(set = 2, binding = 4) uniform CCMorph {\n vec4 cc_displacementWeights[15];\n vec4 cc_displacementTextureInfo;\n };\n #if CC_MORPH_TARGET_HAS_POSITION\n layout(set = 2, binding = 8) uniform sampler2D cc_PositionDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n layout(set = 2, binding = 9) uniform sampler2D cc_NormalDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n layout(set = 2, binding = 10) uniform sampler2D cc_TangentDisplacements;\n #endif\n vec2 getPixelLocation(vec2 textureResolution, int pixelIndex) {\n float pixelIndexF = float(pixelIndex);\n float x = mod(pixelIndexF, textureResolution.x);\n float y = floor(pixelIndexF / textureResolution.x);\n return vec2(x, y);\n }\n vec2 getPixelCoordFromLocation(vec2 location, vec2 textureResolution) {\n return (vec2(location.x, location.y) + .5) / textureResolution;\n }\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int pixelIndex) {\n ivec2 texSize = textureSize(tex, 0);\n return texelFetch(tex, ivec2(pixelIndex % texSize.x, pixelIndex / texSize.x), 0);\n }\n #else\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex * 4;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 x = getPixelCoordFromLocation(location + vec2(0.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 y = getPixelCoordFromLocation(location + vec2(1.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 z = getPixelCoordFromLocation(location + vec2(2.0, 0.0), cc_displacementTextureInfo.xy);\n return vec4(\n decode32(texture(tex, x)),\n decode32(texture(tex, y)),\n decode32(texture(tex, z)),\n 1.0\n );\n }\n #endif\n float getDisplacementWeight(int index) {\n int quot = index / 4;\n int remainder = index - quot * 4;\n if (remainder == 0) {\n return cc_displacementWeights[quot].x;\n } else if (remainder == 1) {\n return cc_displacementWeights[quot].y;\n } else if (remainder == 2) {\n return cc_displacementWeights[quot].z;\n } else {\n return cc_displacementWeights[quot].w;\n }\n }\n vec3 getVec3DisplacementFromTexture(sampler2D tex, int vertexIndex) {\n #if CC_MORPH_PRECOMPUTED\n return fetchVec3ArrayFromTexture(tex, vertexIndex).rgb;\n #else\n vec3 result = vec3(0, 0, 0);\n int nVertices = int(cc_displacementTextureInfo.z);\n for (int iTarget = 0; iTarget < CC_MORPH_TARGET_COUNT; ++iTarget) {\n result += (fetchVec3ArrayFromTexture(tex, nVertices * iTarget + vertexIndex).rgb * getDisplacementWeight(iTarget));\n }\n return result;\n #endif\n }\n #if CC_MORPH_TARGET_HAS_POSITION\n vec3 getPositionDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_PositionDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n vec3 getNormalDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_NormalDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n vec3 getTangentDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_TangentDisplacements, vertexId);\n }\n #endif\n void applyMorph (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n int vertexId = getVertexId();\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n normal.xyz = normal.xyz + getNormalDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n tangent.xyz = tangent.xyz + getTangentDisplacement(vertexId);\n #endif\n }\n void applyMorph (inout vec4 position) {\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(getVertexId());\n #endif\n }\n#endif\n#if CC_USE_SKINNING\n #if CC_USE_BAKED_ANIMATION\n layout(set = 2, binding = 3) uniform CCSkinningTexture {\n highp vec4 cc_jointTextureInfo;\n };\n layout(set = 2, binding = 2) uniform CCSkinningAnimation {\n highp vec4 cc_jointAnimInfo;\n };\n layout(set = 2, binding = 7) uniform highp sampler2D cc_jointTexture;\n void CCGetJointTextureCoords(float pixelsPerJoint, float jointIdx, out highp float x, out highp float y, out highp float invSize)\n {\n #if USE_INSTANCING\n highp float temp = pixelsPerJoint * (a_jointAnimInfo.x * a_jointAnimInfo.y + jointIdx) + a_jointAnimInfo.z;\n #else\n highp float temp = pixelsPerJoint * (cc_jointAnimInfo.x * cc_jointTextureInfo.y + jointIdx) + cc_jointTextureInfo.z;\n #endif\n invSize = cc_jointTextureInfo.w;\n highp float tempY = floor(temp * invSize);\n x = floor(temp - tempY * cc_jointTextureInfo.x);\n y = (tempY + 0.5) * invSize;\n }\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n layout(set = 2, binding = 7) uniform highp sampler2D cc_realtimeJoint;\n #else\n layout(set = 2, binding = 3) uniform CCSkinning {\n highp vec4 cc_joints[CC_JOINT_UNIFORM_CAPACITY * 3];\n };\n #endif\n #endif\n #if CC_USE_BAKED_ANIMATION\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(3.0, i, x, y, invSize);\n vec4 v1 = texture(cc_jointTexture, vec2((x + 0.5) * invSize, y));\n vec4 v2 = texture(cc_jointTexture, vec2((x + 1.5) * invSize, y));\n vec4 v3 = texture(cc_jointTexture, vec2((x + 2.5) * invSize, y));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(12.0, i, x, y, invSize);\n vec4 v1 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 0.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 1.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 2.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 3.5) * invSize, y)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 4.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 5.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 6.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 7.5) * invSize, y)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 8.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 9.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 10.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 11.5) * invSize, y)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n float x = i;\n vec4 v1 = texture(cc_realtimeJoint, vec2( x / 256.0, 0.5 / 3.0));\n vec4 v2 = texture(cc_realtimeJoint, vec2( x / 256.0, 1.5 / 3.0));\n vec4 v3 = texture(cc_realtimeJoint, vec2( x / 256.0, 2.5 / 3.0));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n float x = 4.0 * i;\n vec4 v1 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 0.5 / 3.0)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 1.5 / 3.0)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 2.5 / 3.0)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n mat4 getJointMatrix (float i) {\n int idx = int(i);\n vec4 v1 = cc_joints[idx * 3];\n vec4 v2 = cc_joints[idx * 3 + 1];\n vec4 v3 = cc_joints[idx * 3 + 2];\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #endif\n mat4 skinMatrix () {\n vec4 joints = vec4(a_joints);\n return getJointMatrix(joints.x) * a_weights.x\n + getJointMatrix(joints.y) * a_weights.y\n + getJointMatrix(joints.z) * a_weights.z\n + getJointMatrix(joints.w) * a_weights.w;\n }\n void CCSkin (inout vec4 position) {\n mat4 m = skinMatrix();\n position = m * position;\n }\n void CCSkin (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n mat4 m = skinMatrix();\n position = m * position;\n normal = (m * vec4(normal, 0.0)).xyz;\n tangent.xyz = (m * vec4(tangent.xyz, 0.0)).xyz;\n }\n#endif\nvoid CCVertInput(inout vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#if !USE_INSTANCING\n layout(set = 2, binding = 0) uniform CCLocal {\n highp mat4 cc_matWorld;\n highp mat4 cc_matWorldIT;\n highp vec4 cc_lightingMapUVParam;\n highp vec4 cc_localShadowBias;\n highp vec4 cc_reflectionProbeData1;\n highp vec4 cc_reflectionProbeData2;\n highp vec4 cc_reflectionProbeBlendData1;\n highp vec4 cc_reflectionProbeBlendData2;\n };\n#endif\nvoid CCGetWorldMatrixFull(out mat4 matWorld, out mat4 matWorldIT)\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 vec3 scale = 1.0 / vec3(length(a_matWorld0.xyz), length(a_matWorld1.xyz), length(a_matWorld2.xyz));\n vec3 scale2 = scale * scale;\n matWorldIT = mat4(\n vec4(a_matWorld0.xyz * scale2.x, 0.0),\n vec4(a_matWorld1.xyz * scale2.y, 0.0),\n vec4(a_matWorld2.xyz * scale2.z, 0.0),\n vec4(0.0, 0.0, 0.0, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n matWorldIT = cc_matWorldIT;\n #endif\n}\n#if CC_USE_REFLECTION_PROBE\n layout(location = 0) out mediump vec4 v_shadowBiasAndProbeId;\n#endif\nlayout(location = 1) out mediump vec3 v_position;\nlayout(location = 2) out mediump vec3 v_normal;\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld, matWorldIT;\n CCGetWorldMatrixFull(matWorld, matWorldIT);\n vec4 pos = matWorld * position;\n v_position = pos.xyz;\n v_normal = normalize((matWorldIT * vec4(a_normal, 0.0)).xyz);\n #if CC_USE_REFLECTION_PROBE\n #if USE_INSTANCING\n v_shadowBiasAndProbeId.zw = a_localShadowBiasAndProbeId.zw;\n #else\n v_shadowBiasAndProbeId.zw = cc_localShadowBias.zw;\n #endif\n #endif\n return cc_matProj * (cc_matView * matWorld) * position;\n}\nvoid main() { gl_Position = vert(); }",
  928. "frag": "\nprecision highp float;\nlayout(set = 2, binding = 15) uniform samplerCube cc_reflectionProbeCubemap;\nlayout(set = 2, binding = 16) uniform sampler2D cc_reflectionProbePlanarMap;\nlayout(set = 2, binding = 17) uniform sampler2D cc_reflectionProbeDataMap;\nlayout(set = 2, binding = 18) uniform samplerCube cc_reflectionProbeBlendCubemap;\nlayout(set = 0, binding = 5) uniform samplerCube cc_environment;\nvec4 fragTextureLod (sampler2D tex, vec2 coord, float lod) {\n return textureLod(tex, coord, lod);\n}\nvec4 fragTextureLod (samplerCube tex, vec3 coord, float lod) {\n return textureLod(tex, coord, lod);\n}\nvec3 ACESToneMap (vec3 color) {\n color = min(color, vec3(8.0));\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\nvec4 packRGBE (vec3 rgb) {\n highp float maxComp = max(max(rgb.r, rgb.g), rgb.b);\n highp float e = 128.0;\n if (maxComp > 0.0001) {\n e = log(maxComp) / log(1.1);\n e = ceil(e);\n e = clamp(e + 128.0, 0.0, 255.0);\n }\n highp float sc = 1.0 / pow(1.1, e - 128.0);\n vec3 encode = clamp(rgb * sc, vec3(0.0), vec3(1.0)) * 255.0;\n vec3 encode_rounded = floor(encode) + step(encode - floor(encode), vec3(0.5));\n return vec4(encode_rounded, e) / 255.0;\n}\nvec3 unpackRGBE (vec4 rgbe) {\n return rgbe.rgb * pow(1.1, rgbe.a * 255.0 - 128.0);\n}\nvec4 CCFragOutput (vec4 color) {\n #if CC_USE_RGBE_OUTPUT\n color = packRGBE(color.rgb);\n #elif !CC_USE_FLOAT_OUTPUT\n #if CC_USE_HDR && CC_TONE_MAPPING_TYPE == HDR_TONE_MAPPING_ACES\n color.rgb = ACESToneMap(color.rgb);\n #endif\n color.rgb = LinearToSRGB(color.rgb);\n #endif\n return color;\n}\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#if CC_USE_REFLECTION_PROBE\n layout(location = 0) in mediump vec4 v_shadowBiasAndProbeId;\n#endif\nlayout(location = 2) in mediump vec3 v_normal;\nlayout(location = 1) in vec3 v_position;\nvec4 frag () {\n #if CC_USE_REFLECTION_PROBE\n if(v_shadowBiasAndProbeId.z < 0.0)\n {\n return vec4(1.0);\n }\n #endif\n vec3 V = normalize(cc_cameraPos.xyz - v_position);\n vec3 N = normalize(v_normal);\n vec3 R = normalize(reflect(-V, N));\n vec4 probe = fragTextureLod(cc_reflectionProbeCubemap, R, 0.0);\n vec4 finalColor = vec4(1.0);\n finalColor.rgb = unpackRGBE(probe);\n return CCFragOutput(finalColor);\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  929. },
  930. "glsl3": {
  931. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nin vec3 a_position;\nin vec3 a_normal;\nin vec2 a_texCoord;\nin vec4 a_tangent;\n#if CC_USE_SKINNING\n in vec4 a_joints;\n in vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n in highp vec4 a_jointAnimInfo;\n #endif\n in vec4 a_matWorld0;\n in vec4 a_matWorld1;\n in vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n in vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n in vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n in vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n in vec4 a_sh_linear_const_r;\n in vec4 a_sh_linear_const_g;\n in vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n in float a_vertexId;\n int getVertexId() {\n return int(a_vertexId);\n }\n#endif\nhighp float decode32 (highp vec4 rgba) {\n rgba = rgba * 255.0;\n highp float Sign = 1.0 - (step(128.0, (rgba[3]) + 0.5)) * 2.0;\n highp float Exponent = 2.0 * (mod(float(int((rgba[3]) + 0.5)), 128.0)) + (step(128.0, (rgba[2]) + 0.5)) - 127.0;\n highp float Mantissa = (mod(float(int((rgba[2]) + 0.5)), 128.0)) * 65536.0 + rgba[1] * 256.0 + rgba[0] + 8388608.0;\n return Sign * exp2(Exponent - 23.0) * Mantissa;\n}\n#if CC_USE_MORPH\n layout(std140) uniform CCMorph {\n vec4 cc_displacementWeights[15];\n vec4 cc_displacementTextureInfo;\n };\n #if CC_MORPH_TARGET_HAS_POSITION\n uniform sampler2D cc_PositionDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n uniform sampler2D cc_NormalDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n uniform sampler2D cc_TangentDisplacements;\n #endif\n vec2 getPixelLocation(vec2 textureResolution, int pixelIndex) {\n float pixelIndexF = float(pixelIndex);\n float x = mod(pixelIndexF, textureResolution.x);\n float y = floor(pixelIndexF / textureResolution.x);\n return vec2(x, y);\n }\n vec2 getPixelCoordFromLocation(vec2 location, vec2 textureResolution) {\n return (vec2(location.x, location.y) + .5) / textureResolution;\n }\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int pixelIndex) {\n ivec2 texSize = textureSize(tex, 0);\n return texelFetch(tex, ivec2(pixelIndex % texSize.x, pixelIndex / texSize.x), 0);\n }\n #else\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex * 4;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 x = getPixelCoordFromLocation(location + vec2(0.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 y = getPixelCoordFromLocation(location + vec2(1.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 z = getPixelCoordFromLocation(location + vec2(2.0, 0.0), cc_displacementTextureInfo.xy);\n return vec4(\n decode32(texture(tex, x)),\n decode32(texture(tex, y)),\n decode32(texture(tex, z)),\n 1.0\n );\n }\n #endif\n float getDisplacementWeight(int index) {\n int quot = index / 4;\n int remainder = index - quot * 4;\n if (remainder == 0) {\n return cc_displacementWeights[quot].x;\n } else if (remainder == 1) {\n return cc_displacementWeights[quot].y;\n } else if (remainder == 2) {\n return cc_displacementWeights[quot].z;\n } else {\n return cc_displacementWeights[quot].w;\n }\n }\n vec3 getVec3DisplacementFromTexture(sampler2D tex, int vertexIndex) {\n #if CC_MORPH_PRECOMPUTED\n return fetchVec3ArrayFromTexture(tex, vertexIndex).rgb;\n #else\n vec3 result = vec3(0, 0, 0);\n int nVertices = int(cc_displacementTextureInfo.z);\n for (int iTarget = 0; iTarget < CC_MORPH_TARGET_COUNT; ++iTarget) {\n result += (fetchVec3ArrayFromTexture(tex, nVertices * iTarget + vertexIndex).rgb * getDisplacementWeight(iTarget));\n }\n return result;\n #endif\n }\n #if CC_MORPH_TARGET_HAS_POSITION\n vec3 getPositionDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_PositionDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n vec3 getNormalDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_NormalDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n vec3 getTangentDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_TangentDisplacements, vertexId);\n }\n #endif\n void applyMorph (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n int vertexId = getVertexId();\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n normal.xyz = normal.xyz + getNormalDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n tangent.xyz = tangent.xyz + getTangentDisplacement(vertexId);\n #endif\n }\n void applyMorph (inout vec4 position) {\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(getVertexId());\n #endif\n }\n#endif\n#if CC_USE_SKINNING\n #if CC_USE_BAKED_ANIMATION\n layout(std140) uniform CCSkinningTexture {\n highp vec4 cc_jointTextureInfo;\n };\n layout(std140) uniform CCSkinningAnimation {\n highp vec4 cc_jointAnimInfo;\n };\n uniform highp sampler2D cc_jointTexture;\n void CCGetJointTextureCoords(float pixelsPerJoint, float jointIdx, out highp float x, out highp float y, out highp float invSize)\n {\n #if USE_INSTANCING\n highp float temp = pixelsPerJoint * (a_jointAnimInfo.x * a_jointAnimInfo.y + jointIdx) + a_jointAnimInfo.z;\n #else\n highp float temp = pixelsPerJoint * (cc_jointAnimInfo.x * cc_jointTextureInfo.y + jointIdx) + cc_jointTextureInfo.z;\n #endif\n invSize = cc_jointTextureInfo.w;\n highp float tempY = floor(temp * invSize);\n x = floor(temp - tempY * cc_jointTextureInfo.x);\n y = (tempY + 0.5) * invSize;\n }\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n uniform highp sampler2D cc_realtimeJoint;\n #else\n layout(std140) uniform CCSkinning {\n highp vec4 cc_joints[CC_JOINT_UNIFORM_CAPACITY * 3];\n };\n #endif\n #endif\n #if CC_USE_BAKED_ANIMATION\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(3.0, i, x, y, invSize);\n vec4 v1 = texture(cc_jointTexture, vec2((x + 0.5) * invSize, y));\n vec4 v2 = texture(cc_jointTexture, vec2((x + 1.5) * invSize, y));\n vec4 v3 = texture(cc_jointTexture, vec2((x + 2.5) * invSize, y));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(12.0, i, x, y, invSize);\n vec4 v1 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 0.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 1.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 2.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 3.5) * invSize, y)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 4.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 5.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 6.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 7.5) * invSize, y)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_jointTexture, vec2((x + 8.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 9.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 10.5) * invSize, y))),\n decode32(texture(cc_jointTexture, vec2((x + 11.5) * invSize, y)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n float x = i;\n vec4 v1 = texture(cc_realtimeJoint, vec2( x / 256.0, 0.5 / 3.0));\n vec4 v2 = texture(cc_realtimeJoint, vec2( x / 256.0, 1.5 / 3.0));\n vec4 v3 = texture(cc_realtimeJoint, vec2( x / 256.0, 2.5 / 3.0));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n float x = 4.0 * i;\n vec4 v1 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 0.5 / 3.0)))\n );\n vec4 v2 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 1.5 / 3.0)))\n );\n vec4 v3 = vec4(\n decode32(texture(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 2.5 / 3.0)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n mat4 getJointMatrix (float i) {\n int idx = int(i);\n vec4 v1 = cc_joints[idx * 3];\n vec4 v2 = cc_joints[idx * 3 + 1];\n vec4 v3 = cc_joints[idx * 3 + 2];\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #endif\n mat4 skinMatrix () {\n vec4 joints = vec4(a_joints);\n return getJointMatrix(joints.x) * a_weights.x\n + getJointMatrix(joints.y) * a_weights.y\n + getJointMatrix(joints.z) * a_weights.z\n + getJointMatrix(joints.w) * a_weights.w;\n }\n void CCSkin (inout vec4 position) {\n mat4 m = skinMatrix();\n position = m * position;\n }\n void CCSkin (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n mat4 m = skinMatrix();\n position = m * position;\n normal = (m * vec4(normal, 0.0)).xyz;\n tangent.xyz = (m * vec4(tangent.xyz, 0.0)).xyz;\n }\n#endif\nvoid CCVertInput(inout vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#if !USE_INSTANCING\n layout(std140) uniform CCLocal {\n highp mat4 cc_matWorld;\n highp mat4 cc_matWorldIT;\n highp vec4 cc_lightingMapUVParam;\n highp vec4 cc_localShadowBias;\n highp vec4 cc_reflectionProbeData1;\n highp vec4 cc_reflectionProbeData2;\n highp vec4 cc_reflectionProbeBlendData1;\n highp vec4 cc_reflectionProbeBlendData2;\n };\n#endif\nvoid CCGetWorldMatrixFull(out mat4 matWorld, out mat4 matWorldIT)\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 vec3 scale = 1.0 / vec3(length(a_matWorld0.xyz), length(a_matWorld1.xyz), length(a_matWorld2.xyz));\n vec3 scale2 = scale * scale;\n matWorldIT = mat4(\n vec4(a_matWorld0.xyz * scale2.x, 0.0),\n vec4(a_matWorld1.xyz * scale2.y, 0.0),\n vec4(a_matWorld2.xyz * scale2.z, 0.0),\n vec4(0.0, 0.0, 0.0, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n matWorldIT = cc_matWorldIT;\n #endif\n}\n#if CC_USE_REFLECTION_PROBE\n out mediump vec4 v_shadowBiasAndProbeId;\n#endif\nout mediump vec3 v_position;\nout mediump vec3 v_normal;\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld, matWorldIT;\n CCGetWorldMatrixFull(matWorld, matWorldIT);\n vec4 pos = matWorld * position;\n v_position = pos.xyz;\n v_normal = normalize((matWorldIT * vec4(a_normal, 0.0)).xyz);\n #if CC_USE_REFLECTION_PROBE\n #if USE_INSTANCING\n v_shadowBiasAndProbeId.zw = a_localShadowBiasAndProbeId.zw;\n #else\n v_shadowBiasAndProbeId.zw = cc_localShadowBias.zw;\n #endif\n #endif\n return cc_matProj * (cc_matView * matWorld) * position;\n}\nvoid main() { gl_Position = vert(); }",
  932. "frag": "\nprecision highp float;\nuniform samplerCube cc_reflectionProbeCubemap;\nuniform sampler2D cc_reflectionProbePlanarMap;\nuniform sampler2D cc_reflectionProbeDataMap;\nuniform samplerCube cc_reflectionProbeBlendCubemap;\nuniform samplerCube cc_environment;\nvec4 fragTextureLod (sampler2D tex, vec2 coord, float lod) {\n return textureLod(tex, coord, lod);\n}\nvec4 fragTextureLod (samplerCube tex, vec3 coord, float lod) {\n return textureLod(tex, coord, lod);\n}\nvec3 ACESToneMap (vec3 color) {\n color = min(color, vec3(8.0));\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\nvec4 packRGBE (vec3 rgb) {\n highp float maxComp = max(max(rgb.r, rgb.g), rgb.b);\n highp float e = 128.0;\n if (maxComp > 0.0001) {\n e = log(maxComp) / log(1.1);\n e = ceil(e);\n e = clamp(e + 128.0, 0.0, 255.0);\n }\n highp float sc = 1.0 / pow(1.1, e - 128.0);\n vec3 encode = clamp(rgb * sc, vec3(0.0), vec3(1.0)) * 255.0;\n vec3 encode_rounded = floor(encode) + step(encode - floor(encode), vec3(0.5));\n return vec4(encode_rounded, e) / 255.0;\n}\nvec3 unpackRGBE (vec4 rgbe) {\n return rgbe.rgb * pow(1.1, rgbe.a * 255.0 - 128.0);\n}\nvec4 CCFragOutput (vec4 color) {\n #if CC_USE_RGBE_OUTPUT\n color = packRGBE(color.rgb);\n #elif !CC_USE_FLOAT_OUTPUT\n #if CC_USE_HDR && CC_TONE_MAPPING_TYPE == HDR_TONE_MAPPING_ACES\n color.rgb = ACESToneMap(color.rgb);\n #endif\n color.rgb = LinearToSRGB(color.rgb);\n #endif\n return color;\n}\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#if CC_USE_REFLECTION_PROBE\n in mediump vec4 v_shadowBiasAndProbeId;\n#endif\nin mediump vec3 v_normal;\nin vec3 v_position;\nvec4 frag () {\n #if CC_USE_REFLECTION_PROBE\n if(v_shadowBiasAndProbeId.z < 0.0)\n {\n return vec4(1.0);\n }\n #endif\n vec3 V = normalize(cc_cameraPos.xyz - v_position);\n vec3 N = normalize(v_normal);\n vec3 R = normalize(reflect(-V, N));\n vec4 probe = fragTextureLod(cc_reflectionProbeCubemap, R, 0.0);\n vec4 finalColor = vec4(1.0);\n finalColor.rgb = unpackRGBE(probe);\n return CCFragOutput(finalColor);\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  933. },
  934. "glsl1": {
  935. "vert": "\nprecision highp float;\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nstruct StandardVertInput {\n highp vec4 position;\n vec3 normal;\n vec4 tangent;\n};\nattribute vec3 a_position;\nattribute vec3 a_normal;\nattribute vec2 a_texCoord;\nattribute vec4 a_tangent;\n#if CC_USE_SKINNING\n attribute vec4 a_joints;\n attribute vec4 a_weights;\n#endif\n#if USE_INSTANCING\n #if CC_USE_BAKED_ANIMATION\n attribute highp vec4 a_jointAnimInfo;\n #endif\n attribute vec4 a_matWorld0;\n attribute vec4 a_matWorld1;\n attribute vec4 a_matWorld2;\n #if CC_USE_LIGHTMAP\n attribute vec4 a_lightingMapUVParam;\n #endif\n #if CC_USE_REFLECTION_PROBE || CC_RECEIVE_SHADOW\n #if CC_RECEIVE_SHADOW\n #endif\n attribute vec4 a_localShadowBiasAndProbeId;\n #endif\n #if CC_USE_REFLECTION_PROBE\n attribute vec4 a_reflectionProbeData;\n #endif\n #if CC_USE_LIGHT_PROBE\n attribute vec4 a_sh_linear_const_r;\n attribute vec4 a_sh_linear_const_g;\n attribute vec4 a_sh_linear_const_b;\n #endif\n#endif\n#if CC_USE_MORPH\n attribute float a_vertexId;\n int getVertexId() {\n return int(a_vertexId);\n }\n#endif\nhighp float decode32 (highp vec4 rgba) {\n rgba = rgba * 255.0;\n highp float Sign = 1.0 - (step(128.0, (rgba[3]) + 0.5)) * 2.0;\n highp float Exponent = 2.0 * (mod(float(int((rgba[3]) + 0.5)), 128.0)) + (step(128.0, (rgba[2]) + 0.5)) - 127.0;\n highp float Mantissa = (mod(float(int((rgba[2]) + 0.5)), 128.0)) * 65536.0 + rgba[1] * 256.0 + rgba[0] + 8388608.0;\n return Sign * exp2(Exponent - 23.0) * Mantissa;\n}\n#if CC_USE_MORPH\n uniform vec4 cc_displacementWeights[15];\n uniform vec4 cc_displacementTextureInfo;\n #if CC_MORPH_TARGET_HAS_POSITION\n uniform sampler2D cc_PositionDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n uniform sampler2D cc_NormalDisplacements;\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n uniform sampler2D cc_TangentDisplacements;\n #endif\n vec2 getPixelLocation(vec2 textureResolution, int pixelIndex) {\n float pixelIndexF = float(pixelIndex);\n float x = mod(pixelIndexF, textureResolution.x);\n float y = floor(pixelIndexF / textureResolution.x);\n return vec2(x, y);\n }\n vec2 getPixelCoordFromLocation(vec2 location, vec2 textureResolution) {\n return (vec2(location.x, location.y) + .5) / textureResolution;\n }\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 uv = getPixelCoordFromLocation(location, cc_displacementTextureInfo.xy);\n return texture2D(tex, uv);\n }\n #else\n vec4 fetchVec3ArrayFromTexture(sampler2D tex, int elementIndex) {\n int pixelIndex = elementIndex * 4;\n vec2 location = getPixelLocation(cc_displacementTextureInfo.xy, pixelIndex);\n vec2 x = getPixelCoordFromLocation(location + vec2(0.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 y = getPixelCoordFromLocation(location + vec2(1.0, 0.0), cc_displacementTextureInfo.xy);\n vec2 z = getPixelCoordFromLocation(location + vec2(2.0, 0.0), cc_displacementTextureInfo.xy);\n return vec4(\n decode32(texture2D(tex, x)),\n decode32(texture2D(tex, y)),\n decode32(texture2D(tex, z)),\n 1.0\n );\n }\n #endif\n float getDisplacementWeight(int index) {\n int quot = index / 4;\n int remainder = index - quot * 4;\n if (remainder == 0) {\n return cc_displacementWeights[quot].x;\n } else if (remainder == 1) {\n return cc_displacementWeights[quot].y;\n } else if (remainder == 2) {\n return cc_displacementWeights[quot].z;\n } else {\n return cc_displacementWeights[quot].w;\n }\n }\n vec3 getVec3DisplacementFromTexture(sampler2D tex, int vertexIndex) {\n #if CC_MORPH_PRECOMPUTED\n return fetchVec3ArrayFromTexture(tex, vertexIndex).rgb;\n #else\n vec3 result = vec3(0, 0, 0);\n int nVertices = int(cc_displacementTextureInfo.z);\n for (int iTarget = 0; iTarget < CC_MORPH_TARGET_COUNT; ++iTarget) {\n result += (fetchVec3ArrayFromTexture(tex, nVertices * iTarget + vertexIndex).rgb * getDisplacementWeight(iTarget));\n }\n return result;\n #endif\n }\n #if CC_MORPH_TARGET_HAS_POSITION\n vec3 getPositionDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_PositionDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n vec3 getNormalDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_NormalDisplacements, vertexId);\n }\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n vec3 getTangentDisplacement(int vertexId) {\n return getVec3DisplacementFromTexture(cc_TangentDisplacements, vertexId);\n }\n #endif\n void applyMorph (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n int vertexId = getVertexId();\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_NORMAL\n normal.xyz = normal.xyz + getNormalDisplacement(vertexId);\n #endif\n #if CC_MORPH_TARGET_HAS_TANGENT\n tangent.xyz = tangent.xyz + getTangentDisplacement(vertexId);\n #endif\n }\n void applyMorph (inout vec4 position) {\n #if CC_MORPH_TARGET_HAS_POSITION\n position.xyz = position.xyz + getPositionDisplacement(getVertexId());\n #endif\n }\n#endif\n#if CC_USE_SKINNING\n #if CC_USE_BAKED_ANIMATION\n uniform highp vec4 cc_jointTextureInfo;\n uniform highp vec4 cc_jointAnimInfo;\n uniform highp sampler2D cc_jointTexture;\n void CCGetJointTextureCoords(float pixelsPerJoint, float jointIdx, out highp float x, out highp float y, out highp float invSize)\n {\n #if USE_INSTANCING\n highp float temp = pixelsPerJoint * (a_jointAnimInfo.x * a_jointAnimInfo.y + jointIdx) + a_jointAnimInfo.z;\n #else\n highp float temp = pixelsPerJoint * (cc_jointAnimInfo.x * cc_jointTextureInfo.y + jointIdx) + cc_jointTextureInfo.z;\n #endif\n invSize = cc_jointTextureInfo.w;\n highp float tempY = floor(temp * invSize);\n x = floor(temp - tempY * cc_jointTextureInfo.x);\n y = (tempY + 0.5) * invSize;\n }\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n uniform highp sampler2D cc_realtimeJoint;\n #else\n uniform highp vec4 cc_joints[CC_JOINT_UNIFORM_CAPACITY * 3];\n #endif\n #endif\n #if CC_USE_BAKED_ANIMATION\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(3.0, i, x, y, invSize);\n vec4 v1 = texture2D(cc_jointTexture, vec2((x + 0.5) * invSize, y));\n vec4 v2 = texture2D(cc_jointTexture, vec2((x + 1.5) * invSize, y));\n vec4 v3 = texture2D(cc_jointTexture, vec2((x + 2.5) * invSize, y));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n highp float x, y, invSize;\n CCGetJointTextureCoords(12.0, i, x, y, invSize);\n vec4 v1 = vec4(\n decode32(texture2D(cc_jointTexture, vec2((x + 0.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 1.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 2.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 3.5) * invSize, y)))\n );\n vec4 v2 = vec4(\n decode32(texture2D(cc_jointTexture, vec2((x + 4.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 5.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 6.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 7.5) * invSize, y)))\n );\n vec4 v3 = vec4(\n decode32(texture2D(cc_jointTexture, vec2((x + 8.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 9.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 10.5) * invSize, y))),\n decode32(texture2D(cc_jointTexture, vec2((x + 11.5) * invSize, y)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n #if CC_USE_REAL_TIME_JOINT_TEXTURE\n #if CC_DEVICE_SUPPORT_FLOAT_TEXTURE\n mat4 getJointMatrix (float i) {\n float x = i;\n vec4 v1 = texture2D(cc_realtimeJoint, vec2( x / 256.0, 0.5 / 3.0));\n vec4 v2 = texture2D(cc_realtimeJoint, vec2( x / 256.0, 1.5 / 3.0));\n vec4 v3 = texture2D(cc_realtimeJoint, vec2( x / 256.0, 2.5 / 3.0));\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #else\n mat4 getJointMatrix (float i) {\n float x = 4.0 * i;\n vec4 v1 = vec4(\n decode32(texture2D(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 0.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 0.5 / 3.0)))\n );\n vec4 v2 = vec4(\n decode32(texture2D(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 1.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 1.5 / 3.0)))\n );\n vec4 v3 = vec4(\n decode32(texture2D(cc_realtimeJoint, vec2((x + 0.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 1.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 2.5)/ 1024.0, 2.5 / 3.0))),\n decode32(texture2D(cc_realtimeJoint, vec2((x + 3.5)/ 1024.0, 2.5 / 3.0)))\n );\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #else\n mat4 getJointMatrix (float i) {\n int idx = int(i);\n vec4 v1 = cc_joints[idx * 3];\n vec4 v2 = cc_joints[idx * 3 + 1];\n vec4 v3 = cc_joints[idx * 3 + 2];\n return mat4(vec4(v1.xyz, 0.0), vec4(v2.xyz, 0.0), vec4(v3.xyz, 0.0), vec4(v1.w, v2.w, v3.w, 1.0));\n }\n #endif\n #endif\n mat4 skinMatrix () {\n vec4 joints = vec4(a_joints);\n return getJointMatrix(joints.x) * a_weights.x\n + getJointMatrix(joints.y) * a_weights.y\n + getJointMatrix(joints.z) * a_weights.z\n + getJointMatrix(joints.w) * a_weights.w;\n }\n void CCSkin (inout vec4 position) {\n mat4 m = skinMatrix();\n position = m * position;\n }\n void CCSkin (inout vec4 position, inout vec3 normal, inout vec4 tangent) {\n mat4 m = skinMatrix();\n position = m * position;\n normal = (m * vec4(normal, 0.0)).xyz;\n tangent.xyz = (m * vec4(tangent.xyz, 0.0)).xyz;\n }\n#endif\nvoid CCVertInput(inout vec4 In)\n{\n In = vec4(a_position, 1.0);\n #if CC_USE_MORPH\n applyMorph(In);\n #endif\n #if CC_USE_SKINNING\n CCSkin(In);\n #endif\n}\nuniform highp mat4 cc_matView;\n uniform highp mat4 cc_matProj;\n#if !USE_INSTANCING\n uniform highp mat4 cc_matWorld;\n uniform highp mat4 cc_matWorldIT;\n uniform highp vec4 cc_localShadowBias;\n#endif\nvoid CCGetWorldMatrixFull(out mat4 matWorld, out mat4 matWorldIT)\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 vec3 scale = 1.0 / vec3(length(a_matWorld0.xyz), length(a_matWorld1.xyz), length(a_matWorld2.xyz));\n vec3 scale2 = scale * scale;\n matWorldIT = mat4(\n vec4(a_matWorld0.xyz * scale2.x, 0.0),\n vec4(a_matWorld1.xyz * scale2.y, 0.0),\n vec4(a_matWorld2.xyz * scale2.z, 0.0),\n vec4(0.0, 0.0, 0.0, 1.0)\n );\n #else\n matWorld = cc_matWorld;\n matWorldIT = cc_matWorldIT;\n #endif\n}\n#if CC_USE_REFLECTION_PROBE\n varying mediump vec4 v_shadowBiasAndProbeId;\n#endif\nvarying mediump vec3 v_position;\nvarying mediump vec3 v_normal;\nvec4 vert () {\n vec4 position;\n CCVertInput(position);\n mat4 matWorld, matWorldIT;\n CCGetWorldMatrixFull(matWorld, matWorldIT);\n vec4 pos = matWorld * position;\n v_position = pos.xyz;\n v_normal = normalize((matWorldIT * vec4(a_normal, 0.0)).xyz);\n #if CC_USE_REFLECTION_PROBE\n #if USE_INSTANCING\n v_shadowBiasAndProbeId.zw = a_localShadowBiasAndProbeId.zw;\n #else\n v_shadowBiasAndProbeId.zw = cc_localShadowBias.zw;\n #endif\n #endif\n return cc_matProj * (cc_matView * matWorld) * position;\n}\nvoid main() { gl_Position = vert(); }",
  936. "frag": "\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod: enable\n#endif\nprecision highp float;\nuniform samplerCube cc_reflectionProbeCubemap;\nuniform sampler2D cc_reflectionProbePlanarMap;\nuniform sampler2D cc_reflectionProbeDataMap;\nuniform samplerCube cc_reflectionProbeBlendCubemap;\nuniform samplerCube cc_environment;\nvec4 fragTextureLod (sampler2D tex, vec2 coord, float lod) {\n #ifdef GL_EXT_shader_texture_lod\n return texture2DLodEXT(tex, coord, lod);\n #else\n return texture2D(tex, coord, lod);\n #endif\n}\nvec4 fragTextureLod (samplerCube tex, vec3 coord, float lod) {\n #ifdef GL_EXT_shader_texture_lod\n return textureCubeLodEXT(tex, coord, lod);\n #else\n return textureCube(tex, coord, lod);\n #endif\n}\nvec3 ACESToneMap (vec3 color) {\n color = min(color, vec3(8.0));\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nvec3 LinearToSRGB(vec3 linear) {\n#ifdef CC_USE_SURFACE_SHADER\n #if CC_USE_DEBUG_VIEW == CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC && CC_SURFACES_ENABLE_DEBUG_VIEW\n if (!IS_DEBUG_VIEW_COMPOSITE_ENABLE_GAMMA_CORRECTION) {\n return linear;\n }\n #endif\n#endif\n return sqrt(linear);\n}\nvec4 packRGBE (vec3 rgb) {\n highp float maxComp = max(max(rgb.r, rgb.g), rgb.b);\n highp float e = 128.0;\n if (maxComp > 0.0001) {\n e = log(maxComp) / log(1.1);\n e = ceil(e);\n e = clamp(e + 128.0, 0.0, 255.0);\n }\n highp float sc = 1.0 / pow(1.1, e - 128.0);\n vec3 encode = clamp(rgb * sc, vec3(0.0), vec3(1.0)) * 255.0;\n vec3 encode_rounded = floor(encode) + step(encode - floor(encode), vec3(0.5));\n return vec4(encode_rounded, e) / 255.0;\n}\nvec3 unpackRGBE (vec4 rgbe) {\n return rgbe.rgb * pow(1.1, rgbe.a * 255.0 - 128.0);\n}\nvec4 CCFragOutput (vec4 color) {\n #if CC_USE_RGBE_OUTPUT\n color = packRGBE(color.rgb);\n #elif !CC_USE_FLOAT_OUTPUT\n #if CC_USE_HDR && CC_TONE_MAPPING_TYPE == HDR_TONE_MAPPING_ACES\n color.rgb = ACESToneMap(color.rgb);\n #endif\n color.rgb = LinearToSRGB(color.rgb);\n #endif\n return color;\n}\nuniform highp vec4 cc_cameraPos;\n#if CC_USE_REFLECTION_PROBE\n varying mediump vec4 v_shadowBiasAndProbeId;\n#endif\nvarying mediump vec3 v_normal;\nvarying vec3 v_position;\nvec4 frag () {\n #if CC_USE_REFLECTION_PROBE\n if(v_shadowBiasAndProbeId.z < 0.0)\n {\n return vec4(1.0);\n }\n #endif\n vec3 V = normalize(cc_cameraPos.xyz - v_position);\n vec3 N = normalize(v_normal);\n vec3 R = normalize(reflect(-V, N));\n vec4 probe = fragTextureLod(cc_reflectionProbeCubemap, R, 0.0);\n vec4 finalColor = vec4(1.0);\n finalColor.rgb = unpackRGBE(probe);\n return CCFragOutput(finalColor);\n}\nvoid main() { gl_FragColor = frag(); }"
  937. },
  938. "builtins": {
  939. "globals": {
  940. "blocks": [
  941. {
  942. "name": "CCGlobal",
  943. "defines": []
  944. },
  945. {
  946. "name": "CCCamera",
  947. "defines": []
  948. }
  949. ],
  950. "samplerTextures": [
  951. {
  952. "name": "cc_environment",
  953. "defines": []
  954. }
  955. ],
  956. "buffers": [],
  957. "images": []
  958. },
  959. "locals": {
  960. "blocks": [
  961. {
  962. "name": "CCMorph",
  963. "defines": [
  964. "CC_USE_MORPH"
  965. ]
  966. },
  967. {
  968. "name": "CCSkinningTexture",
  969. "defines": [
  970. "CC_USE_SKINNING",
  971. "CC_USE_BAKED_ANIMATION"
  972. ]
  973. },
  974. {
  975. "name": "CCSkinningAnimation",
  976. "defines": [
  977. "CC_USE_SKINNING",
  978. "CC_USE_BAKED_ANIMATION"
  979. ]
  980. },
  981. {
  982. "name": "CCSkinning",
  983. "defines": [
  984. "CC_USE_SKINNING",
  985. "!CC_USE_BAKED_ANIMATION",
  986. "!CC_USE_REAL_TIME_JOINT_TEXTURE"
  987. ]
  988. },
  989. {
  990. "name": "CCLocal",
  991. "defines": [
  992. "!USE_INSTANCING"
  993. ]
  994. }
  995. ],
  996. "samplerTextures": [
  997. {
  998. "name": "cc_PositionDisplacements",
  999. "defines": [
  1000. "CC_USE_MORPH",
  1001. "CC_MORPH_TARGET_HAS_POSITION"
  1002. ]
  1003. },
  1004. {
  1005. "name": "cc_NormalDisplacements",
  1006. "defines": [
  1007. "CC_USE_MORPH",
  1008. "CC_MORPH_TARGET_HAS_NORMAL"
  1009. ]
  1010. },
  1011. {
  1012. "name": "cc_TangentDisplacements",
  1013. "defines": [
  1014. "CC_USE_MORPH",
  1015. "CC_MORPH_TARGET_HAS_TANGENT"
  1016. ]
  1017. },
  1018. {
  1019. "name": "cc_jointTexture",
  1020. "defines": [
  1021. "CC_USE_SKINNING",
  1022. "CC_USE_BAKED_ANIMATION"
  1023. ]
  1024. },
  1025. {
  1026. "name": "cc_realtimeJoint",
  1027. "defines": [
  1028. "CC_USE_SKINNING",
  1029. "!CC_USE_BAKED_ANIMATION",
  1030. "CC_USE_REAL_TIME_JOINT_TEXTURE"
  1031. ]
  1032. },
  1033. {
  1034. "name": "cc_reflectionProbeCubemap",
  1035. "defines": []
  1036. },
  1037. {
  1038. "name": "cc_reflectionProbePlanarMap",
  1039. "defines": []
  1040. },
  1041. {
  1042. "name": "cc_reflectionProbeDataMap",
  1043. "defines": []
  1044. },
  1045. {
  1046. "name": "cc_reflectionProbeBlendCubemap",
  1047. "defines": []
  1048. }
  1049. ],
  1050. "buffers": [],
  1051. "images": []
  1052. },
  1053. "statistics": {
  1054. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 74,
  1055. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 42
  1056. }
  1057. },
  1058. "defines": [
  1059. {
  1060. "name": "USE_INSTANCING",
  1061. "type": "boolean",
  1062. "defines": [],
  1063. "editor": {
  1064. "elevated": true
  1065. }
  1066. },
  1067. {
  1068. "name": "CC_USE_SKINNING",
  1069. "type": "boolean",
  1070. "defines": []
  1071. },
  1072. {
  1073. "name": "CC_USE_BAKED_ANIMATION",
  1074. "type": "boolean",
  1075. "defines": [
  1076. "USE_INSTANCING"
  1077. ]
  1078. },
  1079. {
  1080. "name": "CC_USE_LIGHTMAP",
  1081. "type": "boolean",
  1082. "defines": [
  1083. "USE_INSTANCING"
  1084. ]
  1085. },
  1086. {
  1087. "name": "CC_USE_REFLECTION_PROBE",
  1088. "type": "boolean",
  1089. "defines": []
  1090. },
  1091. {
  1092. "name": "CC_RECEIVE_SHADOW",
  1093. "type": "boolean",
  1094. "defines": [
  1095. "USE_INSTANCING"
  1096. ]
  1097. },
  1098. {
  1099. "name": "CC_USE_LIGHT_PROBE",
  1100. "type": "boolean",
  1101. "defines": [
  1102. "USE_INSTANCING"
  1103. ]
  1104. },
  1105. {
  1106. "name": "CC_USE_MORPH",
  1107. "type": "boolean",
  1108. "defines": []
  1109. },
  1110. {
  1111. "name": "CC_MORPH_TARGET_COUNT",
  1112. "type": "number",
  1113. "defines": [
  1114. "CC_USE_MORPH"
  1115. ],
  1116. "range": [
  1117. 2,
  1118. 8
  1119. ]
  1120. },
  1121. {
  1122. "name": "CC_MORPH_TARGET_HAS_POSITION",
  1123. "type": "boolean",
  1124. "defines": [
  1125. "CC_USE_MORPH"
  1126. ]
  1127. },
  1128. {
  1129. "name": "CC_MORPH_TARGET_HAS_NORMAL",
  1130. "type": "boolean",
  1131. "defines": [
  1132. "CC_USE_MORPH"
  1133. ]
  1134. },
  1135. {
  1136. "name": "CC_MORPH_TARGET_HAS_TANGENT",
  1137. "type": "boolean",
  1138. "defines": [
  1139. "CC_USE_MORPH"
  1140. ]
  1141. },
  1142. {
  1143. "name": "CC_MORPH_PRECOMPUTED",
  1144. "type": "boolean",
  1145. "defines": [
  1146. "CC_USE_MORPH"
  1147. ]
  1148. },
  1149. {
  1150. "name": "CC_USE_REAL_TIME_JOINT_TEXTURE",
  1151. "type": "boolean",
  1152. "defines": [
  1153. "CC_USE_SKINNING",
  1154. "!CC_USE_BAKED_ANIMATION"
  1155. ]
  1156. },
  1157. {
  1158. "name": "CC_USE_IBL",
  1159. "type": "number",
  1160. "defines": [],
  1161. "range": [
  1162. 0,
  1163. 2
  1164. ]
  1165. },
  1166. {
  1167. "name": "CC_USE_DEBUG_VIEW",
  1168. "type": "number",
  1169. "defines": [],
  1170. "range": [
  1171. 0,
  1172. 3
  1173. ]
  1174. },
  1175. {
  1176. "name": "CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC",
  1177. "type": "boolean",
  1178. "defines": [
  1179. "CC_USE_DEBUG_VIEW"
  1180. ]
  1181. },
  1182. {
  1183. "name": "CC_SURFACES_ENABLE_DEBUG_VIEW",
  1184. "type": "boolean",
  1185. "defines": [
  1186. "CC_USE_DEBUG_VIEW",
  1187. "CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC"
  1188. ]
  1189. },
  1190. {
  1191. "name": "CC_USE_RGBE_OUTPUT",
  1192. "type": "boolean",
  1193. "defines": []
  1194. },
  1195. {
  1196. "name": "CC_USE_FLOAT_OUTPUT",
  1197. "type": "boolean",
  1198. "defines": [
  1199. "!CC_USE_RGBE_OUTPUT"
  1200. ]
  1201. },
  1202. {
  1203. "name": "CC_USE_HDR",
  1204. "type": "boolean",
  1205. "defines": [
  1206. "!CC_USE_RGBE_OUTPUT",
  1207. "!CC_USE_FLOAT_OUTPUT"
  1208. ]
  1209. },
  1210. {
  1211. "name": "CC_TONE_MAPPING_TYPE",
  1212. "type": "number",
  1213. "defines": [
  1214. "CC_USE_HDR",
  1215. "!CC_USE_RGBE_OUTPUT",
  1216. "!CC_USE_FLOAT_OUTPUT"
  1217. ],
  1218. "range": [
  1219. 0,
  1220. 3
  1221. ]
  1222. },
  1223. {
  1224. "name": "HDR_TONE_MAPPING_ACES",
  1225. "type": "boolean",
  1226. "defines": [
  1227. "CC_USE_HDR",
  1228. "CC_TONE_MAPPING_TYPE",
  1229. "!CC_USE_RGBE_OUTPUT",
  1230. "!CC_USE_FLOAT_OUTPUT"
  1231. ]
  1232. }
  1233. ],
  1234. "name": "builtin-reflection-probe-preview|unlit-vs:vert|unlit-fs:frag"
  1235. }
  1236. ],
  1237. "combinations": [
  1238. {},
  1239. {},
  1240. {}
  1241. ],
  1242. "hideInEditor": false
  1243. }