![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A dynamic horizontal rainbow gradient material. More...
#include <HorizontalRainbow.h>
Public Member Functions | |
HorizontalRainbow () | |
Default constructor for HorizontalRainbow. | |
void | Update (float ratio) |
Updates the gradient animation 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 in the gradient. | |
![]() | |
virtual | ~Material ()=default |
Virtual destructor for proper cleanup in derived classes. | |
Private Attributes | |
RGBColor | noiseSpectrum [6] = {RGBColor(255, 0, 0), RGBColor(255, 255, 0), RGBColor(0, 255, 0), RGBColor(0, 255, 255), RGBColor(0, 0, 255), RGBColor(255, 0, 255)} |
Predefined rainbow colors. | |
GradientMaterial< 6 > | gNoiseMat = GradientMaterial<6>(&noiseSpectrum[0], 2.0f, false, false) |
Gradient material for the rainbow spectrum. | |
float | positionOffset = 0.0f |
Position offset for animating the gradient. | |
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 horizontal rainbow gradient material.
The HorizontalRainbow class generates a colorful horizontal gradient using a predefined rainbow spectrum and supports dynamic animation of the gradient.
Definition at line 25 of file HorizontalRainbow.h.
|
inline |
Default constructor for HorizontalRainbow.
Definition at line 35 of file HorizontalRainbow.h.
|
virtual |
Retrieves the associated material.
Implements AnimatedMaterial.
Definition at line 11 of file HorizontalRainbow.cpp.
References gNoiseMat.
|
overridevirtual |
Computes the color at a given position in the gradient.
position | The position in 3D space. |
normal | The surface normal vector. |
uvw | The texture coordinates. |
Implements Material.
Definition at line 15 of file HorizontalRainbow.cpp.
References GradientMaterial< colorCount >::GetRGB(), and gNoiseMat.
Updates the gradient animation based on the provided time ratio.
ratio | The time ratio for animation updates. |
Implements AnimatedMaterial.
Definition at line 3 of file HorizontalRainbow.cpp.
References gNoiseMat, positionOffset, GradientMaterial< colorCount >::SetGradientPeriod(), GradientMaterial< colorCount >::SetPositionOffset(), and GradientMaterial< colorCount >::SetRotationAngle().
Referenced by SplatAnimation::Update(), UnicornZhenjaAnimation::Update(), and ProtogenProject::UpdateFace().
|
private |
Gradient material for the rainbow spectrum.
Definition at line 28 of file HorizontalRainbow.h.
Referenced by GetMaterial(), GetRGB(), and Update().
|
private |
Predefined rainbow colors.
Definition at line 27 of file HorizontalRainbow.h.
|
private |
Position offset for animating the gradient.
Definition at line 29 of file HorizontalRainbow.h.
Referenced by Update().