Skip to content

Releases: stalomeow/StarRailNPRShader

Ver 2.8.0

03 Jul 18:39
d6dc38b
Compare
Choose a tag to compare

Image Sequence_006_0000

↑↑↑ Rendering Result ↑↑↑

Ver 2.7.1

27 Apr 13:25
ba2ae52
Compare
Choose a tag to compare

Fix characters-only bloom when MSAA is on.

Ver 2.7.0

24 Apr 11:06
0f51363
Compare
Choose a tag to compare
  • No longer depend on Shader Utils for SRP package.
  • Support rim-shadow.
  • Simplify materials.

  • 不再依赖 Shader Utils for SRP
  • 支持 rim-shadow。
  • 简化材质。

Ver 2.6.0

03 Apr 12:43
d4a6ad7
Compare
Choose a tag to compare
  • Support Rendering Layers
  • Bloom no longer needs MRT
  • Bloom has a new Characters Only option. When it is turned on, Bloom is applied only to the characters. When it is turned off, Bloom is applied to the entire screen
  • RimLight can interact with lights
  • RimLight mixes Fresnel on the original basis, which is controlled by EdgeSoftness and can achieve the transition from dark to light
  • Rename StarRailForward to Honkai Star Rail

  • 支持 Rendering Layers
  • Bloom 不再需要 MRT
  • Bloom 新增 Characters Only 选项。开启时 Bloom 仅应用于角色。关闭后 Bloom 应用于整个画面
  • RimLight 可以与光源交互
  • RimLight 在原有基础上混合了菲涅尔,用 EdgeSoftness 来控制,可以实现由暗到亮的过渡
  • StarRailForward 改名为 Honkai Star Rail

Ver 2.5.2

13 Mar 12:03
f49373c
Compare
Choose a tag to compare
  • Support SceneVisibility.
  • Support SRPBatcher after Build.
  • Use Burst and JobSystem to optimize per-object shadow.
  • Automatically add StarRailCharacterRenderingController to character models.

Ver 2.5.1

08 Mar 16:23
6bd8a19
Compare
Choose a tag to compare
  • Fix hdr.

Ver 2.5.0

07 Mar 16:18
9a9ca53
Compare
Choose a tag to compare

Notable Changes

Automatically generate materials

auto-generate-material

Character rendering controller

character-rendering-controller

Miscellaneous

  • Rewrite documentation.
  • Change the default path pattern of avatar model to Avatar_*_*.fbx | Art_*_*.fbx.
  • Deprecate SyncMMDHeadBone and PerObjectShadowCaster.

自动生成材质

auto-generate-material

角色渲染控制器

character-rendering-controller

杂项

  • 重写文档。
  • 修改角色模型的默认路径模式为 Avatar_*_*.fbx | Art_*_*.fbx
  • 弃用 SyncMMDHeadBonePerObjectShadowCaster

Ver 2.4.0

05 Mar 05:21
b254e6e
Compare
Choose a tag to compare

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.

_asset_processor

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);

渲染路径

现在同时支持 ForwardForward+

新资产处理器

整合了 unity preset 系统并且完全可配置。

_asset_processor

更多信息,请看 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

01 Mar 16:42
e9a6e51
Compare
Choose a tag to compare

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.

_hsr_mat_viewer

Shadow

The shadows of the scene and characters are now separated. Characters can now receive only scene shadows and ignore self-shadows.

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.

_per_obj_shadow

New bloom implementation

  • Use dynamic and larger Gaussian kernels.
  • Use atlas to reduce RT switch.

bloom

bloom_atlas

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 的赋值支持得不好。

_hsr_mat_viewer

阴影

角色和场景的阴影现在被分开了。角色现在可以只接受场景阴影并忽略自阴影。

shadows

对角色的逐物体阴影

在角色的根物体上添加 PerObjectShadowCaster 组件。它支持同屏最多 16 个阴影。

_per_obj_shadow

新的 Bloom 实现

  • 使用了动态的,更大的高斯核。
  • 使用了图集,减少 RT 切换。

bloom

bloom_atlas

杂项

  • 更少的限制
  • DepthNormals pass
  • MotionVectors pass
  • 对雾的支持
  • FaceMask shader
  • 混合额外光的漫反射时,保留亮度(灵感来自 @NoiRC256 's fork)
  • 在 README 中提供了该管线的大致流程图