Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The version number for this package has increased due to a version update of a r
- Fixing exceptions in the console when putting the SSGI in low quality mode (render graph).
- Fixed NullRef Exception when decals are in the scene, no asset is set and HDRP wizard is run.
- Fixed nan when a decal affects normals.
- Fixed issue with TAA causing bleeding of a view into another when multiple views are visible.

### Changed
- Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,30 @@
#define COMPARE_DEPTH(a, b) step(a, b)
#endif

float2 ClampAndScaleForBilinearWithCustomScale(float2 uv, float2 scale)
{
float2 maxCoord = 1.0f - _ScreenSize.zw;
return min(uv, maxCoord) * scale;
}

float3 Fetch(TEXTURE2D_X(tex), float2 coords, float2 offset, float2 scale)
{
float2 uv = (coords + offset * _ScreenSize.zw) * scale;
float2 uv = (coords + offset * _ScreenSize.zw);
uv = ClampAndScaleForBilinearWithCustomScale(uv, scale);
return SAMPLE_TEXTURE2D_X_LOD(tex, s_linear_clamp_sampler, uv, 0).xyz;
}

float4 Fetch4(TEXTURE2D_X(tex), float2 coords, float2 offset, float2 scale)
{
float2 uv = (coords + offset * _ScreenSize.zw) * scale;
float2 uv = (coords + offset * _ScreenSize.zw);
uv = ClampAndScaleForBilinearWithCustomScale(uv, scale);
return SAMPLE_TEXTURE2D_X_LOD(tex, s_linear_clamp_sampler, uv, 0);
}

float4 Fetch4Array(Texture2DArray tex, uint slot, float2 coords, float2 offset, float2 scale)
{
float2 uv = (coords + offset * _ScreenSize.zw) * scale;
float2 uv = (coords + offset * _ScreenSize.zw);
uv = ClampAndScaleForBilinearWithCustomScale(uv, scale);
return SAMPLE_TEXTURE2D_ARRAY_LOD(tex, s_linear_clamp_sampler, uv, slot, 0);
}

Expand Down