4736e978-c8fa-449f-9cf6-fe0158ded9d7.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "internal/editor/grid-stroke",
  4. "_objFlags": 0,
  5. "__editorExtras__": {},
  6. "_native": "",
  7. "techniques": [
  8. {
  9. "passes": [
  10. {
  11. "rasterizerState": {
  12. "cullMode": 0
  13. },
  14. "blendState": {
  15. "targets": [
  16. {
  17. "blend": true,
  18. "blendSrc": 2,
  19. "blendDst": 4,
  20. "blendDstAlpha": 4
  21. }
  22. ]
  23. },
  24. "program": "internal/editor/grid-stroke|grid-vs:vert|grid-fs:frag",
  25. "priority": 244,
  26. "depthStencilState": {
  27. "depthTest": true,
  28. "depthWrite": false
  29. }
  30. }
  31. ]
  32. }
  33. ],
  34. "shaders": [
  35. {
  36. "blocks": [],
  37. "samplerTextures": [],
  38. "samplers": [],
  39. "textures": [],
  40. "buffers": [],
  41. "images": [],
  42. "subpassInputs": [],
  43. "attributes": [
  44. {
  45. "name": "a_texCoord",
  46. "defines": [],
  47. "format": 21,
  48. "location": 0
  49. },
  50. {
  51. "name": "a_position",
  52. "defines": [],
  53. "format": 32,
  54. "location": 1
  55. }
  56. ],
  57. "varyings": [
  58. {
  59. "name": "uv",
  60. "type": 14,
  61. "count": 1,
  62. "defines": [],
  63. "stageFlags": 17,
  64. "location": 0
  65. },
  66. {
  67. "name": "pos_w",
  68. "type": 15,
  69. "count": 1,
  70. "defines": [],
  71. "stageFlags": 17,
  72. "location": 1
  73. }
  74. ],
  75. "fragColors": [
  76. {
  77. "name": "cc_FragColor",
  78. "typename": "vec4",
  79. "type": 16,
  80. "count": 1,
  81. "defines": [],
  82. "stageFlags": 16,
  83. "location": 0
  84. }
  85. ],
  86. "descriptors": [
  87. {
  88. "rate": 0,
  89. "blocks": [],
  90. "samplerTextures": [],
  91. "samplers": [],
  92. "textures": [],
  93. "buffers": [],
  94. "images": [],
  95. "subpassInputs": []
  96. },
  97. {
  98. "rate": 1,
  99. "blocks": [],
  100. "samplerTextures": [],
  101. "samplers": [],
  102. "textures": [],
  103. "buffers": [],
  104. "images": [],
  105. "subpassInputs": []
  106. },
  107. {
  108. "rate": 2,
  109. "blocks": [],
  110. "samplerTextures": [],
  111. "samplers": [],
  112. "textures": [],
  113. "buffers": [],
  114. "images": [],
  115. "subpassInputs": []
  116. },
  117. {
  118. "rate": 3,
  119. "blocks": [
  120. {
  121. "tags": {
  122. "builtin": "global"
  123. },
  124. "name": "CCGlobal",
  125. "members": [
  126. {
  127. "name": "cc_time",
  128. "typename": "vec4",
  129. "type": 16,
  130. "count": 1,
  131. "precision": "highp "
  132. },
  133. {
  134. "name": "cc_screenSize",
  135. "typename": "vec4",
  136. "type": 16,
  137. "count": 1,
  138. "precision": "mediump "
  139. },
  140. {
  141. "name": "cc_nativeSize",
  142. "typename": "vec4",
  143. "type": 16,
  144. "count": 1,
  145. "precision": "mediump "
  146. },
  147. {
  148. "name": "cc_probeInfo",
  149. "typename": "vec4",
  150. "type": 16,
  151. "count": 1,
  152. "precision": "mediump "
  153. },
  154. {
  155. "name": "cc_debug_view_mode",
  156. "typename": "vec4",
  157. "type": 16,
  158. "count": 1,
  159. "precision": "mediump "
  160. }
  161. ],
  162. "defines": [],
  163. "stageFlags": 17
  164. },
  165. {
  166. "tags": {
  167. "builtin": "global"
  168. },
  169. "name": "CCCamera",
  170. "members": [
  171. {
  172. "name": "cc_matView",
  173. "typename": "mat4",
  174. "type": 25,
  175. "count": 1,
  176. "precision": "highp "
  177. },
  178. {
  179. "name": "cc_matViewInv",
  180. "typename": "mat4",
  181. "type": 25,
  182. "count": 1,
  183. "precision": "highp "
  184. },
  185. {
  186. "name": "cc_matProj",
  187. "typename": "mat4",
  188. "type": 25,
  189. "count": 1,
  190. "precision": "highp "
  191. },
  192. {
  193. "name": "cc_matProjInv",
  194. "typename": "mat4",
  195. "type": 25,
  196. "count": 1,
  197. "precision": "highp "
  198. },
  199. {
  200. "name": "cc_matViewProj",
  201. "typename": "mat4",
  202. "type": 25,
  203. "count": 1,
  204. "precision": "highp "
  205. },
  206. {
  207. "name": "cc_matViewProjInv",
  208. "typename": "mat4",
  209. "type": 25,
  210. "count": 1,
  211. "precision": "highp "
  212. },
  213. {
  214. "name": "cc_cameraPos",
  215. "typename": "vec4",
  216. "type": 16,
  217. "count": 1,
  218. "precision": "highp "
  219. },
  220. {
  221. "name": "cc_surfaceTransform",
  222. "typename": "vec4",
  223. "type": 16,
  224. "count": 1,
  225. "precision": "mediump "
  226. },
  227. {
  228. "name": "cc_screenScale",
  229. "typename": "vec4",
  230. "type": 16,
  231. "count": 1,
  232. "precision": "mediump "
  233. },
  234. {
  235. "name": "cc_exposure",
  236. "typename": "vec4",
  237. "type": 16,
  238. "count": 1,
  239. "precision": "mediump "
  240. },
  241. {
  242. "name": "cc_mainLitDir",
  243. "typename": "vec4",
  244. "type": 16,
  245. "count": 1,
  246. "precision": "mediump "
  247. },
  248. {
  249. "name": "cc_mainLitColor",
  250. "typename": "vec4",
  251. "type": 16,
  252. "count": 1,
  253. "precision": "mediump "
  254. },
  255. {
  256. "name": "cc_ambientSky",
  257. "typename": "vec4",
  258. "type": 16,
  259. "count": 1,
  260. "precision": "mediump "
  261. },
  262. {
  263. "name": "cc_ambientGround",
  264. "typename": "vec4",
  265. "type": 16,
  266. "count": 1,
  267. "precision": "mediump "
  268. },
  269. {
  270. "name": "cc_fogColor",
  271. "typename": "vec4",
  272. "type": 16,
  273. "count": 1,
  274. "precision": "mediump "
  275. },
  276. {
  277. "name": "cc_fogBase",
  278. "typename": "vec4",
  279. "type": 16,
  280. "count": 1,
  281. "precision": "mediump "
  282. },
  283. {
  284. "name": "cc_fogAdd",
  285. "typename": "vec4",
  286. "type": 16,
  287. "count": 1,
  288. "precision": "mediump "
  289. },
  290. {
  291. "name": "cc_nearFar",
  292. "typename": "vec4",
  293. "type": 16,
  294. "count": 1,
  295. "precision": "mediump "
  296. },
  297. {
  298. "name": "cc_viewPort",
  299. "typename": "vec4",
  300. "type": 16,
  301. "count": 1,
  302. "precision": "mediump "
  303. }
  304. ],
  305. "defines": [],
  306. "stageFlags": 17
  307. }
  308. ],
  309. "samplerTextures": [],
  310. "samplers": [],
  311. "textures": [],
  312. "buffers": [],
  313. "images": [],
  314. "subpassInputs": []
  315. }
  316. ],
  317. "hash": 1229821779,
  318. "glsl4": {
  319. "vert": "\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};\nlayout(location = 0) in vec2 a_texCoord;\nlayout(location = 1) in vec3 a_position;\nlayout(location = 0) out vec2 uv;\nlayout(location = 1) out vec3 pos_w;\nvec4 vert () {\n uv = a_texCoord;\n pos_w = a_position;\n vec2 forward = vec2(cc_matView[0][2], cc_matView[2][2]);\n float dist = abs(cc_cameraPos.y);\n vec2 scale = vec2(1.0 - a_texCoord.y, a_texCoord.y);\n pos_w.xz += scale * vec2((a_texCoord.x * 2.0 - 1.0) * dist * 0.002);\n vec4 pos = cc_matViewProj * vec4(pos_w, 1.0);\n pos.z += 0.00011;\n return pos;\n}\nvoid main() { gl_Position = vert(); }",
  320. "frag": "\nprecision mediump float;\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nlayout(location = 0) in vec2 uv;\nlayout(location = 1) in vec3 pos_w;\nvec4 frag () {\n float alpha = sqrt(0.5 - abs(uv.x - 0.5));\n float scale = abs(normalize(cc_cameraPos.xyz - pos_w).y);\n if (scale < 0.5) alpha *= max(0.3, scale / 0.5);\n return CCFragOutput(vec4(0.5, 0.5, 0.5, alpha));\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  321. },
  322. "glsl3": {
  323. "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};\nin vec2 a_texCoord;\nin vec3 a_position;\nout vec2 uv;\nout vec3 pos_w;\nvec4 vert () {\n uv = a_texCoord;\n pos_w = a_position;\n vec2 forward = vec2(cc_matView[0][2], cc_matView[2][2]);\n float dist = abs(cc_cameraPos.y);\n vec2 scale = vec2(1.0 - a_texCoord.y, a_texCoord.y);\n pos_w.xz += scale * vec2((a_texCoord.x * 2.0 - 1.0) * dist * 0.002);\n vec4 pos = cc_matViewProj * vec4(pos_w, 1.0);\n pos.z += 0.00011;\n return pos;\n}\nvoid main() { gl_Position = vert(); }",
  324. "frag": "\nprecision mediump float;\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nin vec2 uv;\nin vec3 pos_w;\nvec4 frag () {\n float alpha = sqrt(0.5 - abs(uv.x - 0.5));\n float scale = abs(normalize(cc_cameraPos.xyz - pos_w).y);\n if (scale < 0.5) alpha *= max(0.3, scale / 0.5);\n return CCFragOutput(vec4(0.5, 0.5, 0.5, alpha));\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  325. },
  326. "glsl1": {
  327. "vert": "\nprecision mediump float;\nuniform highp mat4 cc_matView;\n uniform highp mat4 cc_matViewProj;\n uniform highp vec4 cc_cameraPos;\nattribute vec2 a_texCoord;\nattribute vec3 a_position;\nvarying vec2 uv;\nvarying vec3 pos_w;\nvec4 vert () {\n uv = a_texCoord;\n pos_w = a_position;\n vec2 forward = vec2(cc_matView[0][2], cc_matView[2][2]);\n float dist = abs(cc_cameraPos.y);\n vec2 scale = vec2(1.0 - a_texCoord.y, a_texCoord.y);\n pos_w.xz += scale * vec2((a_texCoord.x * 2.0 - 1.0) * dist * 0.002);\n vec4 pos = cc_matViewProj * vec4(pos_w, 1.0);\n pos.z += 0.00011;\n return pos;\n}\nvoid main() { gl_Position = vert(); }",
  328. "frag": "\nprecision mediump float;\nuniform highp vec4 cc_cameraPos;\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nvarying vec2 uv;\nvarying vec3 pos_w;\nvec4 frag () {\n float alpha = sqrt(0.5 - abs(uv.x - 0.5));\n float scale = abs(normalize(cc_cameraPos.xyz - pos_w).y);\n if (scale < 0.5) alpha *= max(0.3, scale / 0.5);\n return CCFragOutput(vec4(0.5, 0.5, 0.5, alpha));\n}\nvoid main() { gl_FragColor = frag(); }"
  329. },
  330. "builtins": {
  331. "globals": {
  332. "blocks": [
  333. {
  334. "name": "CCGlobal",
  335. "defines": []
  336. },
  337. {
  338. "name": "CCCamera",
  339. "defines": []
  340. }
  341. ],
  342. "samplerTextures": [],
  343. "buffers": [],
  344. "images": []
  345. },
  346. "locals": {
  347. "blocks": [],
  348. "samplerTextures": [],
  349. "buffers": [],
  350. "images": []
  351. },
  352. "statistics": {
  353. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 42,
  354. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 42
  355. }
  356. },
  357. "defines": [],
  358. "name": "internal/editor/grid-stroke|grid-vs:vert|grid-fs:frag"
  359. }
  360. ],
  361. "combinations": [],
  362. "hideInEditor": true
  363. }