Skip to content
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

refactor: IsOutsideFrame capitalisation #797

Merged
merged 1 commit into from
Nov 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package/Shaders/Common/FrameBuffer.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions package/Shaders/Common/VR.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions package/Shaders/ISReflectionsRayTracing.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down