Просмотр исходного кода

WIP: Getting OpenGL up to date
- Fixing refl. probe tile culling (flipped Y due to different pixel space coordinates)

BearishSun 8 лет назад
Родитель
Сommit
97aeb51353
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      Data/Raw/Engine/Shaders/TiledDeferredImageBasedLighting.bsl

+ 5 - 0
Data/Raw/Engine/Shaders/TiledDeferredImageBasedLighting.bsl

@@ -88,6 +88,11 @@ technique TiledDeferredImageBasedLighting
 		void calcTileAABB(uint2 tileId, float viewZMin, float viewZMax, out float3 center, out float3 extent)
 		{
 			uint2 pixelPos = tileId * TILE_SIZE;
+			
+			// OpenGL uses lower left for window space origin
+			#ifdef OPENGL
+				pixelPos.y = gFramebufferSize.y - pixelPos.y;
+			#endif					
 		
 			// Convert thread XY coordinates to NDC coordinates
 			float2 uvTopLeft = (pixelPos + 0.5f) / gFramebufferSize;