Defines | Functions

texutil.h File Reference

#include "coreexp.h"
#include "point2.h"
#include "point3.h"
#include "acolor.h"

Go to the source code of this file.

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

Definition at line 60 of file texutil.h.

#define NOISE (   p )    ((1.0f+noise3DS(p))*.5f)

Definition at line 78 of file texutil.h.

#define MAX_CELL_LEVELS   20

Definition at line 93 of file texutil.h.


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]

Definition at line 71 of file texutil.h.

{ return ((int)(x) - ((int)(x)>(x)? 1:0)); }
float frac ( float  x ) [inline]

Definition at line 73 of file texutil.h.

{ return x - (float)FLOOR(x); }
float fmax ( float  x,
float  y 
) [inline]

Definition at line 74 of file texutil.h.

{ return x>y?x:y;   }
float fmin ( float  x,
float  y 
) [inline]

Definition at line 75 of file texutil.h.

{ return x<y?x:y;   }
AColor AComp ( AColor  cbot,
AColor  ctop 
) [inline]

Definition at line 81 of file texutil.h.

                                              {
    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 )