Releases: stalomeow/StarRailNPRShader
Ver 2.5.0
Notable Changes
Automatically generate materials
Character rendering controller
Miscellaneous
- Rewrite documentation.
- Change the default path pattern of avatar model to
Avatar_*_*.fbx | Art_*_*.fbx
. - Deprecate
SyncMMDHeadBone
andPerObjectShadowCaster
.
自动生成材质
角色渲染控制器
杂项
- 重写文档。
- 修改角色模型的默认路径模式为
Avatar_*_*.fbx | Art_*_*.fbx
。 - 弃用
SyncMMDHeadBone
和PerObjectShadowCaster
。
Ver 2.4.0
Notable Changes
Rendering path
Now, this package supports both Forward
and Forward+
rendering path.
New asset processor
The new asset processor integrates unity preset system and is fully configurable.
For more information, please see Documentation~/WorkingWithAssetProcessor.md
.
Bloom anti-flicker
When mipping down, sample the middle pixels to reduce flicker while preserving color saturation.
In vertex shader:
float4 texelSize = _BlitTexture_TexelSize;
float4 offset1 = float4(-0.5, -0.5, -0.5, +0.5);
float4 offset2 = float4(+0.5, -0.5, +0.5, +0.5);
uv1 = texelSize.xyxy * offset1 + output.texcoord.xyxy;
uv2 = texelSize.xyxy * offset2 + output.texcoord.xyxy;
In fragment shader:
half4 c1 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv1.xy);
half4 c2 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv1.zw);
half4 c3 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv2.xy);
half4 c4 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv2.zw);
return 0.25 * (c1 + c2 + c3 + c4);
渲染路径
现在同时支持 Forward
和 Forward+
。
新资产处理器
整合了 unity preset 系统并且完全可配置。
更多信息,请看 Documentation~/WorkingWithAssetProcessor_CN.md
。
Bloom 抗闪烁
逐级降采样时,采样中间像素以减少闪烁,同时保留颜色的饱和度。
In vertex shader:
float4 texelSize = _BlitTexture_TexelSize;
float4 offset1 = float4(-0.5, -0.5, -0.5, +0.5);
float4 offset2 = float4(+0.5, -0.5, +0.5, +0.5);
uv1 = texelSize.xyxy * offset1 + output.texcoord.xyxy;
uv2 = texelSize.xyxy * offset2 + output.texcoord.xyxy;
In fragment shader:
half4 c1 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv1.xy);
half4 c2 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv1.zw);
half4 c3 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv2.xy);
half4 c4 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, uv2.zw);
return 0.25 * (c1 + c2 + c3 + c4);
Ver 2.3.3
Breaking Changes in Recent Updates
Package Manager Support
All files are now bundled into a package that can be easily managed using Unity Package Manager.
HSRMaterialViewer
HSRMaterialViewer helps you to view material.json
files and automatically assigns some properties (though not all) of materials. Please note that applying Floats and Ints is not well supported by this tool.
Shadow
The shadows of the scene and characters are now separated. Characters can now receive only scene shadows and ignore self-shadows.
Per-Object Shadow for Character
Add the PerObjectShadowCaster
component to the root object of a character. It supports up to 16 shadows on the same screen.
New bloom implementation
- Use dynamic and larger Gaussian kernels.
- Use atlas to reduce RT switch.
Miscellaneous
- Less restrictions
- DepthNormals pass
- MotionVectors pass
- Fog support
- FaceMask shader
- Preserve luminance when mixing additional light diffuse (Inspired by @NoiRC256 's fork)
- A rough flow chart of this pipeline is provided in README
包管理器支持
所有文件现在都被打成了一个包。可以方便地用 Unity Package Manager 管理。
HSRMaterialViewer
HSRMaterialViewer 能帮助你浏览 material.json
文件、自动赋值部分属性(不是全部)。这个工具对 Floats 和 Ints 的赋值支持得不好。
阴影
角色和场景的阴影现在被分开了。角色现在可以只接受场景阴影并忽略自阴影。
对角色的逐物体阴影
在角色的根物体上添加 PerObjectShadowCaster
组件。它支持同屏最多 16 个阴影。
新的 Bloom 实现
- 使用了动态的,更大的高斯核。
- 使用了图集,减少 RT 切换。
杂项
- 更少的限制
- DepthNormals pass
- MotionVectors pass
- 对雾的支持
- FaceMask shader
- 混合额外光的漫反射时,保留亮度(灵感来自 @NoiRC256 's fork)
- 在 README 中提供了该管线的大致流程图