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