Skip to content

Have Upsample low res transparent fallback to bilinear if no multi compile is specified #3223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ Shader "Hidden/HDRP/UpsampleTransparent"
float2 fullResTexelSize = _ScreenSize.zw;
float2 halfResTexelSize = 2.0f * fullResTexelSize;

#ifdef BILINEAR
return SAMPLE_TEXTURE2D_X_LOD(_LowResTransparent, s_linear_clamp_sampler, ClampAndScaleUVForBilinear(uv, halfResTexelSize), 0.0);
#elif NEAREST_DEPTH
#ifdef NEAREST_DEPTH

// The following is an implementation of NVIDIA's http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/OpacityMappingSDKWhitePaper.pdf

Expand Down Expand Up @@ -101,6 +99,10 @@ Shader "Hidden/HDRP/UpsampleTransparent"
return SAMPLE_TEXTURE2D_X_LOD(_LowResTransparent, s_point_clamp_sampler, ClampAndScaleUVForPoint(nearestUV), 0);
#endif
}
#else // BILINEAR

return SAMPLE_TEXTURE2D_X_LOD(_LowResTransparent, s_linear_clamp_sampler, ClampAndScaleUVForBilinear(uv, halfResTexelSize), 0.0);

#endif

}
Expand Down