Skip to content

Commit 3e59ae5

Browse files
committed
Tweak the area light approximation
1 parent 48b8573 commit 3e59ae5

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,10 @@ float PolygonIrradiance(float4x3 L)
151151
float x = sinSqSigma;
152152
float y = cosOmega;
153153
float b = x * (0.5 + 0.5 * y); // Bilinear approximation of a sphere light
154-
float z = b * sqrt(x); // Our approximation of a rectangular light
155-
float a = f2 * b * b; // (x * b)^2
154+
float z = b * (0.5 + 0.5 * y); // Our approximation of a rectangular light
156155
float r = x * y; // The reference value for an unoccluded light
157156

158-
return max(r, lerp(a, z, saturate(h))); // Horizon fade
157+
return max(r, lerp(z * z, z, saturate(h))); // Horizon fade
159158
#endif
160159
#else
161160
// 1. ClipQuadToHorizon

0 commit comments

Comments
 (0)