/// <summary> /// Retrieve noise value /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <returns></returns> public override double GetValue(double x, double y, double z) { double val = Source0.GetValue(x, y, z); val *= val > Center ? AboveCenterScale : BelowCenterScale; return(val + Bias); }
/// <summary> /// Retrieve noise value /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <returns></returns> public override double GetValue(double x, double y, double z) { x = Left ? (int)Math.Floor(x) << Amount : (int)Math.Floor(x) >> Amount; y = Left ? (int)Math.Floor(y) << Amount : (int)Math.Floor(y) >> Amount; z = Left ? (int)Math.Floor(z) << Amount : (int)Math.Floor(z) >> Amount; return(Source0.GetValue(x, y, z)); }
/// <summary> /// Perform blur. /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="z"></param> /// <returns></returns> public override double GetValue(double x, double y, double z) { var self = Source0.GetValue(x, y, z); double distance = Distance; return(( self + Source0.GetValue(x, y, z + distance) + Source0.GetValue(x, y, z - distance) + Source0.GetValue(x + distance, y, z) + Source0.GetValue(x - distance, y, z) ) / 5d); }
/// <summary> /// Detect transitions in source map. /// </summary> /// <returns>Progressively higher values (-1 < value < 1) as source transitions starting at Distance.</returns> public override double GetValue(double x, double y, double z) { var self = Source0.GetValue(x, y, z); double distance = Distance; var res = ( (Source0.GetValue(x, y, z + distance) == self ? -1d : 1d) + (Source0.GetValue(x, y, z - distance) == self ? -1d : 1d) + (Source0.GetValue(x + distance, y, z) == self ? -1d : 1d) + (Source0.GetValue(x - distance, y, z) == self ? -1d : 1d) ) / 4d; // Get average return(res); }
public override double GetValue(double x, double y, double z) { return(Source0.GetValue(x / Amount, y / Amount, z / Amount)); }
public override double GetValue(double x, double y, double z) { return(Source0.GetValue(x, y, z) > Center ? 1 : -1); }