Ejemplo n.º 1
0
    /// <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);
    }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
    /// <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);
    }
Ejemplo n.º 4
0
    /// <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);
    }
Ejemplo n.º 5
0
 public override double GetValue(double x, double y, double z)
 {
     return(Source0.GetValue(x / Amount, y / Amount, z / Amount));
 }
Ejemplo n.º 6
0
 public override double GetValue(double x, double y, double z)
 {
     return(Source0.GetValue(x, y, z) > Center ? 1 : -1);
 }