![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A dynamic material that creates a rainbow effect using simplex noise with black-to-color transitions. More...
#include <RainbowNoise2.h>


Public Member Functions | |
| RainbowNoise2 () | |
| Default constructor for RainbowNoise2. | |
| void | Update (float ratio) |
| Updates the material animation based on the 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 in the material. | |
Public Member Functions inherited from Material | |
| virtual | ~Material ()=default |
| Virtual destructor for proper cleanup in derived classes. | |
Private Attributes | |
| FunctionGenerator | fGenMatGradient = FunctionGenerator(FunctionGenerator::Sine, 0.0f, 0.5f, 6.65f) |
| Function to animate gradient properties. | |
| RGBColor | noiseSpectrum [4] = {RGBColor(0, 0, 0), RGBColor(255, 0, 0), RGBColor(0, 255, 0), RGBColor(0, 0, 255)} |
| Spectrum for the gradient, starting with black. | |
| GradientMaterial< 4 > | gNoiseMat = GradientMaterial<4>(noiseSpectrum, 2.0f, false) |
| Gradient material for simplex noise. | |
| SimplexNoise< 4 > | sNoise = SimplexNoise<4>(1, &gNoiseMat) |
| Simplex noise generator. | |
| float | simplexNoiseDepth = 0.0f |
| Depth parameter for simplex noise. | |
Additional Inherited Members | |
Public Types inherited from Material | |
| enum | Method { Base , Add , Subtract , Multiply , Divide , Darken , Lighten , Screen , Overlay , SoftLight , Replace , EfficientMask , Bypass } |
| Defines blending methods for combining colors. More... | |
A dynamic material that creates a rainbow effect using simplex noise with black-to-color transitions.
The RainbowNoise2 class combines simplex noise with a gradient material to produce a dynamic, colorful effect that shifts over time, starting from black.
Definition at line 26 of file RainbowNoise2.h.
|
inline |
Default constructor for RainbowNoise2.
Definition at line 38 of file RainbowNoise2.h.
|
virtual |
Retrieves the associated material.
Implements AnimatedMaterial.
Definition at line 15 of file RainbowNoise2.cpp.
References sNoise.
|
overridevirtual |
Computes the color at a given position in the material.
| position | The position in 3D space. |
| normal | The surface normal vector. |
| uvw | The texture coordinates. |
Implements Material.
Definition at line 19 of file RainbowNoise2.cpp.
References SimplexNoise< colors >::GetRGB(), and sNoise.
Updates the material animation based on the time ratio.
| ratio | The time ratio used for animation updates. |
Implements AnimatedMaterial.
Definition at line 3 of file RainbowNoise2.cpp.
References fGenMatGradient, gNoiseMat, GradientMaterial< colorCount >::HueShift(), GradientMaterial< colorCount >::SetGradientPeriod(), SimplexNoise< colors >::SetScale(), SimplexNoise< colors >::SetZPosition(), simplexNoiseDepth, sNoise, and FunctionGenerator::Update().
Referenced by ClockAnimation::Update().
|
private |
Function to animate gradient properties.
Definition at line 28 of file RainbowNoise2.h.
Referenced by Update().
|
private |
Gradient material for simplex noise.
Definition at line 30 of file RainbowNoise2.h.
Referenced by Update().
|
private |
Spectrum for the gradient, starting with black.
Definition at line 29 of file RainbowNoise2.h.
|
private |
Depth parameter for simplex noise.
Definition at line 32 of file RainbowNoise2.h.
Referenced by Update().
|
private |
Simplex noise generator.
Definition at line 31 of file RainbowNoise2.h.
Referenced by GetMaterial(), GetRGB(), and Update().