fix: VFX materialize statue rendering (AlphaClip+ZWrite cutout + EMISSION define) and accumulated VFX fixes (VFX materialize 雕像渲染对齐 + 累积 VFX 修复) - #2295
Open
xiaosong1985 wants to merge 4 commits into
Conversation
- VFXAssetParser/VisualEffect 渐变烘焙改 R16G16B16A16 半精度浮点(不再 max-normalize, 保 HDR 强度); writeRenderData 端配套 clamp(0,64) 直通 - VisualEffect.processInitialize 重解析事件 ID(组件 initialEvent 改值后不再 no-op), initialEvent 空值回退 asset.initialEventName - VFXRenderer 移除节点级 mesh define 并集,改 _syncMeshAttrDefines 按系统材质实例 精确管理(多 mesh 能力不同时并集会让 shader 变体引用缺失顶点槽,WebGPU 建管线失败) - BlueprintPixelVertexVFX.glsl: v_TexIndex/v_NormalizedAge 声明移出 VFX_INSTANCED 守卫 注: 本日 bundle 侧新增的 rateProperty 属性驱动/属性默认值双形态/propertyOverrides 帧检测等修复的源码 backport 仍待后续(bundle 与源码差异清单见插件仓提交) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… VisualEffect(VisualEffect 支持 Texture2D/Gradient 暴露属性运行时 override——新增 setPropertyTexture/setPropertyGradient/_bindPropertyTextureToShaders,_applyPropertyOverrides 按值类型分派 string→texture、{stops}→gradient 并恢复默认,_propertyValues 加 defaultCached/defaultRawGradientStops 备份,对齐已提交的引擎 bundle)
…lus accumulated VFX system fixes (修复 materialize VFX 雕像渲染:VFXRenderer 新增 AlphaClip 渲染模式做 Alpha 裁剪+写深度对齐 Unity cutout 让雕像实心、getCustomShaderMaterial 补 EMISSION 宏让自定义 Lit 蓝图 shader 的 HDR 辉光/emissionMap 经 pbrFrag #ifdef EMISSION 生效;含 ShaderExpressionEvaluator/VFXAssetParser 等 VFX 系统累积修复) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit f07b630)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
主要修改:VFX materialize 雕像渲染对齐 Unity
UNI VFX「Energy DM」materialize 溶解雕像在 Laya 端两个根因修复(与 LayaAir_3.4 同源 cherry-pick):
半透穿透 → 实心:Unity URP 用
Transparent + _ALPHATEST_ON + ZWrite On(Alpha 裁剪 cutout,alpha 是step()二值 0/1),Laya 之前走 alpha 混合 + 不写深度 → 前后/内外面乱序混合,雕像发灰穿透。VFXRenderer.applyBlendMode新增AlphaClip模式(alpha 混合 +depthWrite=true,对齐 Unity ZWrite On),配合 shader 端 alpha test discard → 雕像实心、深度正确。HDR 辉光 / emissionMap 不渲染:自定义 Lit 蓝图 shader 已算好
inputs.emissionColor(含溶解边缘 HDR 辉光),经SurfaceShading→pbrFrag的#ifdef EMISSION color += surface.emissionColor输出,但getCustomShaderMaterial漏加EMISSION宏 → 整段 emission 被门控跳过。补上EMISSION宏(Unlit 路径不受影响;Lit 无 emission 时加 0 无害)。⭐ 通用修复,所有 VFX Lit 蓝图 shader 的 HDR 辉光/自发光都受益。本分支包含的 commit
fix:materialize VFX mesh rendering + 自定义 Lit shader emission(含 ShaderExpressionEvaluator / VFXAssetParser 等 VFX 系统累积修复)feat:VisualEffect 支持 Texture2D/Gradient 暴露属性运行时 overridevfx:引擎源码同步——HDR 渐变半精度直通 + initialEvent 重解析 + mesh define 按材质实例管理测试
UNI VFX Energy DM White/Purple 在 LayaAir 预览中实测:雕像由半透穿透变实心、溶解处出现 HDR 白色辉光块,与 Unity 参考效果对齐。
🤖 Generated with Claude Code