![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A dynamic simplex noise gradient material for a flowing effect. More...
#include <FlowNoise.h>
Public Member Functions | |
FlowNoise () | |
Default constructor for FlowNoise. | |
void | SetGradient (RGBColor color, uint8_t colorIndex) |
Sets a specific gradient color. | |
void | Update (float ratio) |
Updates the material's state based on the provided time ratio. | |
Material * | GetMaterial () |
Retrieves the associated material. | |
RGBColor | GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override |
Computes the color at a given position using simplex noise. | |
![]() | |
virtual | ~Material ()=default |
Virtual destructor for proper cleanup in derived classes. | |
Private Attributes | |
FunctionGenerator | fGenMatGradientP = FunctionGenerator(FunctionGenerator::Sine, 0.25f, 1.5f, 4.35f) |
Function for gradient property modulation. | |
FunctionGenerator | fGenMatGradientX = FunctionGenerator(FunctionGenerator::Sine, 0.0f, 0.5f, 3.12f) |
Function for x-axis modulation. | |
FunctionGenerator | fGenMatGradientY = FunctionGenerator(FunctionGenerator::Sine, 0.0f, 0.5f, 1.93f) |
Function for y-axis modulation. | |
FunctionGenerator | fGenMatGradientZ = FunctionGenerator(FunctionGenerator::Sine, 0.0f, 0.5f, 4.56f) |
Function for z-axis modulation. | |
RGBColor | noiseSpectrum [2] = {RGBColor(14, 33, 160), RGBColor(236, 83, 176)} |
Gradient colors for the noise material. | |
GradientMaterial< 2 > | gNoiseMat = GradientMaterial<2>(noiseSpectrum, 2.0f, false) |
Gradient material for simplex noise. | |
SimplexNoise< 2 > | sNoise = SimplexNoise<2>(1, &gNoiseMat) |
Simplex noise generator. | |
float | simplexNoiseDepth = 0.0f |
Depth parameter for simplex noise. | |
Additional Inherited Members | |
![]() | |
enum | Method { Base , Add , Subtract , Multiply , Divide , Darken , Lighten , Screen , Overlay , SoftLight , Replace , EfficientMask , Bypass } |
Defines blending methods for combining colors. More... | |
A dynamic simplex noise gradient material for a flowing effect.
The FlowNoise class generates a gradient using simplex noise and animates the z-position over time. The result is a flowing, lava lamp-like visual effect.
Definition at line 27 of file FlowNoise.h.
|
inline |
Default constructor for FlowNoise.
Definition at line 42 of file FlowNoise.h.
|
virtual |
Retrieves the associated material.
Implements AnimatedMaterial.
Definition at line 23 of file FlowNoise.cpp.
References sNoise.
|
overridevirtual |
Computes the color at a given position using simplex noise.
position | The position in 3D space. |
normal | The surface normal vector. |
uvw | The texture coordinates. |
Implements Material.
Definition at line 27 of file FlowNoise.cpp.
References SimplexNoise< colors >::GetRGB(), and sNoise.
Sets a specific gradient color.
color | The RGB color to set. |
colorIndex | The index in the gradient array to modify. |
Definition at line 3 of file FlowNoise.cpp.
References gNoiseMat, noiseSpectrum, and GradientMaterial< colorCount >::UpdateGradient().
Referenced by ProtogenProject::UpdateFace().
Updates the material's state based on the provided time ratio.
ratio | The time ratio for animation updates. |
Implements AnimatedMaterial.
Definition at line 8 of file FlowNoise.cpp.
References fGenMatGradientP, fGenMatGradientX, fGenMatGradientY, fGenMatGradientZ, gNoiseMat, GradientMaterial< colorCount >::SetGradientPeriod(), SimplexNoise< colors >::SetScale(), SimplexNoise< colors >::SetZPosition(), simplexNoiseDepth, sNoise, and FunctionGenerator::Update().
Referenced by TechSaneAnimation::Update(), and ProtogenProject::UpdateFace().
|
private |
Function for gradient property modulation.
Definition at line 29 of file FlowNoise.h.
Referenced by Update().
|
private |
|
private |
|
private |
|
private |
Gradient material for simplex noise.
Definition at line 34 of file FlowNoise.h.
Referenced by SetGradient(), and Update().
Gradient colors for the noise material.
Definition at line 33 of file FlowNoise.h.
Referenced by SetGradient().
|
private |
Depth parameter for simplex noise.
Definition at line 36 of file FlowNoise.h.
Referenced by Update().
|
private |
Simplex noise generator.
Definition at line 35 of file FlowNoise.h.
Referenced by GetMaterial(), GetRGB(), and Update().