Bläddra i källkod

Disabled below horizon handling for spherical area lights as it outputs values in invalid range

BearishSun 8 år sedan
förälder
incheckning
7873f06bf2
1 ändrade filer med 9 tillägg och 7 borttagningar
  1. 9 7
      Data/Raw/Engine/Includes/LightingCommon.bslinc

+ 9 - 7
Data/Raw/Engine/Includes/LightingCommon.bslinc

@@ -107,13 +107,15 @@ mixin LightingCommon
 			// Handles parts of the area light below the surface horizon
 			// See https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf for reference
 			float sinSolidAngle = sqrt(sinSolidAngleSqrd);
-			if(unclampedNoL < sinSolidAngle)
-			{
-				// Hermite spline approximation (see reference for exact formula)
-				unclampedNoL = max(unclampedNoL, -sinSolidAngle);
-				return ((sinSolidAngle + unclampedNoL) * (sinSolidAngle + unclampedNoL)) / (4 * sinSolidAngle);
-			}
-			else
+			
+			// TODO - Below horizon handling disabled as it currently outputs incorrect values, need to find a better approximation or just use the reference implementation
+			//if(unclampedNoL < sinSolidAngle)
+			//{
+			//	// Hermite spline approximation (see reference for exact formula)
+			//	unclampedNoL = max(unclampedNoL, -sinSolidAngle);
+			//	return ((sinSolidAngle + unclampedNoL) * (sinSolidAngle + unclampedNoL)) / (4 * sinSolidAngle);
+			//}
+			//else
 				return PI * sinSolidAngleSqrd * saturate(unclampedNoL);
 		}