123456789101112131415161718 |
- {
- "ver": "1.0.27",
- "uuid": "d3bb757c-c1ae-4965-a2f5-88b94c86e04e",
- "importer": "effect",
- "compiledShaders": [
- {
- "glsl1": {
- "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}",
- "frag": "\nprecision highp float;\nuniform vec4 cc_time;\n#if USE_ALPHA_TEST\n#endif\nvarying vec4 v_color;\n#if USE_TEXTURE\nvarying vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nconst vec2 iResolution = vec2(0.5, 0.5);\nfloat hash21(vec2 x) {\n return fract(cos(mod(dot(x, vec2(13.9898, 8.141)), 3.14)) * 43758.5453);\n}\nvec2 hash22(vec2 uv) {\n uv = vec2(dot(uv, vec2(127.1,311.7)),\n dot(uv, vec2(269.5,183.3)));\n return 2.0 * fract(sin(uv) * 43758.5453123) - 1.0;\n}\nfloat perlinNoise(vec2 uv) {\n vec2 iuv = floor(uv);\n vec2 fuv = fract(uv);\n vec2 blur = smoothstep(.0, 1., fuv);\n vec2 bl = vec2(.0, .0);\n vec2 br = vec2(1., .0);\n vec2 tl = vec2(.0, 1.);\n vec2 tr = vec2(1., 1.);\n vec2 bln = hash22(iuv + bl);\n vec2 brn = hash22(iuv + br);\n vec2 tln = hash22(iuv + tl);\n vec2 trn = hash22(iuv + tr);\n float b = mix(dot(bln, fuv - bl), dot(brn, fuv - br), blur.x);\n float t = mix(dot(tln, fuv - tl), dot(trn, fuv - tr), blur.x);\n float c = mix(b, t, blur.y);\n float rs = 2.0 * texture2D(texture, vec2(uv.x,0.75)).r;\n return (c * rs);\n}\nfloat fbm(vec2 uv, int octaves) {\n float value = .0;\n float amplitude = .5;\n float freq = 2.0;\n for(int i = 0; i < 30; i++)\n {\n value += perlinNoise(uv) * amplitude;\n uv *= freq;\n amplitude *= .5;\n }\n return value;\n}\nmat2 R(float q) {\n return mat2(cos(q), sin(q), -sin(q), cos(q));\n}\nvoid main () {\n vec2 uvv = (v_uv0 - 0.5) / iResolution.y;\n vec3 col1, col2;\n uvv.xy += fbm(uvv.yx + cc_time.x * 0.5, 30);\n float dist1 = abs(uvv.y);\n col1 = vec3(1.0) * mix(0.0, 0.05, hash21(vec2(sin(cc_time.x)))) / dist1;\n vec4 o = vec4(0.0);\n vec2 uv = v_uv0;\n float t = cc_time.x, e, s, g, k = 0.01;\n for(float i = 0.0; i < 100.0; i++)\n {\n g += max(k, e * 0.2);\n vec3 p = vec3((uv - 0.6) / iResolution.y * g + iResolution / iResolution.y * R(t + g * 0.5) * 0.5, g + t / 0.3);\n e = 0.3 - dot(p.xy, p.xy);\n for (float s = 2.0; s < 100.0; s ++) {\n p.yz *= R(s);\n e += abs(dot(sin(p * s + t * s * 0.2) / s, p - p + 1.0));\n }\n o += o.w * min(e * o + (sin(vec4(1.0, 2.0, 3.0, 1.0) - p.z * 0.3) * 0.6 - 0.4), k) * k;\n }\n vec3 finalColor = mix(o.rgb, col1, 0.3);\n finalColor *= min(1.0, 1.0 + cos(0.15 * t)) + min(1.0, max(0.0, -2.0 - 4.0 * cos(0.15 * t))) * smoothstep(0.85, 1.0, fract(sin(t) * 43758.5453));\n gl_FragColor = vec4(finalColor, 1.0);\n}"
- },
- "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 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}",
- "frag": "\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};\n#if USE_ALPHA_TEST\n uniform ALPHA_TEST {\n float alphaThreshold;\n };\n#endif\nin vec4 v_color;\n#if USE_TEXTURE\nin vec2 v_uv0;\nuniform sampler2D texture;\n#endif\nconst vec2 iResolution = vec2(0.5, 0.5);\nfloat hash21(vec2 x) {\n return fract(cos(mod(dot(x, vec2(13.9898, 8.141)), 3.14)) * 43758.5453);\n}\nvec2 hash22(vec2 uv) {\n uv = vec2(dot(uv, vec2(127.1,311.7)),\n dot(uv, vec2(269.5,183.3)));\n return 2.0 * fract(sin(uv) * 43758.5453123) - 1.0;\n}\nfloat perlinNoise(vec2 uv) {\n vec2 iuv = floor(uv);\n vec2 fuv = fract(uv);\n vec2 blur = smoothstep(.0, 1., fuv);\n vec2 bl = vec2(.0, .0);\n vec2 br = vec2(1., .0);\n vec2 tl = vec2(.0, 1.);\n vec2 tr = vec2(1., 1.);\n vec2 bln = hash22(iuv + bl);\n vec2 brn = hash22(iuv + br);\n vec2 tln = hash22(iuv + tl);\n vec2 trn = hash22(iuv + tr);\n float b = mix(dot(bln, fuv - bl), dot(brn, fuv - br), blur.x);\n float t = mix(dot(tln, fuv - tl), dot(trn, fuv - tr), blur.x);\n float c = mix(b, t, blur.y);\n float rs = 2.0 * texture2D(texture, vec2(uv.x,0.75)).r;\n return (c * rs);\n}\nfloat fbm(vec2 uv, int octaves) {\n float value = .0;\n float amplitude = .5;\n float freq = 2.0;\n for(int i = 0; i < 30; i++)\n {\n value += perlinNoise(uv) * amplitude;\n uv *= freq;\n amplitude *= .5;\n }\n return value;\n}\nmat2 R(float q) {\n return mat2(cos(q), sin(q), -sin(q), cos(q));\n}\nvoid main () {\n vec2 uvv = (v_uv0 - 0.5) / iResolution.y;\n vec3 col1, col2;\n uvv.xy += fbm(uvv.yx + cc_time.x * 0.5, 30);\n float dist1 = abs(uvv.y);\n col1 = vec3(1.0) * mix(0.0, 0.05, hash21(vec2(sin(cc_time.x)))) / dist1;\n vec4 o = vec4(0.0);\n vec2 uv = v_uv0;\n float t = cc_time.x, e, s, g, k = 0.01;\n for(float i = 0.0; i < 100.0; i++)\n {\n g += max(k, e * 0.2);\n vec3 p = vec3((uv - 0.6) / iResolution.y * g + iResolution / iResolution.y * R(t + g * 0.5) * 0.5, g + t / 0.3);\n e = 0.3 - dot(p.xy, p.xy);\n for (float s = 2.0; s < 100.0; s ++) {\n p.yz *= R(s);\n e += abs(dot(sin(p * s + t * s * 0.2) / s, p - p + 1.0));\n }\n o += o.w * min(e * o + (sin(vec4(1.0, 2.0, 3.0, 1.0) - p.z * 0.3) * 0.6 - 0.4), k) * k;\n }\n vec3 finalColor = mix(o.rgb, col1, 0.3);\n finalColor *= min(1.0, 1.0 + cos(0.15 * t)) + min(1.0, max(0.0, -2.0 - 4.0 * cos(0.15 * t))) * smoothstep(0.85, 1.0, fract(sin(t) * 43758.5453));\n gl_FragColor = vec4(finalColor, 1.0);\n}"
- }
- }
- ],
- "subMetas": {}
- }
|