I was making a shader for a vortex effect on the screen.
This is the correct result.
It seems that when the UV value input to the “URP Sampler Buffer” node reaches the upper limit of 1, sampling fails and the image is drawn black.
There are black area on the top right and bottom right.
The current workaround for this is to clamp the UV and set the upper limit to less than 1, such as 0.9999.
Alternatively, I was able to solve the problem by using SamplerTexure2D instead of the URP Sampler Buffer.
The shader code generated by the “URP Sampler Buffer” is as follows.
float4 Unity_Universal_SampleBuffer_BlitSource_float(float2 uv)
{
uint2 pixelCoords = uint2(uv * _ScreenSize.xy);
return LOAD_TEXTURE2D_X_LOD(_BlitTexture, pixelCoords, 0);
}
When calculating pixel coordinates from uvs and texture size, I think you need to subtract the texture size by 1.
uv * (_ScreenSize.xy-1)
Alternatively, I think it would be simpler to use the uv value as is, without converting uv to pixelCoords.
A similar problem has been pointed out in this thread.
It would also be better if users could set a “Samper State” for the “URP Sampler Buffer”.