From 6d8ff3edecf5c97e72bc79a7e733aa58f053c28c Mon Sep 17 00:00:00 2001 From: Robert Dorn Date: Thu, 11 Jul 2024 13:52:07 +0200 Subject: [PATCH] fixes #746 - added uv-starts-at-top check - based on unity docs --- Runtime/Shaders/ShaderGraph/PBRHelpers.cginc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Runtime/Shaders/ShaderGraph/PBRHelpers.cginc b/Runtime/Shaders/ShaderGraph/PBRHelpers.cginc index d87dc03a4..1435ee864 100644 --- a/Runtime/Shaders/ShaderGraph/PBRHelpers.cginc +++ b/Runtime/Shaders/ShaderGraph/PBRHelpers.cginc @@ -51,6 +51,11 @@ float3 Sample4Tap(float2 uv, float lod) void SampleSceneColor_float(float2 uv, float lod, out float3 color) { + #if !UNITY_UV_STARTS_AT_TOP + if (_CameraOpaqueTexture_TexelSize.y > 0) + uv.y = 1-uv.y; + #endif + #define REQUIRE_OPAQUE_TEXTURE // seems we need to define this ourselves? HDSceneColorNode does that as well #if defined(USE_CAMERA_OPAQUE)