3 * OpenSceneGraph example, osgshaders.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 /************************************************************************
24 * Copyright (C) 2002 3Dlabs Inc. Ltd. *
26 ***********************************************************************/
28 #ifndef __ogl2_demo_h__
29 #define __ogl2_demo_h__
32 extern void SetNoiseFrequency(int frequency);
34 extern double noise1(double arg);
35 extern double noise2(double vec[2]);
36 extern double noise3(double vec[3]);
37 extern void normalize2(double vec[2]);
38 extern void normalize3(double vec[3]);
41 In what follows "alpha" is the weight when the sum is formed.
42 Typically it is 2, As this approaches 1 the function is noisier.
43 "beta" is the harmonic scaling/spacing, typically 2.
46 extern double PerlinNoise1D(double x,double alpha, double beta, int n);
47 extern double PerlinNoise2D(double x,double y,double alpha, double beta, int n);
48 extern double PerlinNoise3D(double x,double y,double z,double alpha, double beta, int n);
51 #endif // __ogl2_demo_h__