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