From f683f09e5425467d1110448492004b95384e2544 Mon Sep 17 00:00:00 2001 From: FMS-Cat Date: Sat, 27 Mar 2021 18:21:25 +0900 Subject: [PATCH] feature: add serial + flashy-terrain --- src/automaton.json | 2 +- src/entities/FlashyTerrain.ts | 79 +++++++++++++++ src/entities/Serial.ts | 113 ++++++++++++++++++++++ src/geometries/genPlane.ts | 56 +++++++++++ src/scene.ts | 44 ++++++--- src/shaders/flashy-terrain.frag | 40 ++++++++ src/shaders/flashy-terrain.vert | 30 ++++++ src/shaders/modules/fractSin.glsl | 5 + src/shaders/serial-decode.frag | 49 ++++++++++ src/shaders/serial-encode.frag | 81 ++++++++++++++++ src/shaders/sphere-particles-compute.frag | 2 +- 11 files changed, 487 insertions(+), 14 deletions(-) create mode 100644 src/entities/FlashyTerrain.ts create mode 100644 src/entities/Serial.ts create mode 100644 src/geometries/genPlane.ts create mode 100644 src/shaders/flashy-terrain.frag create mode 100644 src/shaders/flashy-terrain.vert create mode 100644 src/shaders/modules/fractSin.glsl create mode 100644 src/shaders/serial-decode.frag create mode 100644 src/shaders/serial-encode.frag diff --git a/src/automaton.json b/src/automaton.json index 05875de..959078d 100644 --- a/src/automaton.json +++ b/src/automaton.json @@ -1 +1 @@ -{"version":"4.1.1","resolution":100,"curves":[{"nodes":[[0,1,0,0,0.16140350877192983],[1,0,-0.47719298245614045]]},{"nodes":[[0,0,0,0,0.1],[0.3747555183012014,1,-0.1,0,0.1],[1.3333333333333333,0,-0.1]]},{"nodes":[[],[0.6666666666666666,1,-0.4560629631300563,-0.1852941176470587],[0.6666666666666666,0,0,0,0.26644908616188,0.1029411764705882],[2,1.1900000000000002,-0.1],[2,0.00686274509803933,0,0,0.10652741514360319],[2.6666666666666665,0.7000000000000001],[2.6666666666666665,0,0,0,0.1391644908616188,0.5215686274509802],[3.333333333333333,0.9,-0.5014360313315928,-0.22647058823529403],[3.333333333333333,0,0,0,0.3974946346535474,0.10043744264185422],[4.666666666666666,1.2000000000000002,0,0,0.1],[4.666666666666666],[5.333333333333333,0.7000000000000001,-0.24079400848586707,-0.49736814906842436],[5.333333333333333],[6,0.8,-0.4356422056174482,-0.17156862745098037],[6,0,0,0,0.32852235276081576,0.05490196078431372],[7.333333333333333,1.1441176470588237,-0.1,0,0.1],[7.333333333333333],[8,0.3333],[8,0,0,0,0.08806743643105143,0.4254901960784307],[8.666666666666666,0.9,-0.3995834676293276,-0.08230605476940031],[8.666666666666666],[9.4,1.1,-0.2785205844025618,-0.17156862745098012,0.2785205844025618,0.17156862745098012],[10,1.3],[10],[10.666666666666666,0.6000000000000001,-0.11225401796276425,-0.5783350570563074]],"fxs":[{"def":"repeat","params":{"interval":0.2299999999999996},"time":7.333333333333333,"length":0.6666666666666667}]},{"nodes":[[0,0,0,0,0.12284595300261082,0.061764705882352944],[0.6666666666666666,0.4,-0.1],[0.6666666666666666,0.06568627450980391],[2,0.2],[2.236344893790143,0.4,-0.1,0,0.1],[2.6666666666666665,0,-0.34575086532310695,0,0.04271204452939744],[2.769918291305192,0.1,-0.05130523784998782,0,0.09999999999999999],[3.333333333333333,0.1],[3.6666666666666665,0.32774323388394533],[4.666666666666666,0.30000000000000004],[4.666666666666666,0.023323265139934546],[5.333333333333333,0.1],[5.333333333333333],[6,0.30000000000000004],[6,0.02745098039215696,0,0,0.09974597868276715,-0.006845312262542842],[7.333333333333333,0.1,-0.1],[7.333333333333333,0.7000000000000001],[8.666666666666666,0.7000000000000001],[8.666666666666666,1],[10,0.1],[10.666666666666666]]},{"nodes":[[0,0,0,0,0.1],[0.3333333333333333,1,-0.1,0,0.1],[0.6666666666666666,0,-0.1],[1.9166666666666665,1,-1.0007832898172324,0,0.06],[2],[2.025071712633245,1,-0.044516971279373374,0,0.1],[2.1623944411350506,0.5,-0.07221383357420871,0.2738348538091391,0.07221383357420871,-0.2738348538091391],[2.6666666666666665,0,-0.1,0,0.1],[3,1,-0.2864316909347707,0,0.24406085208595923],[3.333333333333333,0,-0.036443741726782705,0.4106336078810942],[3.6666666666666665,0.7544057184393509,-0.08631141286229893,-0.07178801363349067,0.13346814639852406,0.11100980502520727],[4.666666666666666,1,-0.33942558746736295,-0.018347344929083464,0.09208797505724492,-0.3264027483296351],[4.851079899134173,0.30000000000000004,-0.07486057061026631,-0.013179150760383026,0.1],[5.0444017511428605,0.9656862745098039,-0.1,0,0.1],[5.333333333333333,0.044689231228471016,-0.1,0,0.1],[5.666666666666666,1,-0.1,0,0.1],[6,0,-0.1],[7.333333333333333,1,-1.0426547051383652,0,0.1],[7.6000000000000005,0.7000000000000001,-0.1,0,0.1],[8,1],[8,0,-0.1,0,0.1],[8.166666666666666,1,-0.099988538641853,-0.006965859231865531],[8.489362746562259,1,0,0,0.09998887794379856,-0.006861981819672439],[8.666666666666666,0,-0.11262160793957762,0.041182622607896624],[8.9,1,-0.11617352813418727,-0.020588235294117612,0.11617352813418727,0.020588235294117612],[9.04400609908224,0.15784313725490162,-0.0988340957186134,-0.027450980392156817,0.0988340957186134,0.027450980392156817],[9.3,1,-0.09200304954112025,-0.041176470588235224,0.09200304954112025,0.041176470588235224],[9.5,0.2,-0.09449923761471994,-0.06176470588235285,0.09449923761471994,0.06176470588235285],[9.666666666666666,1,-0.08899847522943988,-0.027450980392156817,0.08899847522943988,0.027450980392156817],[10,0.30000000000000004,-0.06149466330303955,-0.06176470588235285,0.06149466330303955,0.06176470588235285],[10,1,-0.1,0,0.1],[10.666666666666666,0.1,-0.1,0,0.1]],"fxs":[{"def":"repeat","params":{"interval":0.2490000000000001},"time":2,"length":0.6666666666666665},{"def":"sine","params":{"amp":0.26,"freq":8.590000000000002,"offset":0},"time":3.934411837854859,"length":0.7322548288118069},{"def":"sine","params":{"amp":0.4400000000000004,"freq":5.889999999999998,"offset":0},"time":10.234266741175261,"length":0.4323999254914046},{"def":"hermitePatch","params":{},"time":3.821100533282267,"length":0.12610951070520438,"row":1},{"def":"hermitePatch","params":{},"time":10.18270758125172,"length":0.09198590579094379,"row":1}]},{"nodes":[[],[0.5,0.5,0,0,0.3072250626170559,0.32683448369273865],[1.3333333333333333,1.5]]},{"nodes":[[0,0.2,0,0,0.18674781789871728,2.609799325705191],[0.6666666666666666,0.1,-0.3546547911950566,0.44607843137254866]]},{"nodes":[[0,0.15115889256979576,0,0,0.1],[1.3333333333333333,0.7344636184844164,-0.8192982456140352,-0.01372549019607843]],"fxs":[{"def":"sine","params":{"amp":0.42000000000000004,"freq":9.43,"offset":0},"time":0.5833333333333333,"length":0.75},{"def":"hermitePatch","params":{},"time":0.5,"length":0.16666666666666663,"row":1}]},{"nodes":[[0,0,0,0,0.1],[0.6666666666666666,1,-0.1],[0.6666666666666666,0.04000000000000001],[2,0.019999999999999997],[2,0.4],[2.6666666666666665],[3.333333333333333,0.2,-0.1],[3.333333333333333,0.5],[4.666666666666666,0.6000000000000001],[4.666666666666666,0.059594068084455554],[5.333333333333333],[6,0.1],[7.333333333333333,0,-1.3219093627620064,-0.061764705882352944],[8],[8,0.8],[10,0.8],[10,0.1],[10.666666666666666]]},{"nodes":[[0,0,0,0,0.11631853785900784,0.15784313725490196],[0.3333333333333333,0.2,-0.1,-0.06862745098039215],[0.3333333333333333,0,0,0,0.10652741514360313,0.034313725490196074],[0.6257615317667536,0.4,-0.035197899213743125,-0.1178437887562426,0.05762038784328031,0.19291505927163513],[1.5833333333333333,1.6588235294117648,-0.14423846823324632,-0.08235294117647059],[1.5833333333333333,0,0,0,0.0706266318537859,0.12352941176470589],[1.8333333333333333,0.6000000000000001,-0.07923141560987097,-0.16655319476142408,0.05223508415950609,0.10980392156862741],[2,0.8,-0.07118673688066018,-0.08235294117647059]]},{"nodes":[[0,0.7000000000000001,0,0,0.14895561357702347,-0.7343137254901958],[0.6666666666666666,0.01999999999999999,-0.07958650842810296,0.0005266470222471706,0.7602446192333546,-0.005030759268204068],[1.75,0.2,-0.175065274151436,-0.0480392156862745],[2,1,-0.1]]},{"nodes":[[0,0.264705882352941,0,0,0.2664490861618798,-0.3705882352941175],[1.75,0,-0.1,0,0.1],[2,1,-0.1]]},{"nodes":[[0,0,0,0,0.1],[0.3333333333333333,0.9460784313725474,-0.1,0,0.1],[1.3333333333333333,0.3627450980392144,-0.11276290315437737,0.31798356313506776,0.058202350589290165,-0.16412659044332573],[1.6666666666666665,1,-0.1,0,0.1],[1.7304177545691903,0.1,-0.1,0,0.1],[2,1.4000000000000001,-0.05099116999738633,-0.5930547707442783]],"fxs":[{"def":"sine","params":{"amp":0.3999999999999999,"freq":17.779999999999987,"offset":0},"time":0.6103133159268926,"length":0.7230200174064406},{"def":"hermitePatch","params":{},"time":0.5580939947780674,"length":0.08289817232376029,"row":1},{"def":"hermitePatch","params":{},"time":1.2836814621409922,"length":0.11631853785900792,"row":1}]},{"nodes":[[0,1,0,0,0.06843643544269563,-0.8715686274509801],[0.6666666666666666,0,-0.47719298245614045]]},{"nodes":[[],[2,2]]},{"nodes":[[0,0.1],[1.3333333333333333,0.30000000000000004]]},{"nodes":[[],[1.3333333333333333]]},{"nodes":[[0,0,0,0,0.07564543093234954,0.8647058823529409],[1.3333333333333333,1]]},{"nodes":[[],[0.3333333333333333,0.333],[0.3333333333333333,0,0,0,0.04050107306929012,0.096078431372549],[0.5833333333333333,0.30000000000000004,-0.10502788587794674,-0.054901960784313704],[1.3333333333333333]],"fxs":[{"def":"repeat","params":{"interval":0.2499999999999999},"time":0.3333333333333333,"length":1}]},{"nodes":[[0,0,0,0,0.041253263707571805],[0.1,0.472549019607836,-0.044516971279373374,-0.2333333333333331,0.037233176309202774,0.19515571003904697],[1.3333333333333333,1,-1.2945169712793734]]},{"nodes":[[0,0,0,0,0.1],[0.8,0.9,-0.10634811016391839,-0.09574850838471399,0.10634811016391839,0.09574850838471399],[1,1,-0.034837955875665044,-0.008249475331448328]]},{"nodes":[[0,1,0,0,0.08905168734696595,-0.6204705716763121],[0.8,0.1,-0.3657976094933656,0.05238364149449456,0.3657976094933656,-0.05238364149449456],[4,0,-0.5779474714155504]]},{"nodes":[[0,0,0,0,0.33333333333333337],[0.6335509138381202,0.1588235294117648,-0.0296357295978042,-0.12604773105452508,0.0296357295978042,0.12604773105452508],[0.7000000000000001,0.7549019607843139,-0.02819843342036554,-0.09607843137254903,0.02819843342036554,0.09607843137254903],[1.563751087902524,0.9519607843137257,-0.20443864229765013,-0.02745098039215686,0.20443864229765013,0.02745098039215686],[4,1,-0.5779474714155504]]},{"nodes":[[0,0,0,0,0.3154046997389034],[1.3333333333333333,1,-0.29908616187989556]]}],"channels":[["EnvironmentMap/accumulate",{"items":[{"value":0.1}]}],["Rings/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["FlickyParticles/active",{"items":[{},{"time":85.33333333333333,"length":42.666666666666664}]}],["Raymarcher/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["Trails/active",{"items":[{}]}],["SphereParticles/active",{"items":[{"length":42.666666666666664}]}],["SufferTexts/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["Cube/active",{"items":[{"length":42.666666666666664}]}],["Condition/active",{"items":[{"length":42.666666666666664}]}],["Glitch/amp",{"items":[{},{"time":42.666666666666664,"length":1,"curve":0},{"time":45.33333333333333,"length":1,"curve":0},{"time":48,"length":1,"curve":0},{"time":50.666666666666664,"length":1,"curve":0},{"time":53.33333333333333,"length":1,"curve":0},{"time":56,"length":1,"curve":0},{"time":58.666666666666664,"length":1,"curve":0},{"time":61.33333333333333,"length":1,"curve":0},{"time":64,"length":1,"curve":0},{"time":66.66666666666666,"length":1,"curve":0},{"time":69.33333333333333,"length":1,"curve":0},{"time":72,"length":1,"curve":0},{"time":74.66666666666666,"length":1,"curve":0},{"time":77.33333333333333,"length":1,"curve":0},{"time":80,"length":1,"curve":0},{"time":82.66666666666666,"length":1,"curve":0},{"time":256}]}],["PixelSorter/amp",{"items":[{},{"time":42.666666666666664,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":45.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":48,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":50.666666666666664,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":53.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":56,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":58.666666666666664,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":61.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":64,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":66.66666666666666,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":69.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":72,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":74.66666666666666,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":77.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":80,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":82.66666666666666,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975}]}],["Music/NEURO_TIME",{"items":[{},{"time":42.666666666666664,"length":10.666666666666664,"curve":2},{"time":53.33333333333333,"length":8.666666666666671,"curve":2},{"time":62,"length":1.999999999999993,"curve":9},{"time":63.99999999999999,"length":10.666666666666664,"curve":2},{"time":74.66666666666666,"length":8.666666666666671,"curve":2},{"time":83.33333333333333,"length":1.999999999999993,"curve":9},{"time":85.33333333333331,"length":1.3333333333333428,"curve":14},{"time":86.66666666666666,"length":1.3333333333333286,"curve":18},{"time":87.99999999999999,"length":1.3333333333333428,"curve":14},{"time":89.33333333333333,"length":1.3333333333333286,"curve":18},{"time":90.66666666666666,"length":1.3333333333333428,"curve":14},{"time":92,"length":1.3333333333333286,"curve":18},{"time":93.33333333333333,"length":1.3333333333333428,"curve":14},{"time":94.66666666666667,"length":1.3333333333333286,"curve":18},{"time":96,"length":1.3333333333333428,"curve":14},{"time":97.33333333333334,"length":1.3333333333333144,"curve":18},{"time":98.66666666666666,"length":1.3333333333333428,"curve":14},{"time":100,"length":1.3333333333333286,"curve":18},{"time":101.33333333333333,"length":1.3333333333333428,"curve":14},{"time":102.66666666666667,"length":1.3333333333333286,"curve":18},{"time":104,"length":1.3333333333333428,"curve":14},{"time":105.33333333333334,"length":1.3333333333333286,"curve":18}]}],["Music/NEURO_DETUNE",{"items":[{},{"time":42.666666666666664,"length":10.666666666666664,"curve":3},{"time":53.33333333333333,"length":8.666666666666671,"curve":3},{"time":62,"length":1.999999999999993,"curve":10},{"time":63.99999999999999,"length":10.666666666666664,"curve":3},{"time":74.66666666666666,"length":8.666666666666671,"curve":3},{"time":83.33333333333333,"length":1.999999999999993,"curve":10},{"time":85.33333333333333,"length":1.3333333333333286,"curve":15},{"time":88,"length":1.3333333333333286,"curve":15},{"time":90.66666666666666,"length":1.3333333333333286,"curve":15},{"time":93.33333333333333,"length":1.3333333333333286,"curve":15},{"time":96,"length":1.3333333333333286,"curve":15},{"time":98.66666666666666,"length":1.3333333333333286,"curve":15},{"time":101.33333333333333,"length":1.3333333333333286,"curve":15},{"time":104,"length":1.3333333333333286,"curve":15}]}],["Music/NEURO_DETUNE_PHASE",{"items":[{},{"time":42.666666666666664,"length":10.666666666666664,"curve":8},{"time":53.33333333333333,"length":8.666666666666671,"curve":8},{"time":62,"length":1.999999999999993,"curve":11},{"time":63.99999999999999,"length":10.666666666666664,"curve":8},{"time":74.66666666666666,"length":8.666666666666671,"curve":8},{"time":83.33333333333333,"length":1.999999999999993,"curve":11},{"time":85.33333333333333,"length":1.3333333333333428,"curve":16},{"time":88,"length":1.3333333333333428,"curve":16},{"time":90.66666666666666,"length":1.3333333333333428,"curve":16},{"time":93.33333333333333,"length":1.3333333333333428,"curve":16},{"time":96,"length":1.3333333333333428,"curve":16},{"time":98.66666666666666,"length":1.3333333333333428,"curve":16},{"time":101.33333333333333,"length":1.3333333333333428,"curve":16},{"time":104,"length":1.3333333333333428,"curve":16}]}],["Music/NEURO_WUB_AMP",{"items":[{},{"time":42.666666666666664,"length":10.668578038364203,"curve":4},{"time":53.33524470503087,"length":8.664755294969133,"curve":4},{"time":62,"length":2.0038227433950624,"curve":12},{"time":64.00382274339506,"length":10.668578038364203,"curve":4},{"time":74.67240078175926,"length":8.660932551574064,"curve":4},{"time":83.33333333333333,"length":2.0038227433950624,"curve":12},{"time":85.33715607672839,"length":1.3333333333333428,"curve":17},{"time":88,"length":1.3333333333333333,"curve":17},{"time":90.66666666666666,"length":1.3333333333333333,"curve":17},{"time":93.33333333333333,"length":1.3333333333333333,"curve":17},{"time":96,"length":1.3333333333333333,"curve":17},{"time":98.66666666666666,"length":1.3333333333333333,"curve":17},{"time":101.33333333333333,"length":1.3333333333333333,"curve":17},{"time":104,"length":1.3333333333333333,"curve":17}]}],["Music/NEURO_WUB_FREQ",{"items":[{},{"time":42.666666666666664,"length":2,"value":1},{"time":44.666666666666664,"length":0.6666666666666643,"value":0.49999999999999967},{"time":45.33333333333333,"length":0.6666666666666714,"value":1},{"time":46,"length":1.3333333333333286,"value":2},{"time":47.33333333333333,"length":0.6666666666666714,"value":2.5},{"time":48,"length":0.6666666666666643,"value":1},{"time":48.666666666666664,"length":1.3333333333333357,"value":1},{"time":50,"length":0.6666666666666643,"value":2},{"time":50.666666666666664,"length":2,"value":1},{"time":52.666666666666664,"length":0.6666666666666643,"value":2},{"time":53.33333333333333,"length":0.6666666666666714,"value":1},{"time":54,"length":1.3333333333333286,"value":2.1000000000000014},{"time":55.33333333333333,"length":0.6666666666666714,"value":0.5},{"time":56,"length":0.6666666666666643,"value":7},{"time":56.666666666666664,"length":1.3333333333333357,"value":3},{"time":58,"length":0.6666666666666714,"value":1},{"time":58.66666666666667,"length":0.6666666666666714,"value":0.9600000000000006},{"time":59.33333333333334,"length":1.3333333333333215,"value":6},{"time":60.666666666666664,"length":0.6666666666666785,"value":10.840000000000003},{"time":61.33333333333334,"length":0.6666666666666572,"value":1},{"time":62,"length":1.3333333333333428,"value":3.989999999999996},{"time":63.33333333333334,"length":0.6666666666666572,"value":4.109999999999999},{"time":64,"length":2,"value":1},{"time":66,"length":0.6666666666666643,"value":0.49999999999999967},{"time":66.66666666666666,"length":0.6666666666666714,"value":1},{"time":67.33333333333333,"length":1.3333333333333286,"value":2},{"time":68.66666666666666,"length":0.6666666666666714,"value":2.5},{"time":69.33333333333333,"length":0.6666666666666643,"value":1},{"time":70,"length":1.3333333333333357,"value":1},{"time":71.33333333333334,"length":0.6666666666666643,"value":2},{"time":72,"length":2,"value":1},{"time":74,"length":0.6666666666666643,"value":2},{"time":74.66666666666666,"length":0.6666666666666714,"value":1},{"time":75.33333333333333,"length":1.3333333333333286,"value":2.1000000000000014},{"time":76.66666666666666,"length":0.6666666666666714,"value":0.5},{"time":77.33333333333333,"length":0.6666666666666643,"value":7},{"time":78,"length":1.3333333333333357,"value":3},{"time":79.33333333333334,"length":0.6666666666666714,"value":1},{"time":80.00000000000001,"length":0.6666666666666714,"value":0.9600000000000006},{"time":80.66666666666669,"length":1.3333333333333144,"value":6},{"time":82,"length":0.6666666666666856,"value":10.840000000000003},{"time":82.66666666666669,"length":0.6666666666666572,"value":1},{"time":83.33333333333334,"length":1.3333333333333428,"value":3.9899999999999993},{"time":84.66666666666669,"length":0.6666666666666572,"value":4.109999999999999},{"time":85.33333333333334,"length":1.3333333333333144,"value":1},{"time":88,"length":1.3333333333333144,"value":1},{"time":90.66666666666666,"length":1.3333333333333144,"value":1},{"time":93.33333333333333,"length":1.3333333333333144,"value":1},{"time":96,"length":1.3333333333333144,"value":1},{"time":98.66666666666666,"length":1.3333333333333144,"value":1},{"time":101.33333333333333,"length":1.3333333333333144,"value":1},{"time":104,"length":1.3333333333333144,"value":1}]}],["sufferText/push",{"items":[{"time":42.666666666666664},{"time":45.33333333333333,"value":1},{"time":48,"value":2},{"time":50.666666666666664,"value":3},{"time":53.33333333333333,"value":4},{"time":56,"value":5},{"time":58.666666666666664,"value":6},{"time":61.33333333333333,"value":7},{"time":64,"value":8},{"time":66.66666666666666,"value":9},{"time":69.33333333333333,"value":10},{"time":72,"value":11},{"time":74.66666666666666,"value":12},{"time":77.33333333333333,"value":13},{"time":80,"value":14},{"time":82.66666666666666,"value":15}]}],["Condition/phaseWidth",{"items":[{"value":0.1},{"time":22.333333333333332,"length":20.333333333333332,"value":0.1,"curve":20,"speed":0.049180327868852465,"amp":0.9}]}],["Camera/r",{"items":[{"length":4,"value":5,"curve":21,"amp":10},{"time":20.666666666666664,"length":4,"value":5,"curve":22,"amp":-2},{"time":37.33333333333333,"length":4,"value":10,"curve":23,"offset":-0.009374586224097481,"speed":0.333922345475263,"amp":-3},{"time":42.666666666666664,"value":5},{"time":48,"value":3},{"time":53.33333333333333,"value":5}]}],["Camera/t",{"items":[{"time":21.333333333333332,"length":5.333333333333332,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":26.666666666666664,"length":5.333333333333332,"value":1.2000000000000002,"curve":23,"speed":0.2499999999999999,"amp":-0.9},{"time":32,"length":5.333333333333329,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":37.33333333333333},{"time":85.33333333333333,"length":4,"value":0.2,"curve":21,"amp":0.6000000000000001}]}],["Camera/p",{"items":[{"time":21.333333333333332,"length":5.333333333333332,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":26.666666666666664,"value":-0.9999999999999998},{"time":32,"length":5.333333333333329,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":37.33333333333333},{"time":85.33333333333333,"length":4,"curve":21,"amp":1.6}]}],["LightFirst/active",{"items":[{"length":106.66666666666666}]}],["LightPink/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["Sync/first/clap",{"items":[{},{"time":22.333333333333332,"length":1.3333333333333321,"curve":19},{"time":23.666666666666664,"length":1.3333333333333321,"value":1,"curve":19},{"time":24.999999999999996,"length":1.3333333333333321,"value":2,"curve":19},{"time":26.33333333333333,"length":1.3333333333333321,"value":3,"curve":19},{"time":27.66666666666666,"length":1.3333333333333321,"value":4,"curve":19},{"time":28.999999999999993,"length":1.3333333333333321,"value":5,"curve":19},{"time":30.333333333333325,"length":1.3333333333333321,"value":6,"curve":19},{"time":31.666666666666657,"length":1.3333333333333321,"value":7,"curve":19},{"time":32.999999999999986,"length":1.3333333333333321,"value":8,"curve":19},{"time":34.333333333333314,"length":1.3333333333333321,"value":9,"curve":19},{"time":35.66666666666664,"length":1.3333333333333321,"value":10,"curve":19},{"time":36.99999999999997,"length":1.3333333333333321,"value":11,"curve":19}]}]],"labels":{"zero":0},"guiSettings":{"snapTimeActive":true,"snapTimeInterval":0.1,"snapValueActive":true,"snapValueInterval":1,"snapBeatActive":true,"bpm":180,"beatOffset":0,"useBeatInGUI":true,"minimizedPrecisionTime":3,"minimizedPrecisionValue":3}} \ No newline at end of file +{"version":"4.1.1","resolution":100,"curves":[{"nodes":[[0,1,0,0,0.16140350877192983],[1,0,-0.47719298245614045]]},{"nodes":[[0,0,0,0,0.1],[0.3747555183012014,1,-0.1,0,0.1],[1.3333333333333333,0,-0.1]]},{"nodes":[[],[0.6666666666666666,1,-0.4560629631300563,-0.1852941176470587],[0.6666666666666666,0,0,0,0.26644908616188,0.1029411764705882],[2,1.1900000000000002,-0.1],[2,0.00686274509803933,0,0,0.10652741514360319],[2.6666666666666665,0.7000000000000001],[2.6666666666666665,0,0,0,0.1391644908616188,0.5215686274509802],[3.333333333333333,0.9,-0.5014360313315928,-0.22647058823529403],[3.333333333333333,0,0,0,0.3974946346535474,0.10043744264185422],[4.666666666666666,1.2000000000000002,0,0,0.1],[4.666666666666666],[5.333333333333333,0.7000000000000001,-0.24079400848586707,-0.49736814906842436],[5.333333333333333],[6,0.8,-0.4356422056174482,-0.17156862745098037],[6,0,0,0,0.32852235276081576,0.05490196078431372],[7.333333333333333,1.1441176470588237,-0.1,0,0.1],[7.333333333333333],[8,0.3333],[8,0,0,0,0.08806743643105143,0.4254901960784307],[8.666666666666666,0.9,-0.3995834676293276,-0.08230605476940031],[8.666666666666666],[9.4,1.1,-0.2785205844025618,-0.17156862745098012,0.2785205844025618,0.17156862745098012],[10,1.3],[10],[10.666666666666666,0.6000000000000001,-0.11225401796276425,-0.5783350570563074]],"fxs":[{"def":"repeat","params":{"interval":0.2299999999999996},"time":7.333333333333333,"length":0.6666666666666667}]},{"nodes":[[0,0,0,0,0.12284595300261082,0.061764705882352944],[0.6666666666666666,0.4,-0.1],[0.6666666666666666,0.06568627450980391],[2,0.2],[2.236344893790143,0.4,-0.1,0,0.1],[2.6666666666666665,0,-0.34575086532310695,0,0.04271204452939744],[2.769918291305192,0.1,-0.05130523784998782,0,0.09999999999999999],[3.333333333333333,0.1],[3.6666666666666665,0.32774323388394533],[4.666666666666666,0.30000000000000004],[4.666666666666666,0.023323265139934546],[5.333333333333333,0.1],[5.333333333333333],[6,0.30000000000000004],[6,0.02745098039215696,0,0,0.09974597868276715,-0.006845312262542842],[7.333333333333333,0.1,-0.1],[7.333333333333333,0.7000000000000001],[8.666666666666666,0.7000000000000001],[8.666666666666666,1],[10,0.1],[10.666666666666666]]},{"nodes":[[0,0,0,0,0.1],[0.3333333333333333,1,-0.1,0,0.1],[0.6666666666666666,0,-0.1],[1.9166666666666665,1,-1.0007832898172324,0,0.06],[2],[2.025071712633245,1,-0.044516971279373374,0,0.1],[2.1623944411350506,0.5,-0.07221383357420871,0.2738348538091391,0.07221383357420871,-0.2738348538091391],[2.6666666666666665,0,-0.1,0,0.1],[3,1,-0.2864316909347707,0,0.24406085208595923],[3.333333333333333,0,-0.036443741726782705,0.4106336078810942],[3.6666666666666665,0.7544057184393509,-0.08631141286229893,-0.07178801363349067,0.13346814639852406,0.11100980502520727],[4.666666666666666,1,-0.33942558746736295,-0.018347344929083464,0.09208797505724492,-0.3264027483296351],[4.851079899134173,0.30000000000000004,-0.07486057061026631,-0.013179150760383026,0.1],[5.0444017511428605,0.9656862745098039,-0.1,0,0.1],[5.333333333333333,0.044689231228471016,-0.1,0,0.1],[5.666666666666666,1,-0.1,0,0.1],[6,0,-0.1],[7.333333333333333,1,-1.0426547051383652,0,0.1],[7.6000000000000005,0.7000000000000001,-0.1,0,0.1],[8,1],[8,0,-0.1,0,0.1],[8.166666666666666,1,-0.099988538641853,-0.006965859231865531],[8.489362746562259,1,0,0,0.09998887794379856,-0.006861981819672439],[8.666666666666666,0,-0.11262160793957762,0.041182622607896624],[8.9,1,-0.11617352813418727,-0.020588235294117612,0.11617352813418727,0.020588235294117612],[9.04400609908224,0.15784313725490162,-0.0988340957186134,-0.027450980392156817,0.0988340957186134,0.027450980392156817],[9.3,1,-0.09200304954112025,-0.041176470588235224,0.09200304954112025,0.041176470588235224],[9.5,0.2,-0.09449923761471994,-0.06176470588235285,0.09449923761471994,0.06176470588235285],[9.666666666666666,1,-0.08899847522943988,-0.027450980392156817,0.08899847522943988,0.027450980392156817],[10,0.30000000000000004,-0.06149466330303955,-0.06176470588235285,0.06149466330303955,0.06176470588235285],[10,1,-0.1,0,0.1],[10.666666666666666,0.1,-0.1,0,0.1]],"fxs":[{"def":"repeat","params":{"interval":0.2490000000000001},"time":2,"length":0.6666666666666665},{"def":"sine","params":{"amp":0.26,"freq":8.590000000000002,"offset":0},"time":3.934411837854859,"length":0.7322548288118069},{"def":"sine","params":{"amp":0.4400000000000004,"freq":5.889999999999998,"offset":0},"time":10.234266741175261,"length":0.4323999254914046},{"def":"hermitePatch","params":{},"time":3.821100533282267,"length":0.12610951070520438,"row":1},{"def":"hermitePatch","params":{},"time":10.18270758125172,"length":0.09198590579094379,"row":1}]},{"nodes":[[],[0.5,0.5,0,0,0.3072250626170559,0.32683448369273865],[1.3333333333333333,1.5]]},{"nodes":[[0,0.2,0,0,0.18674781789871728,2.609799325705191],[0.6666666666666666,0.1,-0.3546547911950566,0.44607843137254866]]},{"nodes":[[0,0.15115889256979576,0,0,0.1],[1.3333333333333333,0.7344636184844164,-0.8192982456140352,-0.01372549019607843]],"fxs":[{"def":"sine","params":{"amp":0.42000000000000004,"freq":9.43,"offset":0},"time":0.5833333333333333,"length":0.75},{"def":"hermitePatch","params":{},"time":0.5,"length":0.16666666666666663,"row":1}]},{"nodes":[[0,0,0,0,0.1],[0.6666666666666666,1,-0.1],[0.6666666666666666,0.04000000000000001],[2,0.019999999999999997],[2,0.4],[2.6666666666666665],[3.333333333333333,0.2,-0.1],[3.333333333333333,0.5],[4.666666666666666,0.6000000000000001],[4.666666666666666,0.059594068084455554],[5.333333333333333],[6,0.1],[7.333333333333333,0,-1.3219093627620064,-0.061764705882352944],[8],[8,0.8],[10,0.8],[10,0.1],[10.666666666666666]]},{"nodes":[[0,0,0,0,0.11631853785900784,0.15784313725490196],[0.3333333333333333,0.2,-0.1,-0.06862745098039215],[0.3333333333333333,0,0,0,0.10652741514360313,0.034313725490196074],[0.6257615317667536,0.4,-0.035197899213743125,-0.1178437887562426,0.05762038784328031,0.19291505927163513],[1.5833333333333333,1.6588235294117648,-0.14423846823324632,-0.08235294117647059],[1.5833333333333333,0,0,0,0.0706266318537859,0.12352941176470589],[1.8333333333333333,0.6000000000000001,-0.07923141560987097,-0.16655319476142408,0.05223508415950609,0.10980392156862741],[2,0.8,-0.07118673688066018,-0.08235294117647059]]},{"nodes":[[0,0.7000000000000001,0,0,0.14895561357702347,-0.7343137254901958],[0.6666666666666666,0.01999999999999999,-0.07958650842810296,0.0005266470222471706,0.7602446192333546,-0.005030759268204068],[1.75,0.2,-0.175065274151436,-0.0480392156862745],[2,1,-0.1]]},{"nodes":[[0,0.264705882352941,0,0,0.2664490861618798,-0.3705882352941175],[1.75,0,-0.1,0,0.1],[2,1,-0.1]]},{"nodes":[[0,0,0,0,0.1],[0.3333333333333333,0.9460784313725474,-0.1,0,0.1],[1.3333333333333333,0.3627450980392144,-0.11276290315437737,0.31798356313506776,0.058202350589290165,-0.16412659044332573],[1.6666666666666665,1,-0.1,0,0.1],[1.7304177545691903,0.1,-0.1,0,0.1],[2,1.4000000000000001,-0.05099116999738633,-0.5930547707442783]],"fxs":[{"def":"sine","params":{"amp":0.3999999999999999,"freq":17.779999999999987,"offset":0},"time":0.6103133159268926,"length":0.7230200174064406},{"def":"hermitePatch","params":{},"time":0.5580939947780674,"length":0.08289817232376029,"row":1},{"def":"hermitePatch","params":{},"time":1.2836814621409922,"length":0.11631853785900792,"row":1}]},{"nodes":[[0,1,0,0,0.06843643544269563,-0.8715686274509801],[0.6666666666666666,0,-0.47719298245614045]]},{"nodes":[[],[2,2]]},{"nodes":[[0,0.1],[1.3333333333333333,0.30000000000000004]]},{"nodes":[[],[1.3333333333333333]]},{"nodes":[[0,0,0,0,0.07564543093234954,0.8647058823529409],[1.3333333333333333,1]]},{"nodes":[[],[0.3333333333333333,0.333],[0.3333333333333333,0,0,0,0.04050107306929012,0.096078431372549],[0.5833333333333333,0.30000000000000004,-0.10502788587794674,-0.054901960784313704],[1.3333333333333333]],"fxs":[{"def":"repeat","params":{"interval":0.2499999999999999},"time":0.3333333333333333,"length":1}]},{"nodes":[[0,0,0,0,0.041253263707571805],[0.1,0.472549019607836,-0.044516971279373374,-0.2333333333333331,0.037233176309202774,0.19515571003904697],[1.3333333333333333,1,-1.2945169712793734]]},{"nodes":[[0,0,0,0,0.1],[0.8,0.9,-0.10634811016391839,-0.09574850838471399,0.10634811016391839,0.09574850838471399],[1,1,-0.034837955875665044,-0.008249475331448328]]},{"nodes":[[0,1,0,0,0.08905168734696595,-0.6204705716763121],[0.8,0.1,-0.3657976094933656,0.05238364149449456,0.3657976094933656,-0.05238364149449456],[4,0,-0.5779474714155504]]},{"nodes":[[0,0,0,0,0.33333333333333337],[0.6335509138381202,0.1588235294117648,-0.0296357295978042,-0.12604773105452508,0.0296357295978042,0.12604773105452508],[0.7000000000000001,0.7549019607843139,-0.02819843342036554,-0.09607843137254903,0.02819843342036554,0.09607843137254903],[1.563751087902524,0.9519607843137257,-0.20443864229765013,-0.02745098039215686,0.20443864229765013,0.02745098039215686],[4,1,-0.5779474714155504]]},{"nodes":[[0,0,0,0,0.3154046997389034],[1.3333333333333333,1,-0.29908616187989556]]},{"nodes":[[0,0,0,0,0.1],[1,0,-0.1]]},{"nodes":[[],[1.3333333333333333,1]]}],"channels":[["EnvironmentMap/accumulate",{"items":[{"value":0.1}]}],["Rings/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["FlickyParticles/active",{"items":[{},{"time":85.33333333333333,"length":1.3333333333333286},{"time":88,"length":1.3333333333333286},{"time":90.66666666666666,"length":1.3333333333333286},{"time":93.33333333333333,"length":1.3333333333333286},{"time":96,"length":1.3333333333333286},{"time":98.66666666666666,"length":1.3333333333333286},{"time":101.33333333333333,"length":1.3333333333333286},{"time":104,"length":1.3333333333333286}]}],["Raymarcher/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["Trails/active",{"items":[{}]}],["SphereParticles/active",{"items":[{"length":42.666666666666664}]}],["SufferTexts/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["FlashyTerrain/active",{"items":[{},{"time":86.66666666666666,"length":1.3333333333333428},{"time":97.33333333333333,"length":1.3333333333333428}]}],["Cube/active",{"items":[{"length":42.666666666666664}]}],["Condition/active",{"items":[{"length":42.666666666666664}]}],["Glitch/amp",{"items":[{},{"time":42.666666666666664,"length":1,"curve":0},{"time":45.33333333333333,"length":1,"curve":0},{"time":48,"length":1,"curve":0},{"time":50.666666666666664,"length":1,"curve":0},{"time":53.33333333333333,"length":1,"curve":0},{"time":56,"length":1,"curve":0},{"time":58.666666666666664,"length":1,"curve":0},{"time":61.33333333333333,"length":1,"curve":0},{"time":64,"length":1,"curve":0},{"time":66.66666666666666,"length":1,"curve":0},{"time":69.33333333333333,"length":1,"curve":0},{"time":72,"length":1,"curve":0},{"time":74.66666666666666,"length":1,"curve":0},{"time":77.33333333333333,"length":1,"curve":0},{"time":80,"length":1,"curve":0},{"time":82.66666666666666,"length":1,"curve":0},{"time":256}]}],["PixelSorter/amp",{"items":[{},{"time":42.666666666666664,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":45.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":48,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":50.666666666666664,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":53.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":56,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":58.666666666666664,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":61.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":64,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":66.66666666666666,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":69.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":72,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":74.66666666666666,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":77.33333333333333,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":80,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975},{"time":82.66666666666666,"length":1.3333333333333357,"curve":13,"speed":0.4999999999999975}]}],["Music/NEURO_TIME",{"items":[{},{"time":42.666666666666664,"length":10.666666666666664,"curve":2},{"time":53.33333333333333,"length":8.666666666666671,"curve":2},{"time":62,"length":1.999999999999993,"curve":9},{"time":63.99999999999999,"length":10.666666666666664,"curve":2},{"time":74.66666666666666,"length":8.666666666666671,"curve":2},{"time":83.33333333333333,"length":1.999999999999993,"curve":9},{"time":85.33333333333331,"length":1.3333333333333428,"curve":14},{"time":86.66666666666666,"length":1.3333333333333286,"curve":18},{"time":87.99999999999999,"length":1.3333333333333428,"curve":14},{"time":89.33333333333333,"length":1.3333333333333286,"curve":18},{"time":90.66666666666666,"length":1.3333333333333428,"curve":14},{"time":92,"length":1.3333333333333286,"curve":18},{"time":93.33333333333333,"length":1.3333333333333428,"curve":14},{"time":94.66666666666667,"length":1.3333333333333286,"curve":18},{"time":96,"length":1.3333333333333428,"curve":14},{"time":97.33333333333334,"length":1.3333333333333144,"curve":18},{"time":98.66666666666666,"length":1.3333333333333428,"curve":14},{"time":100,"length":1.3333333333333286,"curve":18},{"time":101.33333333333333,"length":1.3333333333333428,"curve":14},{"time":102.66666666666667,"length":1.3333333333333286,"curve":18},{"time":104,"length":1.3333333333333428,"curve":14},{"time":105.33333333333334,"length":1.3333333333333286,"curve":18}]}],["Music/NEURO_DETUNE",{"items":[{},{"time":42.666666666666664,"length":10.666666666666664,"curve":3},{"time":53.33333333333333,"length":8.666666666666671,"curve":3},{"time":62,"length":1.999999999999993,"curve":10},{"time":63.99999999999999,"length":10.666666666666664,"curve":3},{"time":74.66666666666666,"length":8.666666666666671,"curve":3},{"time":83.33333333333333,"length":1.999999999999993,"curve":10},{"time":85.33333333333333,"length":1.3333333333333286,"curve":15},{"time":88,"length":1.3333333333333286,"curve":15},{"time":90.66666666666666,"length":1.3333333333333286,"curve":15},{"time":93.33333333333333,"length":1.3333333333333286,"curve":15},{"time":96,"length":1.3333333333333286,"curve":15},{"time":98.66666666666666,"length":1.3333333333333286,"curve":15},{"time":101.33333333333333,"length":1.3333333333333286,"curve":15},{"time":104,"length":1.3333333333333286,"curve":15}]}],["Music/NEURO_DETUNE_PHASE",{"items":[{},{"time":42.666666666666664,"length":10.666666666666664,"curve":8},{"time":53.33333333333333,"length":8.666666666666671,"curve":8},{"time":62,"length":1.999999999999993,"curve":11},{"time":63.99999999999999,"length":10.666666666666664,"curve":8},{"time":74.66666666666666,"length":8.666666666666671,"curve":8},{"time":83.33333333333333,"length":1.999999999999993,"curve":11},{"time":85.33333333333333,"length":1.3333333333333428,"curve":16},{"time":88,"length":1.3333333333333428,"curve":16},{"time":90.66666666666666,"length":1.3333333333333428,"curve":16},{"time":93.33333333333333,"length":1.3333333333333428,"curve":16},{"time":96,"length":1.3333333333333428,"curve":16},{"time":98.66666666666666,"length":1.3333333333333428,"curve":16},{"time":101.33333333333333,"length":1.3333333333333428,"curve":16},{"time":104,"length":1.3333333333333428,"curve":16}]}],["Music/NEURO_WUB_AMP",{"items":[{},{"time":42.666666666666664,"length":10.668578038364203,"curve":4},{"time":53.33524470503087,"length":8.664755294969133,"curve":4},{"time":62,"length":2.0038227433950624,"curve":12},{"time":64.00382274339506,"length":10.668578038364203,"curve":4},{"time":74.67240078175926,"length":8.660932551574064,"curve":4},{"time":83.33333333333333,"length":2.0038227433950624,"curve":12},{"time":85.33715607672839,"length":1.3333333333333428,"curve":17},{"time":88,"length":1.3333333333333333,"curve":17},{"time":90.66666666666666,"length":1.3333333333333333,"curve":17},{"time":93.33333333333333,"length":1.3333333333333333,"curve":17},{"time":96,"length":1.3333333333333333,"curve":17},{"time":98.66666666666666,"length":1.3333333333333333,"curve":17},{"time":101.33333333333333,"length":1.3333333333333333,"curve":17},{"time":104,"length":1.3333333333333333,"curve":17}]}],["Music/NEURO_WUB_FREQ",{"items":[{},{"time":42.666666666666664,"length":2,"value":1},{"time":44.666666666666664,"length":0.6666666666666643,"value":0.49999999999999967},{"time":45.33333333333333,"length":0.6666666666666714,"value":1},{"time":46,"length":1.3333333333333286,"value":2},{"time":47.33333333333333,"length":0.6666666666666714,"value":2.5},{"time":48,"length":0.6666666666666643,"value":1},{"time":48.666666666666664,"length":1.3333333333333357,"value":1},{"time":50,"length":0.6666666666666643,"value":2},{"time":50.666666666666664,"length":2,"value":1},{"time":52.666666666666664,"length":0.6666666666666643,"value":2},{"time":53.33333333333333,"length":0.6666666666666714,"value":1},{"time":54,"length":1.3333333333333286,"value":2.1000000000000014},{"time":55.33333333333333,"length":0.6666666666666714,"value":0.5},{"time":56,"length":0.6666666666666643,"value":7},{"time":56.666666666666664,"length":1.3333333333333357,"value":3},{"time":58,"length":0.6666666666666714,"value":1},{"time":58.66666666666667,"length":0.6666666666666714,"value":0.9600000000000006},{"time":59.33333333333334,"length":1.3333333333333215,"value":6},{"time":60.666666666666664,"length":0.6666666666666785,"value":10.840000000000003},{"time":61.33333333333334,"length":0.6666666666666572,"value":1},{"time":62,"length":1.3333333333333428,"value":3.989999999999996},{"time":63.33333333333334,"length":0.6666666666666572,"value":4.109999999999999},{"time":64,"length":2,"value":1},{"time":66,"length":0.6666666666666643,"value":0.49999999999999967},{"time":66.66666666666666,"length":0.6666666666666714,"value":1},{"time":67.33333333333333,"length":1.3333333333333286,"value":2},{"time":68.66666666666666,"length":0.6666666666666714,"value":2.5},{"time":69.33333333333333,"length":0.6666666666666643,"value":1},{"time":70,"length":1.3333333333333357,"value":1},{"time":71.33333333333334,"length":0.6666666666666643,"value":2},{"time":72,"length":2,"value":1},{"time":74,"length":0.6666666666666643,"value":2},{"time":74.66666666666666,"length":0.6666666666666714,"value":1},{"time":75.33333333333333,"length":1.3333333333333286,"value":2.1000000000000014},{"time":76.66666666666666,"length":0.6666666666666714,"value":0.5},{"time":77.33333333333333,"length":0.6666666666666643,"value":7},{"time":78,"length":1.3333333333333357,"value":3},{"time":79.33333333333334,"length":0.6666666666666714,"value":1},{"time":80.00000000000001,"length":0.6666666666666714,"value":0.9600000000000006},{"time":80.66666666666669,"length":1.3333333333333144,"value":6},{"time":82,"length":0.6666666666666856,"value":10.840000000000003},{"time":82.66666666666669,"length":0.6666666666666572,"value":1},{"time":83.33333333333334,"length":1.3333333333333428,"value":3.9899999999999993},{"time":84.66666666666669,"length":0.6666666666666572,"value":4.109999999999999},{"time":85.33333333333334,"length":1.3333333333333144,"value":1},{"time":88,"length":1.3333333333333144,"value":1},{"time":90.66666666666666,"length":1.3333333333333144,"value":1},{"time":93.33333333333333,"length":1.3333333333333144,"value":1},{"time":96,"length":1.3333333333333144,"value":1},{"time":98.66666666666666,"length":1.3333333333333144,"value":1},{"time":101.33333333333333,"length":1.3333333333333144,"value":1},{"time":104,"length":1.3333333333333144,"value":1}]}],["sufferText/push",{"items":[{"time":42.666666666666664},{"time":45.33333333333333,"value":1},{"time":48,"value":2},{"time":50.666666666666664,"value":3},{"time":53.33333333333333,"value":4},{"time":56,"value":5},{"time":58.666666666666664,"value":6},{"time":61.33333333333333,"value":7},{"time":64,"value":8},{"time":66.66666666666666,"value":9},{"time":69.33333333333333,"value":10},{"time":72,"value":11},{"time":74.66666666666666,"value":12},{"time":77.33333333333333,"value":13},{"time":80,"value":14},{"time":82.66666666666666,"value":15}]}],["Condition/phaseWidth",{"items":[{"value":0.1},{"time":22.333333333333332,"length":20.333333333333332,"value":0.1,"curve":20,"speed":0.049180327868852465,"amp":0.9}]}],["Serial/enable",{"items":[{},{"time":86.66666666666666,"length":1.3333333333333428},{"time":89.33333333333333,"length":1.3333333333333428},{"time":92,"length":1.3333333333333428},{"time":94.66666666666666,"length":1.3333333333333428},{"time":97.33333333333333,"length":1.3333333333333428},{"time":100,"length":1.3333333333333428},{"time":102.66666666666666,"length":1.3333333333333428},{"time":105.33333333333333,"length":1.3333333333333428}]}],["Camera/pos/x",{"items":[{}]}],["Camera/pos/y",{"items":[{},{"time":97.33333333333333,"value":0.8799999999999999}]}],["Camera/pos/z",{"items":[{}]}],["Camera/rot/r",{"items":[{"length":4,"value":5,"curve":21,"amp":10},{"time":20.666666666666664,"length":4,"value":5,"curve":22,"amp":-2},{"time":37.33333333333333,"length":4,"value":10,"curve":23,"offset":-0.009374586224097481,"speed":0.333922345475263,"amp":-3},{"time":42.666666666666664,"value":5},{"time":48,"value":3},{"time":53.33333333333333,"value":5}]}],["Camera/rot/t",{"items":[{},{"time":21.333333333333332,"length":5.333333333333332,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":26.666666666666664,"length":5.333333333333332,"value":1.2000000000000002,"curve":23,"speed":0.2499999999999999,"amp":-0.9},{"time":32,"length":5.333333333333329,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":37.33333333333333},{"time":85.33333333333333,"length":1.3333333333333286,"value":0.2,"curve":21,"amp":0.6000000000000001},{"time":86.66666666666666,"value":0.5700000000000002},{"time":97.33333333333333,"value":-0.32}]}],["Camera/rot/p",{"items":[{},{"time":21.333333333333332,"length":5.333333333333332,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":26.666666666666664,"value":-0.9999999999999998},{"time":32,"length":5.333333333333329,"curve":23,"speed":0.2499999999999999,"amp":0.30000000000000004},{"time":37.33333333333333},{"time":85.33333333333333,"length":1.3333333333333286,"curve":21,"amp":1.6},{"time":86.66666666666666,"length":1.3333333333333428,"curve":25,"amp":6},{"time":88},{"time":97.33333333333333,"length":1.3333333333333428,"curve":25,"amp":6}]}],["Camera/roll",{"items":[{},{"time":96},{"time":97.33333333333333,"value":-0.26000000000000006},{"time":98.66825555990165}]}],["LightFirst/active",{"items":[{"length":106.66666666666666}]}],["LightPink/active",{"items":[{},{"time":42.666666666666664,"length":42.666666666666664}]}],["Sync/first/clap",{"items":[{},{"time":22.333333333333332,"length":1.3333333333333321,"curve":19},{"time":23.666666666666664,"length":1.3333333333333321,"value":1,"curve":19},{"time":24.999999999999996,"length":1.3333333333333321,"value":2,"curve":19},{"time":26.33333333333333,"length":1.3333333333333321,"value":3,"curve":19},{"time":27.66666666666666,"length":1.3333333333333321,"value":4,"curve":19},{"time":28.999999999999993,"length":1.3333333333333321,"value":5,"curve":19},{"time":30.333333333333325,"length":1.3333333333333321,"value":6,"curve":19},{"time":31.666666666666657,"length":1.3333333333333321,"value":7,"curve":19},{"time":32.999999999999986,"length":1.3333333333333321,"value":8,"curve":19},{"time":34.333333333333314,"length":1.3333333333333321,"value":9,"curve":19},{"time":35.66666666666664,"length":1.3333333333333321,"value":10,"curve":19},{"time":36.99999999999997,"length":1.3333333333333321,"value":11,"curve":19}]}]],"labels":{"zero":0},"guiSettings":{"snapTimeActive":true,"snapTimeInterval":0.1,"snapValueActive":true,"snapValueInterval":1,"snapBeatActive":true,"bpm":180,"beatOffset":0,"useBeatInGUI":true,"minimizedPrecisionTime":3,"minimizedPrecisionValue":3}} \ No newline at end of file diff --git a/src/entities/FlashyTerrain.ts b/src/entities/FlashyTerrain.ts new file mode 100644 index 0000000..b71b44a --- /dev/null +++ b/src/entities/FlashyTerrain.ts @@ -0,0 +1,79 @@ +import { Entity } from '../heck/Entity'; +import { Geometry } from '../heck/Geometry'; +import { Material } from '../heck/Material'; +import { Mesh } from '../heck/components/Mesh'; +import { Quaternion, Vector3 } from '@fms-cat/experimental'; +import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget'; +import { genPlane } from '../geometries/genPlane'; +import { quadGeometry } from '../globals/quadGeometry'; +import depthFrag from '../shaders/depth.frag'; +import flashyTerrainFrag from '../shaders/flashy-terrain.frag'; +import flashyTerrainVert from '../shaders/flashy-terrain.vert'; + +export class FlashyTerrain extends Entity { + public mesh: Mesh; + + public constructor() { + super(); + + this.transform.position = new Vector3( [ 0.0, -4.0, 0.0 ] ); + this.transform.rotation = Quaternion.fromAxisAngle( + new Vector3( [ 1.0, 0.0, 0.0 ] ), + -0.5 * Math.PI, + ); + this.transform.scale = this.transform.scale.scale( 8.0 ); + + // -- geometry --------------------------------------------------------------------------------- + const plane = genPlane(); + + const geometry = new Geometry(); + + geometry.vao.bindVertexbuffer( plane.position, 0, 3 ); + geometry.vao.bindIndexbuffer( plane.index ); + + geometry.count = plane.count; + geometry.mode = plane.mode; + geometry.indexType = plane.indexType; + + // -- materials -------------------------------------------------------------------------------- + const deferred = new Material( + flashyTerrainVert, + flashyTerrainFrag, + { + defines: [ 'DEFERRED 1' ], + initOptions: { geometry: quadGeometry, target: dummyRenderTargetFourDrawBuffers }, + }, + ); + + const depth = new Material( + flashyTerrainVert, + depthFrag, + { initOptions: { geometry: quadGeometry, target: dummyRenderTarget } }, + ); + + const materials = { deferred, depth }; + + if ( process.env.DEV ) { + if ( module.hot ) { + module.hot.accept( + [ + '../shaders/flashy-terrain.vert', + '../shaders/flashy-terrain.frag', + ], + () => { + deferred.replaceShader( flashyTerrainVert, flashyTerrainFrag ); + depth.replaceShader( flashyTerrainVert, depthFrag ); + }, + ); + } + } + + // -- mesh ------------------------------------------------------------------------------------- + this.mesh = new Mesh( { + geometry, + materials, + name: process.env.DEV && 'FlashyTerrain/mesh', + } ); + this.components.push( this.mesh ); + } +} diff --git a/src/entities/Serial.ts b/src/entities/Serial.ts new file mode 100644 index 0000000..38676e7 --- /dev/null +++ b/src/entities/Serial.ts @@ -0,0 +1,113 @@ +import { Blit } from '../heck/components/Blit'; +import { BufferRenderTarget } from '../heck/BufferRenderTarget'; +import { Entity } from '../heck/Entity'; +import { Material } from '../heck/Material'; +import { Quad } from '../heck/components/Quad'; +import { RenderTarget } from '../heck/RenderTarget'; +import { auto } from '../globals/automaton'; +import { dummyRenderTarget } from '../globals/dummyRenderTarget'; +import { gl } from '../globals/canvas'; +import { quadGeometry } from '../globals/quadGeometry'; +import { randomTexture } from '../globals/randomTexture'; +import quadVert from '../shaders/quad.vert'; +import serialDecodeFrag from '../shaders/serial-decode.frag'; +import serialEncodeFrag from '../shaders/serial-encode.frag'; + +export interface SerialOptions { + input: BufferRenderTarget; + target: RenderTarget; +} + +export class Serial extends Entity { + public constructor( options: SerialOptions ) { + super(); + + const entityBypass = new Entity(); + entityBypass.visible = false; + this.children.push( entityBypass ); + + const entityMain = new Entity(); + entityMain.active = false; + entityMain.visible = false; + this.children.push( entityMain ); + + // -- bypass ----------------------------------------------------------------------------------- + entityBypass.components.push( new Blit( { + src: options.input, + dst: options.target, + name: 'Serial/blitBypass', + } ) ); + + // -- encode ----------------------------------------------------------------------------------- + const bufferEncode = new BufferRenderTarget( { + width: 4096, + height: 240, + name: process.env.DEV && 'Serial/bufferEncode', + } ); + + const materialEncode = new Material( + quadVert, + serialEncodeFrag, + { initOptions: { geometry: quadGeometry, target: dummyRenderTarget } }, + ); + materialEncode.addUniformTexture( 'sampler0', options.input.texture ); + materialEncode.addUniformTexture( 'samplerRandom', randomTexture.texture ); + + if ( process.env.DEV ) { + if ( module.hot ) { + module.hot.accept( '../shaders/serial-encode.frag', () => { + materialEncode.replaceShader( quadVert, serialEncodeFrag ); + } ); + } + } + + entityMain.components.push( new Quad( { + target: bufferEncode, + material: materialEncode, + name: process.env.DEV && 'Serial/quadEncode', + } ) ); + + // -- decode ----------------------------------------------------------------------------------- + const bufferDecode = new BufferRenderTarget( { + width: 320, + height: 240, + name: process.env.DEV && 'Serial/bufferDecode', + } ); + + const materialDecode = new Material( + quadVert, + serialDecodeFrag, + { initOptions: { geometry: quadGeometry, target: dummyRenderTarget } }, + ); + materialDecode.addUniformTexture( 'sampler0', bufferEncode.texture ); + materialDecode.addUniformTexture( 'samplerRandom', randomTexture.texture ); + + if ( process.env.DEV ) { + if ( module.hot ) { + module.hot.accept( '../shaders/serial-decode.frag', () => { + materialDecode.replaceShader( quadVert, serialDecodeFrag ); + } ); + } + } + + entityMain.components.push( new Quad( { + target: bufferDecode, + material: materialDecode, + name: process.env.DEV && 'Serial/quadDecode', + } ) ); + + // -- blit to target ----------------------------------------------------------------------------- + entityMain.components.push( new Blit( { + src: bufferDecode, + dst: options.target, + name: 'Serial/blitTarget', + filter: gl.LINEAR, + } ) ); + + // -- auto ------------------------------------------------------------------------------------- + auto( 'Serial/enable', ( { uninit } ) => { + entityMain.active = !uninit; + entityBypass.active = !entityMain.active; + } ); + } +} diff --git a/src/geometries/genPlane.ts b/src/geometries/genPlane.ts new file mode 100644 index 0000000..ac06e62 --- /dev/null +++ b/src/geometries/genPlane.ts @@ -0,0 +1,56 @@ +import { GLCatBuffer } from '@fms-cat/glcat-ts'; +import { gl, glCat } from '../globals/canvas'; + +interface ResultGenPlane { + position: GLCatBuffer; + index: GLCatBuffer; + count: number; + mode: GLenum; + indexType: GLenum; +} + +export function genPlane( options?: { + segment?: number; +} ): ResultGenPlane { + const segment = options?.segment ?? 33; + const segmentMinusOne = segment - 1; + + const pos: number[] = []; + const ind: number[] = []; + + for ( let iY = 0; iY < segmentMinusOne; iY ++ ) { + const y = iY / segmentMinusOne * 2.0 - 1.0; + + for ( let iX = 0; iX < segmentMinusOne; iX ++ ) { + const x = iX / segmentMinusOne * 2.0 - 1.0; + const i = iX + iY * segment; + + pos.push( x, y, 0 ); + ind.push( + i, i + 1, i + segment + 1, + i, i + segment + 1, i + segment, + ); + } + pos.push( 1, y, 0 ); + } + + for ( let iX = 0; iX < segment; iX ++ ) { + const x = iX / segmentMinusOne * 2.0 - 1.0; + + pos.push( x, 1, 0 ); + } + + const position = glCat.createBuffer(); + position.setVertexbuffer( new Float32Array( pos ) ); + + const index = glCat.createBuffer(); + index.setIndexbuffer( new Uint32Array( ind ) ); + + return { + position, + index, + count: ind.length, + mode: gl.TRIANGLES, + indexType: gl.UNSIGNED_INT, + }; +} diff --git a/src/scene.ts b/src/scene.ts index 8612adc..445f866 100644 --- a/src/scene.ts +++ b/src/scene.ts @@ -10,6 +10,7 @@ import { CubemapCameraEntity } from './entities/CubemapCameraEntity'; import { Dog } from './heck/Dog'; import { Entity } from './heck/Entity'; import { EnvironmentMap } from './entities/EnvironmentMap'; +import { FlashyTerrain } from './entities/FlashyTerrain'; import { FlickyParticles } from './entities/FlickyParticles'; import { Glitch } from './entities/Glitch'; import { IBLLUT } from './entities/IBLLUT'; @@ -20,6 +21,7 @@ import { Post } from './entities/Post'; import { RTInspector } from './entities/RTInspector'; import { Raymarcher } from './entities/Raymarcher'; import { Rings } from './entities/Rings'; +import { Serial } from './entities/Serial'; import { SphereParticles } from './entities/SphereParticles'; import { SufferTexts } from './entities/SufferTexts'; import { Swap, Vector3 } from '@fms-cat/experimental'; @@ -98,10 +100,17 @@ if ( process.env.DEV && module.hot ) { } ); } -const replacerSVGTest = new EntityReplacer( () => new Condition(), 'Condition' ); +const replacerCondition = new EntityReplacer( () => new Condition(), 'Condition' ); if ( process.env.DEV && module.hot ) { module.hot.accept( './entities/Condition', () => { - replacerSVGTest.replace(); + replacerCondition.replace(); + } ); +} + +const replacerFlashyTerrain = new EntityReplacer( () => new FlashyTerrain(), 'FlashyTerrain' ); +if ( process.env.DEV && module.hot ) { + module.hot.accept( './entities/FlashyTerrain', () => { + replacerFlashyTerrain.replace(); } ); } @@ -245,9 +254,13 @@ const camera = new CameraEntity( { camera.camera.clear = [ 0.0, 0.0, 0.0, 0.0 ]; camera.components.unshift( new Lambda( { onUpdate: ( { time } ) => { - const r = auto( 'Camera/r' ); - const t = auto( 'Camera/t' ); - const p = auto( 'Camera/p' ); + const r = auto( 'Camera/rot/r' ); + const t = auto( 'Camera/rot/t' ); + const p = auto( 'Camera/rot/p' ); + const x = auto( 'Camera/pos/x' ); + const y = auto( 'Camera/pos/y' ); + const z = auto( 'Camera/pos/z' ); + const roll = auto( 'Camera/roll' ); const st = Math.sin( t ); const ct = Math.cos( t ); @@ -261,17 +274,17 @@ camera.components.unshift( new Lambda( { camera.transform.lookAt( new Vector3( [ - r * ct * sp + wubPosAmp * Math.sin( wubPosTheta ), - r * st + wubPosAmp * Math.sin( 2.0 + wubPosTheta ), - r * ct * cp + wubPosAmp * Math.sin( 4.0 + wubPosTheta ), + r * ct * sp + wubPosAmp * Math.sin( wubPosTheta ) + x, + r * st + wubPosAmp * Math.sin( 2.0 + wubPosTheta ) + y, + r * ct * cp + wubPosAmp * Math.sin( 4.0 + wubPosTheta ) + z, ] ), new Vector3( [ - wubTarAmp * Math.sin( wubTarTheta ), - wubTarAmp * Math.sin( 2.0 + wubTarTheta ), - wubTarAmp * Math.sin( 4.0 + wubTarTheta ), + wubTarAmp * Math.sin( wubTarTheta ) + x, + wubTarAmp * Math.sin( 2.0 + wubTarTheta ) + y, + wubTarAmp * Math.sin( 4.0 + wubTarTheta ) + z, ] ), undefined, - 0.02 * Math.sin( 2.74 * time ), + 0.02 * Math.sin( 2.74 * time ) + roll, ); }, name: process.env.DEV && 'main/updateCamera', @@ -306,6 +319,13 @@ const pixelSorter = new PixelSorter( { } ); dog.root.children.push( pixelSorter ); +swap.swap(); +const serial = new Serial( { + input: swap.i, + target: swap.o, +} ); +dog.root.children.push( serial ); + swap.swap(); const post = new Post( { input: swap.i, diff --git a/src/shaders/flashy-terrain.frag b/src/shaders/flashy-terrain.frag new file mode 100644 index 0000000..45f66b2 --- /dev/null +++ b/src/shaders/flashy-terrain.frag @@ -0,0 +1,40 @@ +#version 300 es + +precision highp float; + +const float TAU = 6.283185307; + +in float vInstanceId; +in vec3 vNormal; +in vec4 vPosition; +in vec4 vPositionWithoutModel; + +#ifdef DEFERRED + layout (location = 0) out vec4 fragPosition; + layout (location = 1) out vec4 fragNormal; + layout (location = 2) out vec4 fragColor; + layout (location = 3) out vec4 fragWTF; +#endif + +uniform float time; + +#pragma glslify: cyclicNoise = require( ./modules/cyclicNoise ); + +void main() { + float grid = max( + step( 0.996, cos( 16.0 * TAU * vPositionWithoutModel.x ) ), + step( 0.996, cos( 16.0 * TAU * vPositionWithoutModel.y ) ) + ); + vec2 cell = floor( 16.0 * vPositionWithoutModel.xy ); + grid = max( + grid, + smoothstep( 0.2, 0.3, cyclicNoise( vec3( cell.xy, 4.0 * time ) ).x ) + ); + + #ifdef DEFERRED + fragPosition = vPosition; + fragNormal = vec4( 0.0, 0.0, 1.0, 1.0 ); + fragColor = vec4( grid * vec3( 2.0 ), 1.0 ); + fragWTF = vec4( 0.0, 0.0, 0.0, 1 ); + #endif +} diff --git a/src/shaders/flashy-terrain.vert b/src/shaders/flashy-terrain.vert new file mode 100644 index 0000000..e64afa2 --- /dev/null +++ b/src/shaders/flashy-terrain.vert @@ -0,0 +1,30 @@ +#version 300 es + +layout (location = 0) in vec3 position; + +out vec4 vPositionWithoutModel; +out vec4 vPosition; + +uniform float time; +uniform vec2 resolution; +uniform mat4 projectionMatrix; +uniform mat4 viewMatrix; +uniform mat4 modelMatrix; +uniform mat4 normalMatrix; + +#pragma glslify: cyclicNoise = require( ./modules/cyclicNoise ); + +void main() { + vPositionWithoutModel = vec4( position, 1.0 ); + + float n = 0.5 + 0.5 * cyclicNoise( 2.0 * vPositionWithoutModel.xyz - vec3( 0.0, time, 0.0 ) ).x; + vPositionWithoutModel.z += 1.0 * n * exp( -2.0 * length( vPositionWithoutModel.xy ) ); + + vPosition = modelMatrix * vPositionWithoutModel; + + vec4 outPos = projectionMatrix * viewMatrix * vPosition; + outPos.x *= resolution.y / resolution.x; + gl_Position = outPos; + + vPosition.w = outPos.z / outPos.w; +} diff --git a/src/shaders/modules/fractSin.glsl b/src/shaders/modules/fractSin.glsl new file mode 100644 index 0000000..601fa53 --- /dev/null +++ b/src/shaders/modules/fractSin.glsl @@ -0,0 +1,5 @@ +float fractSin( float s ) { + return fract( sin( s * 114.514 ) * 1919.810 ); +} + +#pragma glslify: export(fractSin) diff --git a/src/shaders/serial-decode.frag b/src/shaders/serial-decode.frag new file mode 100644 index 0000000..e4fde18 --- /dev/null +++ b/src/shaders/serial-decode.frag @@ -0,0 +1,49 @@ +#version 300 es + +precision highp float; + +const int DECODE_ITER = 10; +const float INV_DECODE_ITER = 1.0 / float( DECODE_ITER ); +const float DECODE_PERIOD = 2.0; +const float CHROMA_AMP = 0.4; +const float PI = 3.14159265; +const float TAU = PI * 2.0; +const vec2 CHROMA_FREQ = vec2( 227.5, 120.0 ); +const mat3 YCBCR_TO_RGB = mat3( 1.0, 1.0, 1.0, 0.0, -0.344136, 1.772, 1.402, -0.714136, 0.0 ); + +#define saturate(i) clamp(i,0.,1.) +#define linearstep(a,b,x) saturate(((x)-(a))/((b)-(a))) +#define lofi(i,m) (floor((i)/(m))*(m)) + +in vec2 vUv; + +out vec4 fragColor; + +uniform float time; +uniform vec2 resolution; +uniform sampler2D sampler0; + +// https://www.shadertoy.com/view/3sKSzW +void main() { + // YCbCr + float y = 0.0; + vec2 cbcr = vec2( 0.0 ); + + // sample + vec2 sampleOffset = vec2( 1.0, 0.0 ) / CHROMA_FREQ.x * DECODE_PERIOD * INV_DECODE_ITER; + for ( int i = -DECODE_ITER / 2; i < DECODE_ITER / 2; i ++ ) { + vec2 uvt = vUv - float( i ) * sampleOffset; + float tex = texture( sampler0, uvt ).x * INV_DECODE_ITER; + y += tex; + float phase = TAU * dot( CHROMA_FREQ, uvt ); + cbcr += tex * vec2( cos( phase ), sin( phase ) ); + } + + // back to rgb + vec3 col = YCBCR_TO_RGB * vec3( + saturate( 1.2 * ( linearstep( CHROMA_AMP, 1.0 - CHROMA_AMP, y ) - 0.5 ) + 0.5 ), + PI * cbcr / CHROMA_AMP + ); + + fragColor = vec4( col, 1.0 ); +} diff --git a/src/shaders/serial-encode.frag b/src/shaders/serial-encode.frag new file mode 100644 index 0000000..d552596 --- /dev/null +++ b/src/shaders/serial-encode.frag @@ -0,0 +1,81 @@ +#version 300 es + +precision highp float; + +const int LPF_ITER = 10; +const float INV_LPF_ITER = 1.0 / float( LPF_ITER ); +const float LPF_WIDTH = 0.04; +const float CHROMA_AMP = 0.4; +const float DECODE_PERIOD = 2.0; +const float PI = 3.14159265; +const float TAU = PI * 2.0; +const float NOISE_CLUTCH = 0.1; +const vec2 CHROMA_FREQ = vec2( 227.5, 120.0 ); +const mat3 RGB_TO_YCBCR = mat3( 0.299, -0.168736, 0.5, 0.587, -0.331264, -0.418688, 0.114, 0.5, -0.081312 ); + +#define saturate(i) clamp(i,0.,1.) +#define linearstep(a,b,x) saturate(((x)-(a))/((b)-(a))) +#define lofi(i,m) (floor((i)/(m))*(m)) + +in vec2 vUv; + +out vec4 fragColor; + +uniform float time; +uniform vec2 resolution; +uniform sampler2D sampler0; + +#pragma glslify: fractSin = require( ./modules/fractSin ); +#pragma glslify: cyclicNoise = require( ./modules/cyclicNoise ); + +// https://www.shadertoy.com/view/3sKSzW +void main() { + vec2 uv = vUv; + + // prepare random noises + vec3 noise = cyclicNoise( vec3( uv, time ) ); + vec3 hnoise = cyclicNoise( vec3( vec2( 1.0, 320.0 ) * uv, 100.0 * fract( time ) ) ); + + // offsync noise + vec3 offsyncPos = vec3( vec2( 0.02, 1.0 ) * uv, 0.0 ); + offsyncPos -= vec3( 0.03, 0.2, 1.0 ) * time; + vec3 offsyncNoise = cyclicNoise( offsyncPos ); + float offsyncAmp = offsyncNoise.y * linearstep( 0.5, 1.0, offsyncNoise.x ); + offsyncAmp *= 1.0 - uv.y; + float offsyncChromaSup = 1.0 - linearstep( 0.0, 0.1, abs( offsyncAmp ) ); + + float phase = TAU * dot( CHROMA_FREQ, uv ); + + uv.x += 0.2 * offsyncAmp; + phase += CHROMA_FREQ.x * 0.05 * offsyncAmp; + + vec4 tex = saturate( texture( sampler0, uv ) ); + vec3 ycbcr = RGB_TO_YCBCR * tex.xyz; + + // chroma signal will be filtered using LPF, this time we're gonna use cheap LPF + ycbcr.yz *= 0.0; + for ( int i = 1; i < LPF_ITER; i ++ ) { + vec2 uvt = uv - vec2( INV_LPF_ITER * LPF_WIDTH * float( i ), 0.0 ); + vec4 tex = saturate( texture( sampler0, uvt ) ); + ycbcr.yz += INV_LPF_ITER * ( RGB_TO_YCBCR * tex.xyz ).yz; + } + + float signal = ycbcr.x; // y as base level + signal = mix( CHROMA_AMP, 1.0 - CHROMA_AMP, signal ); + signal += CHROMA_AMP * offsyncChromaSup * ( + ycbcr.y * cos( phase ) + + ycbcr.z * sin( phase ) + ); // cb as cosine of subcarrier + + // static noise + signal += 0.01 * ( fractSin( noise.x ) - 0.5 ); + + // high peak noise + float bump = exp( -2.0 * fract( 10.0 * hnoise.z * ( 1.0 * hnoise.x + uv.x ) ) ); + signal += 4.0 * pow( + ( 0.5 + 0.5 * hnoise.y ) * bump, + mix( 20.0, 8.0, linearstep( 0.0, 0.01, abs( offsyncAmp ) ) ) + ); + + fragColor = vec4( signal, 0.0, 0.0, 1.0 ); +} \ No newline at end of file diff --git a/src/shaders/sphere-particles-compute.frag b/src/shaders/sphere-particles-compute.frag index e7625d2..84e795c 100644 --- a/src/shaders/sphere-particles-compute.frag +++ b/src/shaders/sphere-particles-compute.frag @@ -122,7 +122,7 @@ void main() { ) { dt = time - timing; - pos = 15.0 * randomSphere( seed ); + pos = 10.0 * randomSphere( seed ); vel = 1.0 * randomSphere( seed );