

const vec2 shadowOffsets[6] = vec2[6](vec2(0.5303, 0.5303), vec2(-0.6250, -0.0000), vec2(0.3536, -0.3536),
                                      vec2(-0.0000, 0.3750), vec2(-0.1768, -0.1768), vec2(0.1250, 0.0000));
float phaseg2(float x, float g)
{
    float gg = g * g;
    return (gg * -0.25 + 0.25) * pow(-2.0 * (g * x) + (gg + 1.0), -1.5) / PI;
}

float shadowFunc_no_shadow(float diffuseSun, float sssAmount, vec3 p3, float noise, vec2 lightmap, vec3 normals, float ao)
{

    float angleFactor = dot(normalize(normals), lightPos);
    float phaseFactor = mix(max(phaseg2(angleFactor, 0.45) * 1.5, PI * phaseg2(angleFactor, 0.1)) * PI, diffuseSun, 0.35) * 0.25;

    diffuseSun = mix(diffuseSun, phaseFactor, float(sssAmount > 0.0));

    float shading = pow(lightmap.y, 16) * ao;

    diffuseSun = min(diffuseSun, shading) * lightmap.y;
    diffuseSun = mix(0.0, diffuseSun, shadowblend);

    diffuseSun *= lightmap.y * (1 - rainStrength * 0.9);
    return diffuseSun;
}
