I will examine the project structure to see what files and dependencies we have available.
I will read package.json to check existing libraries and dependencies.
I will install lucide-react to provide icons for our weapon styles, elemental effects, playback controls, and export tools.
I will read index.html to inspect its title and setup.
I will update index.html to set an appropriate title and import Google Fonts for a game UI aesthetic.
I will read src/index.css to check existing styling rules.
I will update src/index.css to include custom font families, scrollbars, glow effects, and game UI utility classes.
I will create src/types/slash.ts to define data types for weapon types, elemental themes, visual parameters, presets, and export formats.
I will create src/data/elementsAndWeapons.ts to define the 5 elemental themes (Void, Hydro, Inferno, Thunder, Cryo) and the 5 weapon slash patterns (Katana, Claw, Spear, Scythe, Gauntlet).
I will create src/data/presets.ts featuring 10 top-tier 3A game and anime VFX presets.
I will create src/utils/soundEngine.ts using the Web Audio API to synthesize responsive 3A-style spatial audio (low-frequency gravity collapse, sharp weapon slicing, thunder crackles, ice shatters, and explosive shockwaves) without needing external audio files.
I will create src/utils/shaderGenerator.ts to dynamically generate GLSL ES shader files (.vsh, .fsh) and corresponding GameMaker Language (GML) scripts based on the user's current parameter configurations.
I will create src/components/PreviewCanvas.tsx to render real-time WebGL spatial rift distortions, chromatic aberration, Voronoi shatter debris, weapon slash networks, and elemental particles directly in the browser.
I will clean up unused imports and variables in src/components/PreviewCanvas.tsx.
I will remove the unused dt variable in src/components/PreviewCanvas.tsx.
I will remove lastFrameTime as well since time calculation is handled directly via time timestamps.
I will create src/components/WeaponAndElementSelector.tsx to let users switch between the 5 weapon slash trace styles and the 5 elemental impact themes with rich visual cards and glowing indicators.
I will create src/components/ParameterControls.tsx with categorized sliders for spatial optics, weapon slash density, Voronoi shatter scales, and game feedback settings.
I will clean up the unused imports in src/components/ParameterControls.tsx.
I will create src/components/PresetSelector.tsx to display our 10 built-in 3A presets and allow users to save, delete, export, or import custom preset recipes.
I will create src/components/CodeExporter.tsx to display real-time generated GLSL ES 1.0 shaders and GML scripts, with one-click copying, .zip download support, and an in-depth GameMaker integration guide.
I will fix the JSX arrow character entity and remove unused imports in src/components/CodeExporter.tsx.
I will replace -> with → in src/components/CodeExporter.tsx.
I will create src/components/Header.tsx with GameMaker and 3A game style branding, title banners, and quick action controls.
I will update src/App.tsx to tie together the real-time WebGL studio, the weapon & element selector, the parameter controls, the preset gallery, and the GameMaker code exporter in a responsive layout.
I will fix the inline style property name (textDecorationColor) and remove unused imports in src/App.tsx.
I will fix textDecorationColor in src/App.tsx.
I will now build the project using build_project to verify that all components, shaders, types, and styles compile and bundle without any errors.
我已经为你打造了 「GM 次元斩·着色器特效生成器与 3A 视听工作台 (GameMaker Judgment Cut FX Studio)」!
这个应用是一个兼具电影级/CG级视觉表现力、物理合成音效反馈与GameMaker 生产级着色器代码自动生成的高端交互工作台。你可以直接在网页中实时预览和自由定制任何形态、颜色和物理力场的次元斩特效,并一键将其导入至你的 2D 动作游戏(如 Metroidvania 恶魔城、像素格斗、顶视角动作游戏)中!
✨ 核心功能与特色亮点
1. ⚔️ 5大武器斩切痕迹模式 (Weapon Slash Patterns)
拒绝“单纯的几何形状”,系统为各种武器量身定制了完全不同的切线矩阵、时空网格与边缘力场:
- 🗡️ 居合太刀/剑类 (Katana - Vergil Style):复刻鬼泣 5 维吉尔经典球形高密快刀矩阵,数秒内释放多道不同曲率的交错月弧断空一闪。
- 🐾 凶残野兽/爪刃类 (Claw - Beast Rend):3~5 道平行且带有流体物理撕裂毛刺的深长血痕,具有极强的生物爆发破坏力。
- 🛡️ 战矛突刺/枪类 (Spear - Halberd Pierce):从空间中心向外极速突入的超音速放射星芒阵与穿透型破甲尖啸。
- 🌙 死神巨镰/环斩类 (Scythe - Soul Harvest):巨大而优雅的旋涡状大曲率月弧环斩,带来大尺度离心力空间抽离感。
- 👊 重拳气功/震荡类 (Gauntlet - Sonic Boom):并不是传统细长刀光,而是高高频厚重的超音速同心圆爆炸冲击波配合网格结晶碎裂。
2. 🌌 5大元素冲击特效差分 (Elemental Impact Shaders)
每种元素呈现独立的电离光谱、核心高光、晶格碎片与音效回响:
- ⚡ 虚空/时空 (Void / Classic Vergil):暗夜蓝紫时空裂缝,极亮白电光核心,高对比度时空碎块剥离。
- 🌊 深渊激浪 (Hydro Abyssal Wave):翡翠青绿与静谧冰蓝水光,高压水刃折射与深渊浪花泡沫飞溅。
- 🔥 炼狱炎阳 (Inferno Solar Eruption):高温等离子红莲,熔岩流体黑炎与白金热力空气扭曲,爆燃余烬溅射。
- ⚡ 天谴暴雷 (Thunder High-Voltage):狂雷紫金极光电浆,高频闪现的分形雷霆连锁,伴随极强空间电击震荡。
- ❄️ 绝对零度·霜星 (Cryo Glacial Shatter):瞬间冻结空间的六角镜面折射,巨大刺芒与漫天高寒白雪雾气。
3. 🎨 电影 CG 级渲染表现与全参数自由控制 (VFX Parameter Studio)
你可以在面板中自由滑动调节 14 项关键参数,所有数据都会 100% 实时同步 演算并注入到生成的 GLSL ES 代码中:
- 时空重构与光学 (Optics & Chromatic):空间扭曲/折射强度 (Distortion)、红绿蓝三原色色差分离边缘 (Chromatic Aberration/RGB Shift)、中心黑洞坍缩引力场 (Core Singularity)、HDR 泛光光圈 (Bloom Intensity)。
- 时空晶格与余烬 (Fractal Shatter & Debris):Voronoi 晶格距离场碎块密度 (Shatter Scale)、边缘混沌分形扰动度 (Fractal Chaos)、自发光抛射余烬粒子数 (Ember Density)。
- 物理尺寸与轨迹 (Scale & Traces):特效覆盖半径 (Radius: 150~600px)、持续生命周期 (Duration)、时间推移比率 (慢动作帧级调试 0.2x ~ 极速 2.0x)、刀痕密度与残影长度比。
- 合成空间音效引擎 (Web Audio API SFX):纯代码实时合成低频黑洞坍缩音、高通挥刀破空尖啸、雷鸣/碎冰/爆裂声,完全跟随屏幕点击发招!
4. 🌐 实时交互式 3A 视觉实验室 (Interactive WebGL Canvas)
- 支持任何位置发招:点击画板任意坐标即可瞬间召唤结界,支持鼠标连续疯狂点击与拖拽释放!
- 绝·多重连斩暴走开关:一键触发 Judgment Cut End (次元斩·绝),全画面连续多点连锁爆炸!
- 4种渲染通道调试视图 (View Mode Switches):一键切换观察【🌟 完整 3A 特效】、【🌀 空间折射偏移位移图】、【⚔️ 武器斩击痕迹蒙版】、【🕳️ 黑洞坍缩核心】。
- 多层场景背景切换:废墟赛场、赛博霓虹都市、暗黑古堡、测试坐标网格,清晰观察背景被黑洞强行扭曲吸拉的壮观效果!
- 预设库与分享:内置 10 款主流游戏杀招预设(如 雷神·无想一刀、阎魔刀·审判之斩 等),并支持将你的个性化调节保存为新预设或 JSON 导出/导入。
📦 一站式 GameMaker Studio 2 源码导出与实战指南
在底部的 「GameMaker 源码导出中心」,你可以一键复制或打包下载(.txt/.gml)根据当前所有选定参数实时编译而成的 4 大工程文件:
shd_dimensional_slash.vsh (GLSL ES 1.0 顶点着色器)
shd_dimensional_slash.fsh (GLSL ES 1.0 片元着色器:内含 Voronoi 晶格算法、武器刀光斜切评估算法与 gm_BaseTexture 背景折射采样)
obj_judgment_cut.gml (包含 Create 初始化、Step 屏幕摄像机震动、Draw 传递 Uniform 参数的完整对象脚本)
scr_create_dimensional_slash.gml (一键极简调用脚本)
💡 在 GameMaker 中如何在任何地方调用?
导入脚本后,在你游戏主角的动作逻辑(如按下攻击键、BOSS 终结技触发)里只需一行代码:
// 示例:在坐标 (x + 100, y) 召出一个半径 320px 的虚空太刀次元斩!
scr_create_dimensional_slash(x + 100, y, "void", "katana", 320, 0.65);
附带详细教程,教授如何利用 Draw GUI 与 GPU 加法混合 gpu_set_blendmode(bm_add) 实现真·全屏背景折射与耀目高光!
Files built: index.html, src/index.css, src/types/slash.ts, src/data/elementsAndWeapons.ts, src/data/presets.ts, src/utils/soundEngine.ts, src/utils/shaderGenerator.ts, src/components/PreviewCanvas.tsx, src/components/WeaponAndElementSelector.tsx, src/components/ParameterControls.tsx, src/components/PresetSelector.tsx, src/components/CodeExporter.tsx, src/components/Header.tsx, src/App.tsx