17 lines
2.3 KiB
Plaintext
17 lines
2.3 KiB
Plaintext
{
|
|
"ver": "1.0.25",
|
|
"uuid": "14e64f7c-87c8-459a-ad37-6c773ceea4e6",
|
|
"compiledShaders": [
|
|
{
|
|
"glsl1": {
|
|
"vert": "uniform mat4 cc_matViewProj;\nprecision highp float;\nattribute vec3 a_position;\nattribute vec2 a_uv0;\nvarying vec2 uv0;\nvoid main () {\n vec4 pos = cc_matViewProj * vec4(a_position, 1);\n gl_Position = pos;\n uv0 = a_uv0;\n}",
|
|
"frag": "\nprecision mediump float;\nvarying vec2 uv0;\nuniform sampler2D texture;\nuniform vec2 u_resolution;\nconst float blurRadius = 7.0;\nvoid main()\n{\n vec2 unit = 1.0 / u_resolution;\n vec3 sumColor = vec3(0.0, 0.0, 0.0);\n float count = 0.0;\n vec4 col = vec4(0.0);\n for(float fy = -blurRadius; fy <= blurRadius; ++fy)\n {\n for(float fx = -blurRadius; fx <= blurRadius; ++fx)\n {\n float weight = (blurRadius - abs(fx)) * (blurRadius - abs(fy));\n col += texture2D(texture, uv0 + vec2(fx * unit.x, fy * unit.y)) * weight;\n count += weight;\n }\n }\n col.a = texture2D(texture, uv0).a;\n gl_FragColor = vec4(col.rgb / count, col.a);\n}"
|
|
},
|
|
"glsl3": {
|
|
"vert": "uniform 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};\nprecision highp float;\nin vec3 a_position;\nin vec2 a_uv0;\nout vec2 uv0;\nvoid main () {\n vec4 pos = cc_matViewProj * vec4(a_position, 1);\n gl_Position = pos;\n uv0 = a_uv0;\n}",
|
|
"frag": "\nprecision mediump float;\nin vec2 uv0;\nuniform sampler2D texture;\nuniform ARGS {\n vec2 u_resolution;\n float strength;\n};\nconst float blurRadius = 7.0;\nvoid main()\n{\n vec2 unit = 1.0 / u_resolution;\n vec3 sumColor = vec3(0.0, 0.0, 0.0);\n float count = 0.0;\n vec4 col = vec4(0.0);\n for(float fy = -blurRadius; fy <= blurRadius; ++fy)\n {\n for(float fx = -blurRadius; fx <= blurRadius; ++fx)\n {\n float weight = (blurRadius - abs(fx)) * (blurRadius - abs(fy));\n col += texture2D(texture, uv0 + vec2(fx * unit.x, fy * unit.y)) * weight;\n count += weight;\n }\n }\n col.a = texture2D(texture, uv0).a;\n gl_FragColor = vec4(col.rgb / count, col.a);\n}"
|
|
}
|
|
}
|
|
],
|
|
"subMetas": {}
|
|
} |