cb/assets/effect/genie/genie.effect.meta

18 lines
3.9 KiB
Plaintext

{
"ver": "1.0.27",
"uuid": "3ce2780e-89e8-4262-ba0f-80fdfd58a026",
"importer": "effect",
"compiledShaders": [
{
"glsl1": {
"vert": "\nprecision highp float;\nuniform mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute vec2 a_uv0;\nattribute vec4 a_color;\nuniform vec2 u_targetPos;\nuniform float u_progress;\nuniform float u_bendStrength;\nuniform float u_shrinkWidth;\nvarying vec2 v_uv;\nvarying vec4 v_color;\nvec2 quadBezier(vec2 p0, vec2 p1, vec2 p2, float t) {\n float u = 1.0 - t;\n return u * u * p0 + 2.0 * u * t * p1 + t * t * p2;\n}\nvec4 vs() {\n vec2 pos = a_position.xy;\n v_uv = a_uv0;\n v_color = a_color;\n float p = clamp(u_progress, 0.0, 1.0);\n float uvY = a_uv0.y;\n float uvX = a_uv0.x;\n vec2 topTarget = mix(pos, u_targetPos, p * 0.6);\n vec2 bottomTarget = u_targetPos;\n float bendDown = -80.0 * u_bendStrength * (1.0 - p);\n vec2 bottomControl = mix(pos, u_targetPos, 0.5) + vec2(0.0, bendDown);\n vec2 rowPos = quadBezier(topTarget, bottomControl, bottomTarget, uvY * p);\n float widthScale = 1.0 - (1.0 - u_shrinkWidth) * p * uvY;\n vec2 center = mix(topTarget, bottomTarget, uvY);\n rowPos.x = center.x + (rowPos.x - center.x) * widthScale;\n float bulge = -sin(uvY * 3.14159) * 30.0 * u_bendStrength * (1.0 - p);\n rowPos.y += bulge * sin((uvX - 0.5) * 3.14159);\n float depth = 1.0 - p * 0.8 * uvY;\n rowPos = mix(rowPos, u_targetPos, (1.0 - depth) * uvY * 1.0);\n if (p > 0.8) {\n float finalT = (p - 0.8) / 0.2;\n rowPos = mix(rowPos, u_targetPos, finalT * 0.8);\n }\n return cc_matViewProj * vec4(rowPos, 0.0, 1.0);\n}\nvoid main() { gl_Position = vs(); }",
"frag": "\nprecision highp float;\nvarying vec2 v_uv;\nvarying vec4 v_color;\nuniform sampler2D texture;\nvec4 fs() {\n return texture2D(texture, v_uv) * v_color;\n}\nvoid main() { gl_FragColor = fs(); }"
},
"glsl3": {
"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 vec2 a_uv0;\nin vec4 a_color;\nuniform MyConstants {\n vec2 u_targetPos;\n float u_progress;\n float u_bendStrength;\n float u_shrinkWidth;\n};\nout vec2 v_uv;\nout vec4 v_color;\nvec2 quadBezier(vec2 p0, vec2 p1, vec2 p2, float t) {\n float u = 1.0 - t;\n return u * u * p0 + 2.0 * u * t * p1 + t * t * p2;\n}\nvec4 vs() {\n vec2 pos = a_position.xy;\n v_uv = a_uv0;\n v_color = a_color;\n float p = clamp(u_progress, 0.0, 1.0);\n float uvY = a_uv0.y;\n float uvX = a_uv0.x;\n vec2 topTarget = mix(pos, u_targetPos, p * 0.6);\n vec2 bottomTarget = u_targetPos;\n float bendDown = -80.0 * u_bendStrength * (1.0 - p);\n vec2 bottomControl = mix(pos, u_targetPos, 0.5) + vec2(0.0, bendDown);\n vec2 rowPos = quadBezier(topTarget, bottomControl, bottomTarget, uvY * p);\n float widthScale = 1.0 - (1.0 - u_shrinkWidth) * p * uvY;\n vec2 center = mix(topTarget, bottomTarget, uvY);\n rowPos.x = center.x + (rowPos.x - center.x) * widthScale;\n float bulge = -sin(uvY * 3.14159) * 30.0 * u_bendStrength * (1.0 - p);\n rowPos.y += bulge * sin((uvX - 0.5) * 3.14159);\n float depth = 1.0 - p * 0.8 * uvY;\n rowPos = mix(rowPos, u_targetPos, (1.0 - depth) * uvY * 1.0);\n if (p > 0.8) {\n float finalT = (p - 0.8) / 0.2;\n rowPos = mix(rowPos, u_targetPos, finalT * 0.8);\n }\n return cc_matViewProj * vec4(rowPos, 0.0, 1.0);\n}\nvoid main() { gl_Position = vs(); }",
"frag": "\nprecision highp float;\nin vec2 v_uv;\nin vec4 v_color;\nuniform sampler2D texture;\nvec4 fs() {\n return texture(texture, v_uv) * v_color;\n}\nout vec4 cc_FragColor;\nvoid main() { cc_FragColor = fs(); }"
}
}
],
"subMetas": {}
}