Tiled 3D Amortized Noise
A Program to Generate Infinite3D Grayscale Noise Textures with Amortized Noise
|
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 | |
CFiniteAmortizedNoise3D * | g_pFiniteAmortizedNoise = NULL |
Pointer to the finite amortized 3D noise generator. | |
CInfiniteAmortizedNoise3D * | g_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. | |
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.
cell | Pointer to array in which to store the noise. |
x | Tile column index. |
y | Tile row index. |
z | Tile sheet index. |
m0 | Largest octave. |
m1 | Smallest octave. |
n | Cell 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.
nRow | Tile row index. |
nCol | Tile column index. |
nSheet | Tile sheet index. |
m0 | Largest octave. |
m1 | Smallest octave. |
n | Cell size. |
seed | Hash function seed. |
frames | Number of 2D slices across the 3D texture to actually save. |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main.
argc | Argument count |
argv | Arguments. |
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.
cell | Pointer to array in which to store the noise. |
scale | Rescale by this to get in the range -1..1. |
n | Cell size. |
frames | Number of files to save. |
filename | Root of the file name under which to store the noise. |