stochastic transparency improvement

This commit is contained in:
Turanszki Janos
2021-06-28 13:50:26 +02:00
parent fcd3b3e028
commit d3d42289ba
4 changed files with 9 additions and 3 deletions
+4
View File
@@ -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);
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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);