// #include "res://addons/rokojori_action_library/Runtime/Shading/Library/Light.gdshaderinc"

float fresnel( vec3 normal, vec3 view, float powerAmount )
{
  return pow( ( 1.0 - clamp( dot( normalize( normal ), normalize( view ) ), 0.0, 1.0 ) ), powerAmount );
}

float fresnelNormalized( vec3 normal, vec3 view, float powerAmount )
{
  return pow( ( 1.0 - clamp( dot( normal, view ), 0.0, 1.0 ) ), powerAmount);
}

float fresnelNormalizedFromView( vec3 viewNormal, float powerAmount )
{
  return pow( 1.0 - max( viewNormal.z, 0.0 ), powerAmount );
}

float fresnelNormalizedFromView( vec3 viewNormal )
{
  return 1.0 - max( viewNormal.z, 0.0 );
}

float fresnelNormalizedFromViewAdvanced( vec3 viewNormal, float zOffset, float powerAmount, float postScale, float postOffset )
{
  return pow( 1.0 - clamp( viewNormal.z + zOffset, 0.0, 1.0 ), powerAmount ) * postScale + postOffset;
}


