texutil.h File Reference
 
 
 
texutil.h File Reference
#include "coreexp.h"
#include "point2.h"
#include "point3.h"
#include "acolor.h"

Defines

#define  MAX_OCTAVES   50
#define  NOISE(p)   ((1.0f+noise3DS(p))*.5f)
#define  MAX_CELL_LEVELS   20

Functions

CoreExport float  bias (float a, float b)
CoreExport float  gain (float a, float b)
CoreExport float  clamp (float x, float a, float b)
CoreExport float  boxstep (float a, float b, float x)
CoreExport float  smoothstep (float a, float b, float x)
CoreExport float  mod (float x, float m)
CoreExport int  mod (int x, int m)
CoreExport float  sramp (float x, float a, float b, float d)
CoreExport float  threshold (float x, float a, float b)
CoreExport void  setdebug (int i)
CoreExport float  noise1 (float arg)
CoreExport float  noise2 (Point2 p)
CoreExport float  noise3 (Point3 p)
CoreExport float  noise4 (Point3 p, float time)
CoreExport float  noise3DS (Point3 p)
CoreExport float  turbulence (Point3 &p, float freq)
CoreExport int  Perm (int v)
CoreExport float  fBm1 (float point, float H, float lacunarity, float octaves)
CoreExport float  fBm1 (Point2 point, float H, float lacunarity, float octaves)
CoreExport float  fBm1 (Point3 point, float H, float lacunarity, float octaves)
CoreExport float  spline (float x, int nknots, float *knot)
CoreExport Color  color_spline (float x, int nknots, Color *knot)
int  FLOOR (float x)
float  frac (float x)
float  fmax (float x, float y)
float  fmin (float x, float y)
AColor  AComp (AColor cbot, AColor ctop)
CoreExport void  CellFunction (Point3 v, int n, float *dist, int *celIDs=NULL, Point3 *grads=NULL, float gradSmooth=0.0f)
CoreExport void  FractalCellFunction (Point3 v, float iterations, float lacunarity, int n, float *dist, int *celIDs=NULL, Point3 *grads=NULL, float gradSmooth=0.0f)
CoreExport float  RandFromCellID (int id)

Define Documentation

#define MAX_OCTAVES   50
#define NOISE (   p )    ((1.0f+noise3DS(p))*.5f)
#define MAX_CELL_LEVELS   20

Function Documentation

CoreExport float bias ( float  a,
float  b 
)
CoreExport float gain ( float  a,
float  b 
)
CoreExport float clamp ( float  x,
float  a,
float  b 
)
CoreExport float boxstep ( float  a,
float  b,
float  x 
)
CoreExport float smoothstep ( float  a,
float  b,
float  x 
)
CoreExport float mod ( float  x,
float  m 
)
CoreExport int mod ( int  x,
int  m 
)
CoreExport float sramp ( float  x,
float  a,
float  b,
float  d 
)
CoreExport float threshold ( float  x,
float  a,
float  b 
)
CoreExport void setdebug ( int  i )
CoreExport float noise1 ( float  arg )
CoreExport float noise2 ( Point2  p )
CoreExport float noise3 ( Point3  p )
CoreExport float noise4 ( Point3  p,
float  time 
)
CoreExport float noise3DS ( Point3  p )
CoreExport float turbulence ( Point3 p,
float  freq 
)
CoreExport int Perm ( int  v )
CoreExport float fBm1 ( float  point,
float  H,
float  lacunarity,
float  octaves 
)
CoreExport float fBm1 ( Point2  point,
float  H,
float  lacunarity,
float  octaves 
)
CoreExport float fBm1 ( Point3  point,
float  H,
float  lacunarity,
float  octaves 
)
CoreExport float spline ( float  x,
int  nknots,
float *  knot 
)
CoreExport Color color_spline ( float  x,
int  nknots,
Color knot 
)
int FLOOR ( float  x ) [inline]
{ return ((int)(x) - ((int)(x)>(x)? 1:0)); }
float frac ( float  x ) [inline]
{ return x - (float)FLOOR(x); }
float fmax ( float  x,
float  y 
) [inline]
{ return x>y?x:y;       }
float fmin ( float  x,
float  y 
) [inline]
{ return x<y?x:y;       }
AColor AComp ( AColor  cbot,
AColor  ctop 
) [inline]
                                              {
        float ia = 1.0f - ctop.a;
        return (ctop + ia*cbot);
        }
CoreExport void CellFunction ( Point3  v,
int  n,
float *  dist,
int *  celIDs = NULL,
Point3 grads = NULL,
float  gradSmooth = 0.0f 
)
CoreExport void FractalCellFunction ( Point3  v,
float  iterations,
float  lacunarity,
int  n,
float *  dist,
int *  celIDs = NULL,
Point3 grads = NULL,
float  gradSmooth = 0.0f 
)
CoreExport float RandFromCellID ( int  id )