From 32a8eb68a747b8c544699937aa5a1c7630ba90be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Tue, 3 Oct 2017 09:12:09 +0200 Subject: [PATCH] Fixed bug in old PBR shader --- shaders/pbr.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaders/pbr.glsl b/shaders/pbr.glsl index 9196edc..0add433 100644 --- a/shaders/pbr.glsl +++ b/shaders/pbr.glsl @@ -23,7 +23,7 @@ float PBR_GetSpecularOld( in float cosine , in float alpha ) { float cs = cosine * cosine; float as = alpha * alpha; - return 1. / ( cosine + sqrt( cs + as - cs * as ) ); + return clamp( 1. / ( cosine + sqrt( cs + as - cs * as ) ) , 0 , 1 ); } // Precompute some of the material's properties. This is independant of the