From b4a7f13326d86db82fe96b7b13cb7f1cdb3bdf33 Mon Sep 17 00:00:00 2001 From: Jere Tuliniemi Date: Wed, 23 May 2018 15:18:06 +0300 Subject: Remove the use of f for floats in shaders Task-number: QT3DS-1765 Change-Id: If398f95fba9ed409761602937c49fc2d93fe46f6 Reviewed-by: Laszlo Agocs --- res/effectlib/sampleLight.glsllib | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'res/effectlib/sampleLight.glsllib') diff --git a/res/effectlib/sampleLight.glsllib b/res/effectlib/sampleLight.glsllib index 3218cdf..8afd8e2 100644 --- a/res/effectlib/sampleLight.glsllib +++ b/res/effectlib/sampleLight.glsllib @@ -59,7 +59,7 @@ void sampleLight(in LightSource light, out vec3 opSpecular) { float att = 1.0; - if (light.position.w == 0.0f) // directional light + if (light.position.w == 0.0) // directional light { wi = normalize(light.position.xyz); #if QT3DS_ENABLE_SSM @@ -67,7 +67,7 @@ void sampleLight(in LightSource light, att *= sampleOrthographic( shadowMaps[light.shadowIdx], light.shadowControls, light.shadowView, pos, vec2(1.0, light.shadowControls.z) ); #endif } - else if (light.width > 0.01f && light.height > 0.01f) // area light + else if (light.width > 0.01 && light.height > 0.01) // area light { // This approach is based on the 1994 Tech Report by James Arvo -- // The Irradiance Jacobian for Partially Occluded Polyhedral Sources @@ -106,12 +106,12 @@ void sampleLight(in LightSource light, wi = light.position.xyz - pos; float dist = length(wi); wi = wi / dist; // == normalize(wi); - att = 1.0f / (light.constantAttenuation + (light.linearAttenuation + light.quadraticAttenuation * dist) * dist); + att = 1.0 / (light.constantAttenuation + (light.linearAttenuation + light.quadraticAttenuation * dist) * dist); /* - if (light.spotCutoff < 180.0f) // spot light + if (light.spotCutoff < 180.0) // spot light { - float spot = max(0.0f, dot(wi, -light.direction.xyz)); - att *= (spot >= cos(light.spotCutoff * PI / 180.0f)) ? pow(spot, light.spotExponent) : 0.0f; + float spot = max(0.0, dot(wi, -light.direction.xyz)); + att *= (spot >= cos(light.spotCutoff * PI / 180.0)) ? pow(spot, light.spotExponent) : 0.0; } */ #if QT3DS_ENABLE_SSM -- cgit v1.2.3