7a085960-f456-4c67-9f29-01acbec22131.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "bgScroll",
  4. "_objFlags": 0,
  5. "_native": "",
  6. "properties": null,
  7. "techniques": [
  8. {
  9. "passes": [
  10. {
  11. "blendState": {
  12. "targets": [
  13. {
  14. "blend": true
  15. }
  16. ]
  17. },
  18. "rasterizerState": {
  19. "cullMode": 0
  20. },
  21. "properties": {
  22. "texture": {
  23. "value": "white",
  24. "type": 29
  25. },
  26. "alphaThreshold": {
  27. "value": [
  28. 0.5
  29. ],
  30. "type": 13
  31. },
  32. "time": {
  33. "value": [
  34. 0
  35. ],
  36. "type": 13
  37. },
  38. "speed": {
  39. "value": [
  40. 1
  41. ],
  42. "type": 13
  43. }
  44. },
  45. "program": "bgScroll|vs|fs"
  46. }
  47. ]
  48. }
  49. ],
  50. "shaders": [
  51. {
  52. "hash": 3056901385,
  53. "glsl3": {
  54. "vert": "\nprecision highp float;\nuniform CCGlobal {\n mat4 cc_matView;\n mat4 cc_matViewInv;\n mat4 cc_matProj;\n mat4 cc_matProjInv;\n mat4 cc_matViewProj;\n mat4 cc_matViewProjInv;\n vec4 cc_cameraPos;\n vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
  55. "frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nuniform Param {\n float time;\n float speed;\n};\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n float offset = fract( time* speed + v_uv0.y);\n o *= texture(texture, vec2(v_uv0.x, offset));\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
  56. },
  57. "glsl1": {
  58. "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
  59. "frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform float alphaThreshold;\n#endif\nvoid ALPHA_TEST (in vec4 color) {\n #if USE_ALPHA_TEST\n if (color.a < alphaThreshold) discard;\n #endif\n}\nvoid ALPHA_TEST (in float alpha) {\n #if USE_ALPHA_TEST\n if (alpha < alphaThreshold) discard;\n #endif\n}\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nuniform float time;\nuniform float speed;\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n float offset = fract( time* speed + v_uv0.y);\n o *= texture2D(texture, vec2(v_uv0.x, offset));\n o *= v_color;\n ALPHA_TEST(o);\n gl_FragColor = o;\n}"
  60. },
  61. "builtins": {
  62. "globals": {
  63. "blocks": [
  64. {
  65. "name": "CCGlobal",
  66. "defines": []
  67. }
  68. ],
  69. "samplers": []
  70. },
  71. "locals": {
  72. "blocks": [
  73. {
  74. "name": "CCLocal",
  75. "defines": []
  76. }
  77. ],
  78. "samplers": []
  79. }
  80. },
  81. "defines": [
  82. {
  83. "name": "USE_TEXTURE",
  84. "type": "boolean",
  85. "defines": []
  86. },
  87. {
  88. "name": "CC_USE_MODEL",
  89. "type": "boolean",
  90. "defines": []
  91. },
  92. {
  93. "name": "USE_ALPHA_TEST",
  94. "type": "boolean",
  95. "defines": []
  96. }
  97. ],
  98. "blocks": [
  99. {
  100. "name": "ALPHA_TEST",
  101. "members": [
  102. {
  103. "name": "alphaThreshold",
  104. "type": 13,
  105. "count": 1
  106. }
  107. ],
  108. "defines": [
  109. "USE_ALPHA_TEST"
  110. ],
  111. "binding": 0
  112. },
  113. {
  114. "name": "Param",
  115. "members": [
  116. {
  117. "name": "time",
  118. "type": 13,
  119. "count": 1
  120. },
  121. {
  122. "name": "speed",
  123. "type": 13,
  124. "count": 1
  125. }
  126. ],
  127. "defines": [],
  128. "binding": 1
  129. }
  130. ],
  131. "samplers": [
  132. {
  133. "name": "texture",
  134. "type": 29,
  135. "count": 1,
  136. "defines": [
  137. "USE_TEXTURE"
  138. ],
  139. "binding": 30
  140. }
  141. ],
  142. "record": null,
  143. "name": "bgScroll|vs|fs"
  144. }
  145. ]
  146. }