144c3297-af63-49e8-b8ef-1cfa29b3be28.json 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {
  2. "__type__": "cc.EffectAsset",
  3. "_name": "builtin-2d-gray-sprite",
  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. },
  27. "program": "builtin-2d-gray-sprite|vs|fs"
  28. }
  29. ]
  30. }
  31. ],
  32. "shaders": [
  33. {
  34. "hash": 4278481454,
  35. "glsl3": {
  36. "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};\nin vec3 a_position;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nin vec4 a_color;\nout vec4 v_color;\nvoid main () {\n gl_Position = cc_matViewProj * vec4(a_position, 1);\n v_uv0 = a_uv0;\n v_color = a_color;\n}",
  37. "frag": "\nprecision highp float;\nuniform sampler2D texture;\nin mediump vec2 v_uv0;\nin vec4 v_color;\nvoid main () {\n vec4 color = v_color;\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 color.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n color.a *= texture_tmp.a;\n #else\n color *= texture_tmp;\n #endif\n float gray = 0.2126*color.r + 0.7152*color.g + 0.0722*color.b;\n gl_FragColor = vec4(gray, gray, gray, color.a);\n}"
  38. },
  39. "glsl1": {
  40. "vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nattribute vec4 a_color;\nvarying vec4 v_color;\nvoid main () {\n gl_Position = cc_matViewProj * vec4(a_position, 1);\n v_uv0 = a_uv0;\n v_color = a_color;\n}",
  41. "frag": "\nprecision highp float;\nuniform sampler2D texture;\nvarying mediump vec2 v_uv0;\nvarying vec4 v_color;\nvoid main () {\n vec4 color = v_color;\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 color.rgb *= (texture_tmp.rgb * texture_tmp.rgb);\n color.a *= texture_tmp.a;\n #else\n color *= texture_tmp;\n #endif\n float gray = 0.2126*color.r + 0.7152*color.g + 0.0722*color.b;\n gl_FragColor = vec4(gray, gray, gray, color.a);\n}"
  42. },
  43. "builtins": {
  44. "globals": {
  45. "blocks": [
  46. {
  47. "name": "CCGlobal",
  48. "defines": []
  49. }
  50. ],
  51. "samplers": []
  52. },
  53. "locals": {
  54. "blocks": [],
  55. "samplers": []
  56. }
  57. },
  58. "defines": [
  59. {
  60. "name": "CC_USE_ALPHA_ATLAS_texture",
  61. "type": "boolean",
  62. "defines": []
  63. },
  64. {
  65. "name": "INPUT_IS_GAMMA",
  66. "type": "boolean",
  67. "defines": []
  68. }
  69. ],
  70. "blocks": [],
  71. "samplers": [
  72. {
  73. "name": "texture",
  74. "type": 29,
  75. "count": 1,
  76. "defines": [],
  77. "binding": 30
  78. }
  79. ],
  80. "record": null,
  81. "name": "builtin-2d-gray-sprite|vs|fs"
  82. }
  83. ]
  84. }