stochastic transparency improvement
This commit is contained in:
@@ -85,6 +85,10 @@ inline float4 blue_noise(uint2 pixel)
|
||||
{
|
||||
return frac(texture_bluenoise[pixel % 128].rgba + g_xFrame_BlueNoisePhase);
|
||||
}
|
||||
inline float4 blue_noise(uint2 pixel, float depth)
|
||||
{
|
||||
return frac(texture_bluenoise[pixel % 128].rgba + g_xFrame_BlueNoisePhase * depth);
|
||||
}
|
||||
|
||||
// Helpers:
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ TEXTURE2D(texture_color, float4, TEXSLOT_ONDEMAND0);
|
||||
|
||||
float2 main(VertexToPixel input) : SV_TARGET
|
||||
{
|
||||
const float lineardepth = input.pos.w;
|
||||
|
||||
clip(dither(input.pos.xy + GetTemporalAASampleRotation()) - input.fade);
|
||||
|
||||
float4 color = texture_color.Sample(sampler_linear_clamp,input.tex);
|
||||
@@ -12,7 +14,7 @@ float2 main(VertexToPixel input) : SV_TARGET
|
||||
float alphatest = g_xMaterial.alphaTest;
|
||||
if (g_xFrame_Options & OPTION_BIT_TEMPORALAA_ENABLED)
|
||||
{
|
||||
alphatest = clamp(blue_noise(input.pos.xy).r, 0, 0.99);
|
||||
alphatest = clamp(blue_noise(input.pos.xy, lineardepth).r, 0, 0.99);
|
||||
}
|
||||
clip(color.a - alphatest);
|
||||
|
||||
|
||||
@@ -1373,7 +1373,7 @@ float4 main(PixelInput input, in bool is_frontface : SV_IsFrontFace) : SV_TARGET
|
||||
float alphatest = GetMaterial().alphaTest;
|
||||
if (g_xFrame_Options & OPTION_BIT_TEMPORALAA_ENABLED)
|
||||
{
|
||||
alphatest = clamp(blue_noise(pixel).r, 0, 0.99);
|
||||
alphatest = clamp(blue_noise(pixel, lineardepth).r, 0, 0.99);
|
||||
}
|
||||
clip(color.a - alphatest);
|
||||
#endif // DISABLE_ALPHATEST
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wiVersion
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 56;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 56;
|
||||
const int revision = 57;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user