Tiled 3D Amortized Noise
A Program to Generate Infinite3D Grayscale Noise Textures with Amortized Noise
 All Classes Files Functions Variables Macros Pages
Functions | Variables
Main.cpp File Reference

Main. More...

#include <stdlib.h>
#include <stdio.h>
#include "defines.h"
#include "SaveImage.h"
#include "FiniteAmortizedNoise3D.h"
#include "InfiniteAmortizedNoise3D.h"
#include "CPUtime.h"

Functions

float Generate3DNoise (float ***cell, const int x, const int y, const int z, const int m0, const int m1, const int n)
 
void Save3DNoise (float ***cell, const int n, const int frames, float scale, char *filename)
 
void GenerateAndSave3DNoise (int nRow, int nCol, int nSheet, const int m0, const int m1, const int n, const int seed, const int frames)
 
int main (int argc, char *argv[])
 

Variables

CFiniteAmortizedNoise3Dg_pFiniteAmortizedNoise = NULL
 Pointer to the finite amortized 3D noise generator.
 
CInfiniteAmortizedNoise3Dg_pInfiniteAmortizedNoise = NULL
 Pointer to the infinite amortized 3D noise generator.
 
bool g_bInfinite = true
 Whether to use infinite noise: true for infinite noise, false for finite noise.
 

Function Documentation

float Generate3DNoise ( float ***  cell,
const int  x,
const int  y,
const int  z,
const int  m0,
const int  m1,
const int  n 
)

Generate a random cell of 3D noise.

Parameters
cellPointer to array in which to store the noise.
xTile column index.
yTile row index.
zTile sheet index.
m0Largest octave.
m1Smallest octave.
nCell size.
void GenerateAndSave3DNoise ( int  nRow,
int  nCol,
int  nSheet,
const int  m0,
const int  m1,
const int  n,
const int  seed,
const int  frames 
)

Generate a cell of 3D noise and save it as an image file.

Parameters
nRowTile row index.
nColTile column index.
nSheetTile sheet index.
m0Largest octave.
m1Smallest octave.
nCell size.
seedHash function seed.
framesNumber of 2D slices across the 3D texture to actually save.
int main ( int  argc,
char *  argv[] 
)

Main.

Parameters
argcArgument count
argvArguments.
Returns
0 for success, 1 for failure
void Save3DNoise ( float ***  cell,
const int  n,
const int  frames,
float  scale,
char *  filename 
)

Save a cell of 3D noise as a set of png files.

Parameters
cellPointer to array in which to store the noise.
scaleRescale by this to get in the range -1..1.
nCell size.
framesNumber of files to save.
filenameRoot of the file name under which to store the noise.