[PATCH] [PATCH] Clamp the light exponent at 128

Christoph Frick frick at sc-networks.com
Sun Sep 17 12:54:33 CDT 2006


When rho is quite small the values for the exponent exceed 128, which is the
maximum OpenGL accepts
---
 dlls/wined3d/device.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 34026db..e32b824 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2755,6 +2755,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl
         }
         if (rho < 0.0001) rho = 0.0001f;
         object->exponent = -0.3/log(cos(rho/2));
+	if (object->exponent > 128.0) {
+		object->exponent = 128.0;
+	}
         object->cutoff = pLight->Phi*90/M_PI;
 
         /* FIXME: Range */
-- 
1.4.2




More information about the wine-patches mailing list