Skip to content

fix: VFX setPositionMesh per-mesh vertex scale with cm-unit fallback (VFX setPositionMesh 点云按 mesh 顶点缩放 + cm-unit 兜底) (Master3.0) - #2308

Open
xiaosong1985 wants to merge 6 commits into
layabox:Master3.0from
xiaosong1985:feat/vfx-mesh-scale-master3.0
Open

fix: VFX setPositionMesh per-mesh vertex scale with cm-unit fallback (VFX setPositionMesh 点云按 mesh 顶点缩放 + cm-unit 兜底) (Master3.0)#2308
xiaosong1985 wants to merge 6 commits into
layabox:Master3.0from
xiaosong1985:feat/vfx-mesh-scale-master3.0

Conversation

@xiaosong1985

Copy link
Copy Markdown
Contributor

改动

VFX setPositionMesh 点云烘焙(VFXAssetParser.ts)支持按 mesh 顶点缩放

  • 新增 _resolveMeshScale(rawScale, uuid) + MESH_CMUNIT_FALLBACK 兜底表
  • bakeMeshSurfacePoints / bakeMeshVolumePoints(及相关点云数据函数)增加可选 scale 参数,对采样点位置乘以缩放
  • 调用点优先读转换器注入的数据驱动 meshScale.lvfx 没带时,对已知 cm-unit mesh(Unity fileScale 未应用、顶点 100x,如 Ellen.fbx)兜底 0.01

解决的问题

cm-unit 的 mesh(如 Smoke DM 火焰发射面 Ellen.fbx)顶点是 cm 量级(米级 ×100),烘成点云后 100x 过大,粒子喷到屏幕外(看不到火焰)。之前引擎用硬编码 ×0.01 兜底,会错误缩小内置 mesh(如 Capsule swarm)。本改动改为数据驱动 + 仅对已知 cm-unit mesh 兜底。

说明

  • 仅加 meshScale 串接,不改动各分支既有的采样算法(3.4 拆分版 / Master3.0 面积加权内联版各自保持)。
  • 本分支沿用 VFX 系列的累积式结构(在前序 VFX PR 之上叠加),新增内容为顶部的 meshScale commit。
  • TypeScript 转译检查通过。

xiaosong1985 and others added 6 commits June 4, 2026 12:33
…t fix(同步子模块 WebGPU device buffer destroy 幂等修复)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…r uniform 按粒子年龄采样曲线实现 per-particle alpha 淡入)

- VisualEffect: PER_PARTICLE_AGE_CURVE_UNIFORMS 集合驱动 Alpha_Multiplier,把 age 曲线拆成 times/vals 两个 vec4 uniform 传给 render shader 做分段采样;uniform 名补去全部下划线变体兜底(_evaluateShaderExpressions + 纹理 defaults 两处)
- ShaderExpressionEvaluator: SampleCurve(time=ageMedian) 走曲线时间平均 _sampleCurveAverage 近似整体亮度;_sampleCurve 改 public 供 VisualEffect 调用;抽具名常量 AGE_MEDIAN_SLOT_NAME / CURVE_AVERAGE_SAMPLE_COUNT

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…loop 重新 fire,修复 spawn 脉冲只触发一次)

VFXSpawnerSingleBurst.internalInit 恢复 this.sleeping=false。
之前为修 Infinite-loop 重复 fire 把重置完全禁用,导致有限循环(durationMode=Constant)的 SingleBurst 也只 fire 一次,底圈脉冲无法重复。
Infinite loop 因 loopDuration=-1 不重启、newLoop 只第一次 true,所以仍只 fire 一次,不会回归旧 bug。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e follow

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…调试 console.log:VFXRenderer 的 alpha-patch/strip 材质/strip 渲染路径日志、VFXAssetParser 的 runtime parse 与 sampleMesh 日志、VisualEffect.onStart 日志、VFXParticleSystem 的 strip geometry 创建与 outputPhase 日志,均为排查期临时输出,不影响运行逻辑)
…ing with cm-unit fallback (setPositionMesh 点云烘焙支持按 mesh 顶点缩放并对已知 cm-unit mesh 兜底,修复 Ellen.fbx 等 100x 点云火焰喷到屏幕外)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant