Plasma Engine
2.0
Loading...
Searching...
No Matches
SimdNoise.h
1
#pragma once
2
3
#include <Foundation/SimdMath/SimdVec4i.h>
4
5
class
PL_FOUNDATION_DLL
plSimdPerlinNoise
6
{
7
public
:
8
plSimdPerlinNoise
(plUInt32 uiSeed);
9
10
plSimdVec4f
NoiseZeroToOne(
const
plSimdVec4f
& x,
const
plSimdVec4f
& y,
const
plSimdVec4f
& z, plUInt32 uiNumOctaves = 1);
11
12
private
:
13
plSimdVec4f
Noise(
const
plSimdVec4f
& x,
const
plSimdVec4f
& y,
const
plSimdVec4f
& z);
14
15
PL_FORCE_INLINE
plSimdVec4i
Permute(
const
plSimdVec4i
& v)
16
{
17
#if 0
18
plArrayPtr<plUInt8>
p = plMakeArrayPtr(m_Permutations);
19
#else
20
plUInt8* p = m_Permutations;
21
#endif
22
23
plSimdVec4i
i = v &
plSimdVec4i
(PL_ARRAY_SIZE(m_Permutations) - 1);
24
return
plSimdVec4i
(p[i.x()], p[i.y()], p[i.z()], p[i.w()]);
25
}
26
27
plUInt8 m_Permutations[256];
28
};
plArrayPtr
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition
ArrayPtr.h:37
plSimdPerlinNoise
Definition
SimdNoise.h:6
plSimdVec4f
A 4-component SIMD vector class.
Definition
SimdVec4f.h:8
plSimdVec4i
A SIMD 4-component vector class of signed 32b integers.
Definition
SimdVec4i.h:9
Code
Engine
Foundation
SimdMath
SimdNoise.h
Generated by
1.11.0