float GetGrowingValue(vec4 fnParams, float x)
{
	float y = fnParams.x + fnParams.w*(x - fnParams.z);
	return min(fnParams.y, max(fnParams.x, y));
}

float saturate(float f)
{
	return clamp(f, 0.0, 1.0);
}

float fresnel(vec3 vViewDirection, vec3 vNormal)
{
	return saturate(dot(vViewDirection, vNormal));
}

#define lerp mix

#define vec4b2f(r,g,b,a) vec4(float(r)/255.0, float(g)/255.0, float(b)/255.0, float(a)/255.0)

