![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Simulates a TV static effect with noise, scanlines, and color variations. More...
#include <TVStatic.h>
Public Member Functions | |
TVStatic () | |
Constructor for TVStatic. | |
void | Update (float ratio) |
Updates the animation parameters for the TV static effect. | |
Material * | GetMaterial () |
Retrieves the combined material representing the TV static effect. | |
RGBColor | GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override |
Computes the color at a given position in the material. | |
![]() | |
virtual | ~Material ()=default |
Virtual destructor for proper cleanup in derived classes. | |
Private Attributes | |
FunctionGenerator | colorWiggle1 = FunctionGenerator(FunctionGenerator::Sine, -40.0f, 20.0f, 1.95f) |
Function for animating color wiggles. | |
FunctionGenerator | colorWiggle2 = FunctionGenerator(FunctionGenerator::Sine, -10.0f, 10.0f, 0.87f) |
Secondary function for color variation. | |
FunctionGenerator | fGenMatGradient = FunctionGenerator(FunctionGenerator::Sine, 0.0f, 0.5f, 6.65f) |
Function for gradient animation. | |
RGBColor | noiseSpectrum [5] |
Spectrum for simplex noise coloring. | |
GradientMaterial< 5 > | gNoiseMat = GradientMaterial<5>(noiseSpectrum, 2.0f, false, true) |
Gradient for simplex noise material. | |
SimplexNoise< 5 > | sNoise = SimplexNoise<5>(1, &gNoiseMat) |
Simplex noise generator for TV static. | |
float | simplexNoiseDepth = 0.0f |
Depth value for simplex noise animation. | |
RGBColor | scanlineSpectrum [10] |
Spectrum for scanline effects. | |
GradientMaterial< 10 > | scanlineGradient = GradientMaterial<10>(scanlineSpectrum, 100.0f, false, false) |
Scanline gradient material. | |
ColorTest | colorTest = ColorTest(Vector2D(192.0f, 96.0f), Vector2D(140.0f, 72.0f)) |
Color test overlay. | |
CombineMaterial< 3 > | combineScanline = CombineMaterial<3>() |
Material combiner for layering effects. | |
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... | |
Simulates a TV static effect with noise, scanlines, and color variations.
The TVStatic class generates a dynamic and customizable TV static effect using a combination of simplex noise, gradient materials, scanline effects, and color overlays. The effect includes animation based on function generators and allows for layering multiple materials.
Definition at line 30 of file TVStatic.h.
|
inline |
Constructor for TVStatic.
Initializes the materials and sets up the layers for combining the noise, scanlines, and color effects.
Definition at line 74 of file TVStatic.h.
References CombineMaterial< materialCount >::AddMaterial(), Material::Base, colorTest, combineScanline, Material::Lighten, Material::Multiply, scanlineGradient, GradientMaterial< colorCount >::SetRotationAngle(), and sNoise.
|
virtual |
Retrieves the combined material representing the TV static effect.
Implements AnimatedMaterial.
Definition at line 17 of file TVStatic.cpp.
References combineScanline.
|
overridevirtual |
Computes the color at a given position in the material.
This method combines the noise, scanline, and color test effects to generate the final color.
position | The position in 3D space. |
normal | The surface normal vector. |
uvw | The texture coordinates. |
Implements Material.
Definition at line 21 of file TVStatic.cpp.
References combineScanline, and CombineMaterial< materialCount >::GetRGB().
Updates the animation parameters for the TV static effect.
ratio | The elapsed time ratio for updating animations. |
Implements AnimatedMaterial.
Definition at line 3 of file TVStatic.cpp.
References colorTest, colorWiggle1, colorWiggle2, gNoiseMat, GradientMaterial< colorCount >::GradientShift(), GradientMaterial< colorCount >::HueShift(), Mathematics::Map(), scanlineGradient, GradientMaterial< colorCount >::SetGradientPeriod(), SimplexNoise< colors >::SetScale(), SimplexNoise< colors >::SetZPosition(), simplexNoiseDepth, sNoise, and FunctionGenerator::Update().
Referenced by UnicornZhenjaAnimation::Update().
Color test overlay.
Definition at line 64 of file TVStatic.h.
Referenced by TVStatic(), and Update().
|
private |
Function for animating color wiggles.
Definition at line 32 of file TVStatic.h.
Referenced by Update().
|
private |
Secondary function for color variation.
Definition at line 33 of file TVStatic.h.
Referenced by Update().
|
private |
Material combiner for layering effects.
Definition at line 65 of file TVStatic.h.
Referenced by GetMaterial(), GetRGB(), and TVStatic().
|
private |
Function for gradient animation.
Definition at line 34 of file TVStatic.h.
|
private |
Gradient for simplex noise material.
Definition at line 44 of file TVStatic.h.
Referenced by Update().
|
private |
|
private |
Scanline gradient material.
Definition at line 62 of file TVStatic.h.
Referenced by TVStatic(), and Update().
|
private |
Spectrum for scanline effects.
Definition at line 49 of file TVStatic.h.
|
private |
Depth value for simplex noise animation.
Definition at line 47 of file TVStatic.h.
Referenced by Update().
|
private |
Simplex noise generator for TV static.
Definition at line 45 of file TVStatic.h.
Referenced by TVStatic(), and Update().