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


Public Member Functions | |
| RainbowNoise () | |
| Default constructor for RainbowNoise. | |
| 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, 255, 0), RGBColor(255, 0, 0), RGBColor(0, 255, 0), RGBColor(0, 0, 255)} |
| Spectrum for the gradient. | |
| 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.
The RainbowNoise class combines simplex noise with a gradient material to produce a dynamic, colorful effect that shifts over time.
Definition at line 26 of file RainbowNoise.h.
|
inline |
Default constructor for RainbowNoise.
Definition at line 38 of file RainbowNoise.h.
|
virtual |
Retrieves the associated material.
Implements AnimatedMaterial.
Definition at line 15 of file RainbowNoise.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 RainbowNoise.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 RainbowNoise.cpp.
References fGenMatGradient, gNoiseMat, GradientMaterial< colorCount >::HueShift(), GradientMaterial< colorCount >::SetGradientPeriod(), SimplexNoise< colors >::SetScale(), SimplexNoise< colors >::SetZPosition(), simplexNoiseDepth, sNoise, and FunctionGenerator::Update().
Referenced by Menu::Update(), AphoriAnimation::Update(), ArtleckAnimationV2::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), ElGatoAnimation::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), LeonHuskyAnimation::Update(), MyntAnimation::Update(), ProtobottAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), StrawberryAnimation::Update(), TamamoAnimation::Update(), TechSaneAnimation::Update(), VesperAnimation::Update(), WaffleDaProtoAnimation::Update(), WarzoneAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), ClockAnimation::Update(), AlphaAnimation::Update(), GammaAnimation::Update(), HUB75AnimationSplit::Update(), and WS35AnimationSplit::Update().
|
private |
Function to animate gradient properties.
Definition at line 28 of file RainbowNoise.h.
Referenced by Update().
|
private |
Gradient material for simplex noise.
Definition at line 30 of file RainbowNoise.h.
Referenced by Update().
|
private |
Spectrum for the gradient.
Definition at line 29 of file RainbowNoise.h.
|
private |
Depth parameter for simplex noise.
Definition at line 32 of file RainbowNoise.h.
Referenced by Update().
|
private |
Simplex noise generator.
Definition at line 31 of file RainbowNoise.h.
Referenced by GetMaterial(), GetRGB(), and Update().