e4e4cb19-8dd2-450d-ad20-1a818263b8d3.json 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "internal/editor/light",
  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/light|light-vs:vert|light-fs:frag",
  25. "depthStencilState": {
  26. "depthTest": true,
  27. "depthWrite": false
  28. }
  29. }
  30. ]
  31. }
  32. ],
  33. "shaders": [
  34. {
  35. "blocks": [
  36. {
  37. "name": "Constant",
  38. "members": [
  39. {
  40. "name": "mainColor",
  41. "type": 16,
  42. "count": 1
  43. },
  44. {
  45. "name": "intensitySize",
  46. "type": 16,
  47. "count": 1
  48. }
  49. ],
  50. "defines": [],
  51. "stageFlags": 16,
  52. "binding": 0
  53. }
  54. ],
  55. "samplerTextures": [],
  56. "samplers": [],
  57. "textures": [],
  58. "buffers": [],
  59. "images": [],
  60. "subpassInputs": [],
  61. "attributes": [
  62. {
  63. "name": "a_position",
  64. "defines": [],
  65. "format": 32,
  66. "location": 0
  67. },
  68. {
  69. "name": "a_texCoord",
  70. "defines": [],
  71. "format": 21,
  72. "location": 1
  73. }
  74. ],
  75. "varyings": [
  76. {
  77. "name": "v_uv",
  78. "type": 14,
  79. "count": 1,
  80. "defines": [],
  81. "stageFlags": 17,
  82. "location": 0
  83. }
  84. ],
  85. "fragColors": [
  86. {
  87. "name": "cc_FragColor",
  88. "typename": "vec4",
  89. "type": 16,
  90. "count": 1,
  91. "defines": [],
  92. "stageFlags": 16,
  93. "location": 0
  94. }
  95. ],
  96. "descriptors": [
  97. {
  98. "rate": 0,
  99. "blocks": [
  100. {
  101. "tags": {
  102. "builtin": "local"
  103. },
  104. "name": "CCLocal",
  105. "members": [
  106. {
  107. "name": "cc_matWorld",
  108. "typename": "mat4",
  109. "type": 25,
  110. "count": 1,
  111. "precision": "highp "
  112. },
  113. {
  114. "name": "cc_matWorldIT",
  115. "typename": "mat4",
  116. "type": 25,
  117. "count": 1,
  118. "precision": "highp "
  119. },
  120. {
  121. "name": "cc_lightingMapUVParam",
  122. "typename": "vec4",
  123. "type": 16,
  124. "count": 1,
  125. "precision": "highp "
  126. },
  127. {
  128. "name": "cc_localShadowBias",
  129. "typename": "vec4",
  130. "type": 16,
  131. "count": 1,
  132. "precision": "highp "
  133. },
  134. {
  135. "name": "cc_reflectionProbeData1",
  136. "typename": "vec4",
  137. "type": 16,
  138. "count": 1,
  139. "precision": "highp "
  140. },
  141. {
  142. "name": "cc_reflectionProbeData2",
  143. "typename": "vec4",
  144. "type": 16,
  145. "count": 1,
  146. "precision": "highp "
  147. },
  148. {
  149. "name": "cc_reflectionProbeBlendData1",
  150. "typename": "vec4",
  151. "type": 16,
  152. "count": 1,
  153. "precision": "highp "
  154. },
  155. {
  156. "name": "cc_reflectionProbeBlendData2",
  157. "typename": "vec4",
  158. "type": 16,
  159. "count": 1,
  160. "precision": "highp "
  161. }
  162. ],
  163. "defines": [],
  164. "stageFlags": 1
  165. }
  166. ],
  167. "samplerTextures": [],
  168. "samplers": [],
  169. "textures": [],
  170. "buffers": [],
  171. "images": [],
  172. "subpassInputs": []
  173. },
  174. {
  175. "rate": 1,
  176. "blocks": [
  177. {
  178. "name": "Constant",
  179. "members": [
  180. {
  181. "name": "mainColor",
  182. "type": 16,
  183. "count": 1
  184. },
  185. {
  186. "name": "intensitySize",
  187. "type": 16,
  188. "count": 1
  189. }
  190. ],
  191. "defines": [],
  192. "stageFlags": 16,
  193. "binding": 0
  194. }
  195. ],
  196. "samplerTextures": [],
  197. "samplers": [],
  198. "textures": [],
  199. "buffers": [],
  200. "images": [],
  201. "subpassInputs": []
  202. },
  203. {
  204. "rate": 2,
  205. "blocks": [],
  206. "samplerTextures": [],
  207. "samplers": [],
  208. "textures": [],
  209. "buffers": [],
  210. "images": [],
  211. "subpassInputs": []
  212. },
  213. {
  214. "rate": 3,
  215. "blocks": [
  216. {
  217. "tags": {
  218. "builtin": "global"
  219. },
  220. "name": "CCGlobal",
  221. "members": [
  222. {
  223. "name": "cc_time",
  224. "typename": "vec4",
  225. "type": 16,
  226. "count": 1,
  227. "precision": "highp "
  228. },
  229. {
  230. "name": "cc_screenSize",
  231. "typename": "vec4",
  232. "type": 16,
  233. "count": 1,
  234. "precision": "mediump "
  235. },
  236. {
  237. "name": "cc_nativeSize",
  238. "typename": "vec4",
  239. "type": 16,
  240. "count": 1,
  241. "precision": "mediump "
  242. },
  243. {
  244. "name": "cc_probeInfo",
  245. "typename": "vec4",
  246. "type": 16,
  247. "count": 1,
  248. "precision": "mediump "
  249. },
  250. {
  251. "name": "cc_debug_view_mode",
  252. "typename": "vec4",
  253. "type": 16,
  254. "count": 1,
  255. "precision": "mediump "
  256. }
  257. ],
  258. "defines": [],
  259. "stageFlags": 17
  260. },
  261. {
  262. "tags": {
  263. "builtin": "global"
  264. },
  265. "name": "CCCamera",
  266. "members": [
  267. {
  268. "name": "cc_matView",
  269. "typename": "mat4",
  270. "type": 25,
  271. "count": 1,
  272. "precision": "highp "
  273. },
  274. {
  275. "name": "cc_matViewInv",
  276. "typename": "mat4",
  277. "type": 25,
  278. "count": 1,
  279. "precision": "highp "
  280. },
  281. {
  282. "name": "cc_matProj",
  283. "typename": "mat4",
  284. "type": 25,
  285. "count": 1,
  286. "precision": "highp "
  287. },
  288. {
  289. "name": "cc_matProjInv",
  290. "typename": "mat4",
  291. "type": 25,
  292. "count": 1,
  293. "precision": "highp "
  294. },
  295. {
  296. "name": "cc_matViewProj",
  297. "typename": "mat4",
  298. "type": 25,
  299. "count": 1,
  300. "precision": "highp "
  301. },
  302. {
  303. "name": "cc_matViewProjInv",
  304. "typename": "mat4",
  305. "type": 25,
  306. "count": 1,
  307. "precision": "highp "
  308. },
  309. {
  310. "name": "cc_cameraPos",
  311. "typename": "vec4",
  312. "type": 16,
  313. "count": 1,
  314. "precision": "highp "
  315. },
  316. {
  317. "name": "cc_surfaceTransform",
  318. "typename": "vec4",
  319. "type": 16,
  320. "count": 1,
  321. "precision": "mediump "
  322. },
  323. {
  324. "name": "cc_screenScale",
  325. "typename": "vec4",
  326. "type": 16,
  327. "count": 1,
  328. "precision": "mediump "
  329. },
  330. {
  331. "name": "cc_exposure",
  332. "typename": "vec4",
  333. "type": 16,
  334. "count": 1,
  335. "precision": "mediump "
  336. },
  337. {
  338. "name": "cc_mainLitDir",
  339. "typename": "vec4",
  340. "type": 16,
  341. "count": 1,
  342. "precision": "mediump "
  343. },
  344. {
  345. "name": "cc_mainLitColor",
  346. "typename": "vec4",
  347. "type": 16,
  348. "count": 1,
  349. "precision": "mediump "
  350. },
  351. {
  352. "name": "cc_ambientSky",
  353. "typename": "vec4",
  354. "type": 16,
  355. "count": 1,
  356. "precision": "mediump "
  357. },
  358. {
  359. "name": "cc_ambientGround",
  360. "typename": "vec4",
  361. "type": 16,
  362. "count": 1,
  363. "precision": "mediump "
  364. },
  365. {
  366. "name": "cc_fogColor",
  367. "typename": "vec4",
  368. "type": 16,
  369. "count": 1,
  370. "precision": "mediump "
  371. },
  372. {
  373. "name": "cc_fogBase",
  374. "typename": "vec4",
  375. "type": 16,
  376. "count": 1,
  377. "precision": "mediump "
  378. },
  379. {
  380. "name": "cc_fogAdd",
  381. "typename": "vec4",
  382. "type": 16,
  383. "count": 1,
  384. "precision": "mediump "
  385. },
  386. {
  387. "name": "cc_nearFar",
  388. "typename": "vec4",
  389. "type": 16,
  390. "count": 1,
  391. "precision": "mediump "
  392. },
  393. {
  394. "name": "cc_viewPort",
  395. "typename": "vec4",
  396. "type": 16,
  397. "count": 1,
  398. "precision": "mediump "
  399. }
  400. ],
  401. "defines": [],
  402. "stageFlags": 17
  403. }
  404. ],
  405. "samplerTextures": [],
  406. "samplers": [],
  407. "textures": [],
  408. "buffers": [],
  409. "images": [],
  410. "subpassInputs": []
  411. }
  412. ],
  413. "hash": 1133658448,
  414. "glsl4": {
  415. "vert": "\nprecision mediump float;\nlayout(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};\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nlayout(location = 0) in vec3 a_position;\nlayout(location = 1) in vec2 a_texCoord;\nlayout(location = 0) out vec2 v_uv;\nvec4 vert () {\n v_uv = a_texCoord;\n return cc_matViewProj * cc_matWorld * vec4(a_position, 1.0);\n}\nvoid main() { gl_Position = vert(); }",
  416. "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(set = 1, binding = 0) uniform Constant {\n vec4 mainColor;\n vec4 intensitySize;\n};\nlayout(location = 0) in vec2 v_uv;\nfloat sphere(vec3 d, vec3 p) {\n return smoothstep(1.0 - intensitySize.y, 1.0, 1.0 / length(cross(d, p)));\n}\nvec4 frag () {\n vec2 uv = v_uv - 0.5;\n vec3 R = normalize(vec3(1.0, uv));\n return CCFragOutput(vec4(mainColor.rgb, mix(sphere(R, vec3(5.0, 0.0, 0.0)), 1.0, dot(uv, uv) < 0.0625 ? 1.0 : 0.0)));\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  417. },
  418. "glsl3": {
  419. "vert": "\nprecision mediump float;\nlayout(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};\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\n#define QUATER_PI 0.78539816340\n#define HALF_PI 1.57079632679\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI4 12.5663706144\n#define INV_QUATER_PI 1.27323954474\n#define INV_HALF_PI 0.63661977237\n#define INV_PI 0.31830988618\n#define INV_PI2 0.15915494309\n#define INV_PI4 0.07957747155\n#define EPSILON 1e-6\n#define EPSILON_LOWP 1e-4\n#define LOG2 1.442695\n#define EXP_VALUE 2.71828183\n#define FP_MAX 65504.0\n#define FP_SCALE 0.0009765625\n#define FP_SCALE_INV 1024.0\n#define GRAY_VECTOR vec3(0.299, 0.587, 0.114)\n#define LIGHT_MAP_TYPE_DISABLED 0\n#define LIGHT_MAP_TYPE_ALL_IN_ONE 1\n#define LIGHT_MAP_TYPE_INDIRECT_OCCLUSION 2\n#define REFLECTION_PROBE_TYPE_NONE 0\n#define REFLECTION_PROBE_TYPE_CUBE 1\n#define REFLECTION_PROBE_TYPE_PLANAR 2\n#define REFLECTION_PROBE_TYPE_BLEND 3\n#define REFLECTION_PROBE_TYPE_BLEND_AND_SKYBOX 4\n#define LIGHT_TYPE_DIRECTIONAL 0.0\n#define LIGHT_TYPE_SPHERE 1.0\n#define LIGHT_TYPE_SPOT 2.0\n#define LIGHT_TYPE_POINT 3.0\n#define LIGHT_TYPE_RANGED_DIRECTIONAL 4.0\n#define IS_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_DIRECTIONAL)) < EPSILON_LOWP)\n#define IS_SPHERE_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPHERE)) < EPSILON_LOWP)\n#define IS_SPOT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_SPOT)) < EPSILON_LOWP)\n#define IS_POINT_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_POINT)) < EPSILON_LOWP)\n#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) (abs(float(light_type) - float(LIGHT_TYPE_RANGED_DIRECTIONAL)) < EPSILON_LOWP)\n#define TONE_MAPPING_ACES 0\n#define TONE_MAPPING_LINEAR 1\n#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0\n#ifndef CC_SURFACES_DEBUG_VIEW_SINGLE\n #define CC_SURFACES_DEBUG_VIEW_SINGLE 1\n#endif\n#ifndef CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC\n #define CC_SURFACES_DEBUG_VIEW_COMPOSITE_AND_MISC 2\n#endif\nin vec3 a_position;\nin vec2 a_texCoord;\nout vec2 v_uv;\nvec4 vert () {\n v_uv = a_texCoord;\n return cc_matViewProj * cc_matWorld * vec4(a_position, 1.0);\n}\nvoid main() { gl_Position = vert(); }",
  420. "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}\nlayout(std140) uniform Constant {\n vec4 mainColor;\n vec4 intensitySize;\n};\nin vec2 v_uv;\nfloat sphere(vec3 d, vec3 p) {\n return smoothstep(1.0 - intensitySize.y, 1.0, 1.0 / length(cross(d, p)));\n}\nvec4 frag () {\n vec2 uv = v_uv - 0.5;\n vec3 R = normalize(vec3(1.0, uv));\n return CCFragOutput(vec4(mainColor.rgb, mix(sphere(R, vec3(5.0, 0.0, 0.0)), 1.0, dot(uv, uv) < 0.0625 ? 1.0 : 0.0)));\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = frag(); }"
  421. },
  422. "glsl1": {
  423. "vert": "\nprecision mediump float;\nuniform highp mat4 cc_matWorld;\nuniform highp mat4 cc_matViewProj;\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\nattribute vec3 a_position;\nattribute vec2 a_texCoord;\nvarying vec2 v_uv;\nvec4 vert () {\n v_uv = a_texCoord;\n return cc_matViewProj * cc_matWorld * vec4(a_position, 1.0);\n}\nvoid main() { gl_Position = vert(); }",
  424. "frag": "\nprecision mediump float;\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\n uniform vec4 mainColor;\n uniform vec4 intensitySize;\nvarying vec2 v_uv;\nfloat sphere(vec3 d, vec3 p) {\n return smoothstep(1.0 - intensitySize.y, 1.0, 1.0 / length(cross(d, p)));\n}\nvec4 frag () {\n vec2 uv = v_uv - 0.5;\n vec3 R = normalize(vec3(1.0, uv));\n return CCFragOutput(vec4(mainColor.rgb, mix(sphere(R, vec3(5.0, 0.0, 0.0)), 1.0, dot(uv, uv) < 0.0625 ? 1.0 : 0.0)));\n}\nvoid main() { gl_FragColor = frag(); }"
  425. },
  426. "builtins": {
  427. "globals": {
  428. "blocks": [
  429. {
  430. "name": "CCGlobal",
  431. "defines": []
  432. },
  433. {
  434. "name": "CCCamera",
  435. "defines": []
  436. }
  437. ],
  438. "samplerTextures": [],
  439. "buffers": [],
  440. "images": []
  441. },
  442. "locals": {
  443. "blocks": [
  444. {
  445. "name": "CCLocal",
  446. "defines": []
  447. }
  448. ],
  449. "samplerTextures": [],
  450. "buffers": [],
  451. "images": []
  452. },
  453. "statistics": {
  454. "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 56,
  455. "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 44
  456. }
  457. },
  458. "defines": [],
  459. "name": "internal/editor/light|light-vs:vert|light-fs:frag"
  460. }
  461. ],
  462. "combinations": [],
  463. "hideInEditor": true
  464. }