C4DNoise Class Reference Library » 噪声

#include <lib_noise.h>

详细描述

The noise class used for the Cinema 4D shaders.

私有成员函数

  C4DNoise ()
  ~C4DNoise ()

Alloc/Free

static C4DNoise Alloc ( Int32 seed)
static C4DNoise Alloc2 ( Int32 seed)
static void  Free ( C4DNoise *&p)

Menu Container

static BaseContainer   CreateMenuContainer ( Bool bIncludeNone=false)

Has Octaves/Absolute/Cycles

static Bool   HasOctaves ( NoiseType t)
static Bool   HasAbsolute ( NoiseType t)
static Bool   HasCycles ( NoiseType t)

杂项

static void  EvaluateSampleOffset ( NoiseType type, Float rOctaves, Float rDelta, Float &rSampleOffset)
static void  GetNoisePreview ( NoiseType t, IconData &dat, String *str=nullptr)

噪声

Float   噪声 ( NoiseType t, Bool two_d, const 向量 &p, Float time=0.0, Float octaves=4.0, Bool absolute=false, Float sampleRad=0.25, Float detailAtt=0.25, Int32 t_repeat=0)

Init Fbm

Bool   InitFbm ( Int32 lMaxOctaves, Float rLacunarity, Float h)

Private

static const UChar GetPermutationTable ()
const Float GetFBMTable ()
const Float GetValueTable ()
const Float GetImpulseTable ()
const Int32 GetTPPermutationTable ()
const NoiseGradient *  GetNoiseGradient ()
const Int32 GetPermutationTableA ()

SNoise

Float   SNoise ( 向量 p)
Float   SNoise ( 向量 p, Float t, Int32 lRepeat)

Turbulence

Float   Turbulence ( 向量 p, Float t, Float rOctaves, Bool bAbsolute, Int32 lRepeat)

Fbm/Multifractal

Float   Fbm ( 向量 p, Float t, Float rOctaves, Int32 lRepeat)
Float   RidgedMultifractal ( 向量 p, Float t, Float rOctaves, Float rOffset, Float rGain, Int32 lRepeat)

构造函数 & 析构函数文档编制

◆  C4DNoise()

C4DNoise () private

◆  ~C4DNoise()

~ C4DNoise () private

成员函数文档编制

◆  Alloc()

static C4DNoise * Alloc ( Int32   seed )
static

Allocates a noise instance. Destroy the allocated noise instance with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in] seed The noise seed.
返回
The allocated noise instance, or nullptr if the allocation failed.

◆  Alloc2()

static C4DNoise * Alloc2 ( Int32   seed )
static

Allocates a noise instance. Destroy the allocated noise instance with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

注意
This uses a different seed than Alloc() for the internal noises so that they look exactly like the old noises.
参数
[in] seed The noise seed.
返回
The allocated noise instance, or nullptr if the allocation failed.

◆  Free()

static void Free ( C4DNoise *&  p )
static

Destructs noise instances allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] p The noise instance to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  CreateMenuContainer()

static BaseContainer CreateMenuContainer ( Bool   bIncludeNone = false )
static

Creates a menu container with the different noise options available.

参数
[in] bIncludeNone Pass true to include the None option.
返回
The generated noise menu. The NoiseType IDs are used.

◆  HasOctaves()

static Bool HasOctaves ( NoiseType   t )
static

Checks if a certain noise type supports the octaves parameter.

参数
[in] t The noise type: NoiseType
返回
true if octaves is supported, otherwise false .

◆  HasAbsolute()

static Bool HasAbsolute ( NoiseType   t )
static

Checks if a certain noise type supports the absolute parameter.

参数
[in] t The noise type: NoiseType
返回
true if absolute is supported, otherwise false .

◆  HasCycles()

static Bool HasCycles ( NoiseType   t )
static

Checks if a certain noise type supports the cycles parameter.

参数
[in] t The noise type: NoiseType
返回
true if cycles is supported, otherwise false .

◆  EvaluateSampleOffset()

static void EvaluateSampleOffset ( NoiseType   type ,
Float   rOctaves ,
Float   rDelta ,
Float rSampleOffset  
)
static

Evaluates the sample offset.

参数
[in] type The noise type: NoiseType
[in] rOctaves The number of octaves.
[in] rDelta The delta.
[out] rSampleOffset Assigned the sample offset.

◆  GetNoisePreview()

static void GetNoisePreview ( NoiseType   t ,
IconData dat ,
String str = nullptr  
)
static

Generates a noise preview in dat .

参数
[in] t The noise type: NoiseType
[out] dat Filled with the noise preview.
[out] str If not nullptr then the name of the noise is assigned. The caller owns the pointed string.

◆  Noise()

Float 噪声 ( NoiseType   t ,
Bool   two_d ,
const 向量 p ,
Float   time = 0.0 ,
Float   octaves = 4.0 ,
Bool   absolute = false ,
Float   sampleRad = 0.25 ,
Float   detailAtt = 0.25 ,
Int32   t_repeat = 0  
)

