ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

prog_noise.c File Reference

C implementation of Perlin Simplex Noise over 1, 2, 3 and 4 dims. More...

#include "main/imports.h"
#include "prog_noise.h"

Go to the source code of this file.

Defines

#define FASTFLOOR(x)   ( ((x)>0) ? ((int)x) : (((int)x)-1) )
#define F2   0.366025403f /* F2 = 0.5*(sqrt(3.0)-1.0) */
#define G2   0.211324865f /* G2 = (3.0-Math.sqrt(3.0))/6.0 */
#define F3   0.333333333f
#define G3   0.166666667f
#define F4   0.309016994f /* F4 = (Math.sqrt(5.0)-1.0)/4.0 */
#define G4   0.138196601f /* G4 = (5.0-Math.sqrt(5.0))/20.0 */

Functions

static float grad1 (int hash, float x)
static float grad2 (int hash, float x, float y)
static float grad3 (int hash, float x, float y, float z)
static float grad4 (int hash, float x, float y, float z, float t)
GLfloat _mesa_noise1 (GLfloat x)
GLfloat _mesa_noise2 (GLfloat x, GLfloat y)
GLfloat _mesa_noise3 (GLfloat x, GLfloat y, GLfloat z)
GLfloat _mesa_noise4 (GLfloat x, GLfloat y, GLfloat z, GLfloat w)

Variables

unsigned char perm [512]
static unsigned char simplex [64][4]

Detailed Description

C implementation of Perlin Simplex Noise over 1, 2, 3 and 4 dims.

Author:
Stefan Gustavson (stegu@itn.liu.se)

This implementation is "Simplex Noise" as presented by Ken Perlin at a relatively obscure and not often cited course session "Real-Time Shading" at Siggraph 2001 (before real time shading actually took on), under the title "hardware noise". The 3D function is numerically equivalent to his Java reference code available in the PDF course notes, although I re-implemented it from scratch to get more readable code. The 1D, 2D and 4D cases were implemented from scratch by me from Ken Perlin's text.

This file has no dependencies on any other file, not even its own header file. The header file is made for use by external code only.

Definition in file prog_noise.c.


Generated on Sun May 27 2012 04:59:17 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.