From 759f0de6c192771a602ec254650a56c4df8692d0 Mon Sep 17 00:00:00 2001 From: Tim <15017472+doodlum@users.noreply.github.com> Date: Fri, 29 Nov 2024 01:16:07 +0000 Subject: [PATCH] refactor: IsOutsideFrame capitalisation --- .../Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl | 2 +- package/Shaders/Common/FrameBuffer.hlsli | 2 +- package/Shaders/Common/VR.hlsli | 8 ++++---- package/Shaders/ISReflectionsRayTracing.hlsl | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl index c71400a89..8490653a5 100644 --- a/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl +++ b/features/Dynamic Cubemaps/Shaders/DynamicCubemaps/UpdateCubemapCS.hlsl @@ -68,7 +68,7 @@ float smoothbumpstep(float edge0, float edge1, float x) float3 viewDirection = FrameBuffer::WorldToView(captureDirection, false); float2 uv = FrameBuffer::ViewToUV(viewDirection, false); - if (!FrameBuffer::isOutsideFrame(uv) && viewDirection.z < 0.0) { // Check that the view direction exists in screenspace and that it is in front of the camera + if (!FrameBuffer::IsOutsideFrame(uv) && viewDirection.z < 0.0) { // Check that the view direction exists in screenspace and that it is in front of the camera float3 color = 0.0; float3 position = 0.0; float weight = 0.0; diff --git a/package/Shaders/Common/FrameBuffer.hlsli b/package/Shaders/Common/FrameBuffer.hlsli index c93cb2f3b..00592e347 100644 --- a/package/Shaders/Common/FrameBuffer.hlsli +++ b/package/Shaders/Common/FrameBuffer.hlsli @@ -129,7 +129,7 @@ namespace FrameBuffer * @param[in] dynamicres Optional flag indicating whether dynamic resolution is applied. Default is false. * @return True if the UV coordinates are outside the frame, false otherwise. */ - bool isOutsideFrame(float2 uv, bool dynamicres = false) + bool IsOutsideFrame(float2 uv, bool dynamicres = false) { float2 max = dynamicres ? DynamicResolutionParams1.xy : float2(1, 1); return any(uv < float2(0, 0) || uv > max.xy); diff --git a/package/Shaders/Common/VR.hlsli b/package/Shaders/Common/VR.hlsli index a8816c6d2..382ac2d51 100644 --- a/package/Shaders/Common/VR.hlsli +++ b/package/Shaders/Common/VR.hlsli @@ -261,12 +261,12 @@ namespace Stereo float3 resultUV = monoUV; # ifdef VR // Check if the UV coordinates are outside the frame - if (FrameBuffer::isOutsideFrame(resultUV.xy, false)) { + if (FrameBuffer::IsOutsideFrame(resultUV.xy, false)) { // Transition to the other eye float3 otherEyeUV = ConvertMonoUVToOtherEye(resultUV, eyeIndex); // Check if the other eye's UV coordinates are within the frame - if (!FrameBuffer::isOutsideFrame(otherEyeUV.xy, false)) { + if (!FrameBuffer::IsOutsideFrame(otherEyeUV.xy, false)) { resultUV = ConvertToStereoUV(otherEyeUV, 1 - eyeIndex); fromOtherEye = true; // Indicate that the result is from the other eye } @@ -328,9 +328,9 @@ namespace Stereo bool dynamicres = false) { // Check validity for color1 - bool validColor1 = IsNonZeroColor(color1) && !FrameBuffer::isOutsideFrame(uv1.xy, dynamicres); + bool validColor1 = IsNonZeroColor(color1) && !FrameBuffer::IsOutsideFrame(uv1.xy, dynamicres); // Check validity for color2 - bool validColor2 = IsNonZeroColor(color2) && !FrameBuffer::isOutsideFrame(uv2.xy, dynamicres); + bool validColor2 = IsNonZeroColor(color2) && !FrameBuffer::IsOutsideFrame(uv2.xy, dynamicres); // Calculate alpha values float alpha1 = validColor1 ? color1.a : 0.0f; diff --git a/package/Shaders/ISReflectionsRayTracing.hlsl b/package/Shaders/ISReflectionsRayTracing.hlsl index 3c7e2a211..5fcea8b2f 100644 --- a/package/Shaders/ISReflectionsRayTracing.hlsl +++ b/package/Shaders/ISReflectionsRayTracing.hlsl @@ -55,7 +55,7 @@ float4 GetReflectionColor( prevRaySample = raySample; raySample = projPosition + (float(i) / float(iterations)) * projReflectionDirection; - if (FrameBuffer::isOutsideFrame(raySample.xy)) + if (FrameBuffer::IsOutsideFrame(raySample.xy)) return 0.0; float iterationDepth = DepthTex.SampleLevel(DepthSampler, ConvertRaySample(raySample.xy, eyeIndex), 0); @@ -126,7 +126,7 @@ float4 GetReflectionColor( float4 alpha = 0.0; // Check that the reprojected data is within the frame - if (!FrameBuffer::isOutsideFrame(reprojectedRaySample.xy)) + if (!FrameBuffer::IsOutsideFrame(reprojectedRaySample.xy)) alpha = float4(AlphaTex.SampleLevel(AlphaSampler, ConvertRaySamplePrevious(reprojectedRaySample.xy, eyeIndex), 0).xyz, 1.0); float3 reflectionColor = color + SSRParams.z * alpha.xyz * alpha.w;