Samples a 2D or 3D noise.

参数
[in] t The noise type: NoiseType
[in] two_d true for 2D sampling, false for 3D sampling.
[in] p The position.
[in] time The time.
[in] octaves The number of octaves.
[in] absolute true to return an absolute value.
[in] sampleRad The sample radius.
[in] detailAtt The detail attenuation.
[in] t_repeat Must be 2^x - 1 ,其中 x = [1..10] , i.e. one of 1 , 3 , 7 , 15 , 31 , 63 , 127 , 255 , 511 ,和 1023 .
A noise repeats itself in time every 1024 units. Using a smaller t_repeat the noise will repeat at an earlier time.
返回
The noise sample.

◆  InitFbm()

Bool InitFbm ( Int32   lMaxOctaves ,
Float   rLacunarity ,
Float   h  
)

Initializes Fractal Brownian Motion.

参数
[in] lMaxOctaves The maximum number of octaves.
[in] rLacunarity The lacunarity.
[in] h The h parameter.
返回
true if successful, otherwise false .

◆  GetFBMTable()

const Float * GetFBMTable ( )

Private .

◆  GetValueTable()

const Float * GetValueTable ( )

Private .

◆  GetImpulseTable()

const Float * GetImpulseTable ( )

Private .

◆  GetPermutationTable()

static const UChar * GetPermutationTable ( )
static

Private .

◆  GetTPPermutationTable()

const Int32 * GetTPPermutationTable ( )

Private .

◆  GetNoiseGradient()

const NoiseGradient* GetNoiseGradient ( )

Private .

◆  GetPermutationTableA()

const Int32 * GetPermutationTableA ( )

Private .

◆  SNoise() [1/2]

Float SNoise ( 向量   p )

Generates a signed noise value.

参数
[in] p The noise coordinate.
返回
A signed noise value, between -1.0 and 1.0 .

◆  SNoise() [2/2]

Float SNoise ( 向量   p ,
Float   t ,
Int32   lRepeat  
)

Generates a periodic signed noise value.

参数
[in] p The noise coordinate.
[in] t The time.
[in] lRepeat Must be 2^x - 1 ,其中 x = [1..10] , i.e. one of 1 , 3 , 7 , 15 , 31 , 63 , 127 , 255 , 511 ,和 1023 .
A noise repeats itself in time every 1024 units. Using a smaller lRepeat the noise will repeat at an earlier time.
返回
A signed noise value, between -1.0 and 1.0 .

◆  Turbulence()

Float Turbulence ( 向量   p ,
Float   t ,
Float   rOctaves ,
Bool   bAbsolute ,
Int32   lRepeat  
)

Generates a periodic turbulence value, this is a sum of multiple noises with different frequency.

参数
[in] p The noise coordinate.
[in] t The time.
[in] rOctaves The number of octaves.
[in] bAbsolute true to return an absolute value.
[in] lRepeat Must be 2^x - 1 ,其中 x = [1..10] , i.e. one of 1 , 3 , 7 , 15 , 31 , 63 , 127 , 255 , 511 ,和 1023 .
A noise repeats itself in time every 1024 units. Using a smaller lRepeat the noise will repeat at an earlier time.
返回
A turbulence value, between -1.0 and 1.0 unless bAbsolute is true , in which case it will be between 0.0 to 1.0 .

◆  Fbm()

Float Fbm ( 向量   p ,
Float   t ,
Float   rOctaves ,
Int32   lRepeat  
)

Generates a periodic Fractional Brownian Motion value.

注意
Before using this function call InitFbm() .
参数
[in] p The noise coordinate.
[in] t The time.
[in] rOctaves The number of octaves. Must not exceed the value passed to InitFbm() , but can be lower.
[in] lRepeat Must be 2^x - 1 ,其中 x = [1..10] , i.e. one of 1 , 3 , 7 , 15 , 31 , 63 , 127 , 255 , 511 ,和 1023 .
A noise repeats itself in time every 1024 units. Using a smaller lRepeat the noise will repeat at an earlier time.
返回
The Fbm value.

◆  RidgedMultifractal()

Float RidgedMultifractal ( 向量   p ,
Float   t ,
Float   rOctaves ,
Float   rOffset ,
Float   rGain ,
Int32   lRepeat  
)

Generates a periodic fractal function used for such things as landscapes or mountain ranges.

注意
Before using this function call InitFbm() .
参数
[in] p The evaluation point.
[in] t The time.
[in] rOctaves The number of octaves. Must not exceed the value passed to InitFbm() , but can be lower.
[in] rOffset The zero offset, this controls the multifractality.
[in] rGain The amplification of the fractal value.
[in] lRepeat Must be 2^x - 1 ,其中 x = [1..10] , i.e. one of 1 , 3 , 7 , 15 , 31 , 63 , 127 , 255 , 511 ,和 1023 .
A noise repeats itself in time every 1024 units. Using a smaller lRepeat the noise will repeat at an earlier time.
返回
The fractal value.