44d938b3-1a8f-4091-a0de-1e6115698652.json 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "fire",
  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. "curTex": {
  33. "value": [
  34. 1
  35. ],
  36. "type": 13
  37. },
  38. "totalTex": {
  39. "value": [
  40. 4,
  41. 1,
  42. 4,
  43. 0
  44. ],
  45. "type": 16
  46. }
  47. },
  48. "program": "fire|vs|fs"
  49. }
  50. ]
  51. }
  52. ],
  53. "shaders": [
  54. {
  55. "hash": 1767528276,
  56. "glsl3": {
  57. "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}",
  58. "frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\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};\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nuniform Props{\n vec4 totalTex;\n float curTex;\n};\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n vec4 texture_tmp = texture(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n #endif\n float numY = ceil(curTex / totalTex.z);\n float numX = ceil(curTex - totalTex.z * (numY - 1.0));\n vec2 uv = v_uv0;\n uv.x = v_uv0.x * 1.0 / totalTex.z + (numX - 1.0) * 1.0 / totalTex.z;\n uv.y = v_uv0.y * 1.0 / totalTex.y + (numY - 1.0) * 1.0 / totalTex.y;\n o = texture2D(texture, uv);\n o *= v_color;\n gl_FragColor = o;\n}"
  59. },
  60. "glsl1": {
  61. "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}",
  62. "frag": "\nprecision highp float;\n#if USE_ALPHA_TEST\n#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nuniform vec4 totalTex;\nuniform float curTex;\nvoid main () {\n vec4 o = vec4(1, 1, 1, 1);\n #if USE_TEXTURE\n vec4 texture_tmp = texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_texture\n texture_tmp.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\n #endif\n #if INPUT_IS_GAMMA\n o.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n o.a *= texture_tmp.a;\n #else\n o *= texture_tmp;\n #endif\n #endif\n float numY = ceil(curTex / totalTex.z);\n float numX = ceil(curTex - totalTex.z * (numY - 1.0));\n vec2 uv = v_uv0;\n uv.x = v_uv0.x * 1.0 / totalTex.z + (numX - 1.0) * 1.0 / totalTex.z;\n uv.y = v_uv0.y * 1.0 / totalTex.y + (numY - 1.0) * 1.0 / totalTex.y;\n o = texture2D(texture, uv);\n o *= v_color;\n gl_FragColor = o;\n}"
  63. },
  64. "builtins": {
  65. "globals": {
  66. "blocks": [
  67. {
  68. "name": "CCGlobal",
  69. "defines": []
  70. }
  71. ],
  72. "samplers": []
  73. },
  74. "locals": {
  75. "blocks": [
  76. {
  77. "name": "CCLocal",
  78. "defines": []
  79. }
  80. ],
  81. "samplers": []
  82. }
  83. },
  84. "defines": [
  85. {
  86. "name": "USE_TEXTURE",
  87. "type": "boolean",
  88. "defines": []
  89. },
  90. {
  91. "name": "CC_USE_MODEL",
  92. "type": "boolean",
  93. "defines": []
  94. },
  95. {
  96. "name": "USE_ALPHA_TEST",
  97. "type": "boolean",
  98. "defines": []
  99. },
  100. {
  101. "name": "CC_USE_ALPHA_ATLAS_texture",
  102. "type": "boolean",
  103. "defines": [
  104. "USE_TEXTURE"
  105. ]
  106. },
  107. {
  108. "name": "INPUT_IS_GAMMA",
  109. "type": "boolean",
  110. "defines": [
  111. "USE_TEXTURE"
  112. ]
  113. }
  114. ],
  115. "blocks": [
  116. {
  117. "name": "ALPHA_TEST",
  118. "members": [
  119. {
  120. "name": "alphaThreshold",
  121. "type": 13,
  122. "count": 1
  123. }
  124. ],
  125. "defines": [
  126. "USE_ALPHA_TEST"
  127. ],
  128. "binding": 0
  129. },
  130. {
  131. "name": "Props",
  132. "members": [
  133. {
  134. "name": "totalTex",
  135. "type": 16,
  136. "count": 1
  137. },
  138. {
  139. "name": "curTex",
  140. "type": 13,
  141. "count": 1
  142. }
  143. ],
  144. "defines": [],
  145. "binding": 1
  146. }
  147. ],
  148. "samplers": [
  149. {
  150. "name": "texture",
  151. "type": 29,
  152. "count": 1,
  153. "defines": [
  154. "USE_TEXTURE"
  155. ],
  156. "binding": 30
  157. }
  158. ],
  159. "record": null,
  160. "name": "fire|vs|fs"
  161. }
  162. ]
  163. }