Pārlūkot izejas kodu

Fixing G buffer depth sampling by properly flipping the Y axis on Vulkan

BearishSun 9 gadi atpakaļ
vecāks
revīzija
d4b478ed42
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      Source/RenderBeast/Source/BsRendererCamera.cpp

+ 2 - 1
Source/RenderBeast/Source/BsRendererCamera.cpp

@@ -235,7 +235,8 @@ namespace bs
 		clipToUVScaleOffset.z = viewport->getX() / rtWidth + (halfWidth + rapiInfo.getHorizontalTexelOffset()) / rtWidth;
 		clipToUVScaleOffset.z = viewport->getX() / rtWidth + (halfWidth + rapiInfo.getHorizontalTexelOffset()) / rtWidth;
 		clipToUVScaleOffset.w = viewport->getY() / rtHeight + (halfHeight + rapiInfo.getVerticalTexelOffset()) / rtHeight;
 		clipToUVScaleOffset.w = viewport->getY() / rtHeight + (halfHeight + rapiInfo.getVerticalTexelOffset()) / rtHeight;
 
 
-		if (rapiInfo.getUVYAxisUp())
+		// Either of these flips the Y axis, but if they're both true they cancel out
+		if (rapiInfo.getUVYAxisUp() ^ rapiInfo.getNDCYAxisDown())
 			clipToUVScaleOffset.y = -clipToUVScaleOffset.y;
 			clipToUVScaleOffset.y = -clipToUVScaleOffset.y;
 
 
 		gPerCameraParamDef.gClipToUVScaleOffset.set(mParamBuffer, clipToUVScaleOffset);
 		gPerCameraParamDef.gClipToUVScaleOffset.set(mParamBuffer, clipToUVScaleOffset);