// This file has been automatically generated from resource file src/Shaders/PointLightAttenuation.glsl static const char Shaders_PointLightAttenuation_glsl[] = "//! Returns point light source attenuation factor\n" "float occRangedPointLightAttenuation (in float theDistance, in float theRange)\n" "{\n" " if (theDistance <= theRange)\n" " {\n" " float aResult = theDistance / theRange;\n" " aResult *= aResult;\n" " aResult *= aResult;\n" " aResult = 1.0 - aResult;\n" " aResult = clamp(aResult, 0.0, 1.0);\n" " aResult /= max(0.0001, theDistance * theDistance);\n" " return aResult;\n" " }\n" " return -1.0;\n" "}\n" "\n" "//! Returns point light source attenuation factor with quadratic attenuation in case of zero range.\n" "float occPointLightAttenuation (in float theDistance, in float theRange)\n" "{\n" " if (theRange == 0.0)\n" " {\n" " return 1.0 / max(0.0001, theDistance * theDistance);\n" " }\n" " return occRangedPointLightAttenuation (theDistance, theRange);\n" "}\n" "\n" "//! Returns point light source attenuation factor with linear attenuation in case of zero range.\n" "float occPointLightAttenuation (in float theDistance, in float theRange, in float theLinearAttenuation, in float theConstAttenuation)\n" "{\n" " if (theRange == 0.0)\n" " {\n" " return 1.0 / (theConstAttenuation + theLinearAttenuation * theDistance);\n" " }\n" " return occRangedPointLightAttenuation (theDistance, theRange);\n" "}\n";