Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShLibNoise.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #include "ShLib.hpp" // ShLibNoise needs to be included from within ShLib
00021 
00022 #ifndef SHLIBNOISE_HPP
00023 #define SHLIBNOISE_HPP
00024 
00025 #ifndef WIN32
00026 namespace SH {
00027 
00045 template<int N, int M, typename T>
00046 ShGeneric<N, T> hash(const ShGeneric<M, T>& p); 
00047 
00048 template<int N, int M, typename T>
00049 ShGeneric<N, T> texhash(const ShGeneric<M, T>& p); 
00050 
00051 // Returns summed octaves of cell noise 
00052 // @{
00053 template<int N, int M, typename T>
00054 ShGeneric<N, T> cellnoise(const ShGeneric<M, T> &p, bool useTexture = true);
00055 
00056 template<int N, int M, int K, typename T1, typename T2>
00057 ShGeneric<N, CT1T2> cellnoise(const ShGeneric<M, T1> &p, 
00058                               const ShGeneric<K, T2> &amp, 
00059                               bool useTexture = true);
00060 // @}
00061 
00062 // Returns summed octaves of signed cell noise 
00063 // @{
00064 template<int N, int M, typename T>
00065 ShGeneric<N, T> scellnoise(const ShGeneric<M, T> &p, bool useTexture = true);
00066 
00067 template<int N, int M, int K, typename T1, typename T2>
00068 ShGeneric<N, CT1T2> scellnoise(const ShGeneric<M, T1> &p, 
00069                                const ShGeneric<K, T2> &amp,
00070                                bool useTexture = true); 
00071 // @}
00072 // @}
00073 
00074 
00080 // Returns summed octaves of Perlin noise
00081 // @{
00082 template<int N, int M, typename T>
00083 ShGeneric<N, T> noise(const ShGeneric<M, T> &p, bool useTexture = true);
00084 
00085 template<int N, int M, int K, typename T1, typename T2>
00086 ShGeneric<N, CT1T2> noise(const ShGeneric<M, T1> &p,
00087                           const ShGeneric<K, T2> &amp,
00088                           bool useTexture = true);
00089 // @}
00090 
00091 // Returns summed octaves of signed Perlin noise
00092 // @{
00093 template<int N, int M, typename T>
00094 ShGeneric<N, T> snoise(const ShGeneric<M, T> &p, bool useTexture = true);
00095 
00096 template<int N, int M, int K, typename T1, typename T2>
00097 ShGeneric<N, CT1T2> snoise(const ShGeneric<M, T1> &p,
00098                           const ShGeneric<K, T2> &amp,
00099                           bool useTexture = true);
00100 // @}
00101 
00102 // Returns summed octaves of Perlin improved noise
00103 // @{
00104 template<int N, int M, typename T>
00105 ShGeneric<N, T> perlin(const ShGeneric<M, T> &p, bool useTexture = true);
00106 
00107 template<int N, int M, int K, typename T1, typename T2>
00108 ShGeneric<N, CT1T2> perlin(const ShGeneric<M, T1> &p,
00109                            const ShGeneric<K, T2> &amp,
00110                            bool useTexture = true);
00111 // @}
00112 
00113 // Returns summed octaves of signed Perlin improved noise
00114 // @{
00115 template<int N, int M, typename T>
00116 ShGeneric<N, T> sperlin(const ShGeneric<M, T> &p, bool useTexture = true);
00117 
00118 template<int N, int M, int K, typename T1, typename T2>
00119 ShGeneric<N, CT1T2> sperlin(const ShGeneric<M, T1> &p, 
00120                             const ShGeneric<K, T2> &amp, 
00121                             bool useTexture = true);
00122 // @}
00123 
00124 // Returns summed octaves of bilinearly interpolated cell noise 
00125 // @{
00126 template<int N, int M, typename T>
00127 ShGeneric<N, T> linnoise(const ShGeneric<M, T> &p, bool useTexture = true);
00128 
00129 template<int N, int M, int K, typename T1, typename T2>
00130 ShGeneric<N, CT1T2> linnoise(const ShGeneric<M, T1> &p, 
00131                              const ShGeneric<K, T2> &amp, 
00132                              bool useTexture = true);
00133 // @}
00134 
00135 // Returns summed octaves of bilinearly interpolated signed cell noise 
00136 // @{
00137 template<int N, int M, typename T>
00138 ShGeneric<N, T> slinnoise(const ShGeneric<M, T> &p, bool useTexture = true);
00139 
00140 template<int N, int M, int K, typename T1, typename T2>
00141 ShGeneric<N, CT1T2> slinnoise(const ShGeneric<M, T1> &p, 
00142                               const ShGeneric<K, T2> &amp,
00143                               bool useTexture = true); 
00144 // @}
00145 
00146 // Returns M octaves of turbulence in N-dimensional space (currently 1 <= N <= 4,
00147 // 1 <= M <= 2, 1 <= K <= 4 is supported)
00148 // The ith octave has double the frequency of the (i-1)th octave and 
00149 // is weighted by amp(i).
00150 // 
00151 // The maximum M size supported is determined by the color depth of the noise texture.
00152 // The reason it is set at 2 right now is  
00153 //
00154 // useTexture determines whether procedureal hash is used or texture lookup
00155 // @{
00156 template<int N, int M, typename T>
00157 ShGeneric<N, T> turbulence(const ShGeneric<M, T> &p, bool useTexture = true);
00158 
00159 template<int N, int M, int K, typename T1, typename T2>
00160 ShGeneric<N, CT1T2> turbulence(const ShGeneric<M, T1> &p, 
00161                                const ShGeneric<K, T2> &amp, 
00162                                bool useTexture = true);
00163 // @}
00164 
00168 template<int N, int M, typename T>
00169 ShGeneric<N, T> sturbulence(const ShGeneric<M, T> &p, bool useTexture = true);
00170 
00171 template<int N, int M, int K, typename T1, typename T2>
00172 ShGeneric<N, CT1T2> sturbulence(const ShGeneric<M, T1> &p,
00173                                 const ShGeneric<K, T2> &amp, 
00174                                 bool useTexture = true);
00175 // @}
00176 
00177 // @}
00178 
00179 } // namespace SH
00180 #endif // WIN32
00181 
00182 #include "ShLibNoiseImpl.hpp"
00183 
00184 #endif // SHLIBNOISE_HPP

Generated on Thu Jul 28 17:33:03 2005 for Sh by  doxygen 1.4.3-20050530