1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
| {
| "__type__": "cc.EffectAsset",
| "_name": "builtin-2d-gray-sprite",
| "_objFlags": 0,
| "_native": "",
| "properties": null,
| "techniques": [
| {
| "passes": [
| {
| "blendState": {
| "targets": [
| {
| "blend": true
| }
| ]
| },
| "rasterizerState": {
| "cullMode": 0
| },
| "properties": {
| "texture": {
| "value": "white",
| "type": 29
| }
| },
| "program": "builtin-2d-gray-sprite|vs|fs"
| }
| ]
| }
| ],
| "shaders": [
| {
| "hash": 528178564,
| "glsl3": {
| "vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\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}",
| "frag": "\nprecision highp float;\nuniform sampler2D texture;\nin mediump vec2 v_uv0;\nin vec4 v_color;\nvoid main () {\n vec4 color = v_color * texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n color.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\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}"
| },
| "glsl1": {
| "vert": "\nprecision highp float;\nuniform mediump 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}",
| "frag": "\nprecision highp float;\nuniform sampler2D texture;\nvarying mediump vec2 v_uv0;\nvarying vec4 v_color;\nvoid main () {\n vec4 color = v_color * texture2D(texture, v_uv0);\n #if CC_USE_ALPHA_ATLAS_TEXTURE\n color.a *= texture2D(texture, v_uv0 + vec2(0, 0.5)).r;\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}"
| },
| "builtins": {
| "globals": {
| "blocks": [
| {
| "name": "CCGlobal",
| "defines": []
| }
| ],
| "samplers": []
| },
| "locals": {
| "blocks": [],
| "samplers": []
| }
| },
| "defines": [
| {
| "name": "CC_USE_ALPHA_ATLAS_TEXTURE",
| "type": "boolean",
| "defines": []
| }
| ],
| "blocks": [],
| "samplers": [
| {
| "name": "texture",
| "type": 29,
| "count": 1,
| "defines": [],
| "binding": 30
| }
| ],
| "record": null,
| "name": "builtin-2d-gray-sprite|vs|fs"
| }
| ]
| }
|
|