ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Material Class Referenceabstract

Abstract base class for rendering materials. More...

#include <Material.h>

Inheritance diagram for Material:

Public Types

enum  Method {
  Base , Add , Subtract , Multiply ,
  Divide , Darken , Lighten , Screen ,
  Overlay , SoftLight , Replace , EfficientMask ,
  Bypass
}
 Defines blending methods for combining colors. More...
 

Public Member Functions

virtual RGBColor GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw)=0
 Pure virtual function to calculate color based on surface parameters.
 
virtual ~Material ()=default
 Virtual destructor for proper cleanup in derived classes.
 

Detailed Description

Abstract base class for rendering materials.

The Material class provides a virtual interface for deriving specific material types, defining how colors are computed based on position, normals, and UVW texture coordinates. Materials also support various blending methods through the Method enumeration.

Definition at line 27 of file Material.h.

Member Enumeration Documentation

◆ Method

Defines blending methods for combining colors.

Enumerator
Base 

The base material color.

Add 

Adds colors together.

Subtract 

Subtracts colors.

Multiply 

Multiplies colors.

Divide 

Divides colors.

Darken 

Chooses the darker color.

Lighten 

Chooses the lighter color.

Screen 

Screen blending.

Overlay 

Overlay blending.

SoftLight 

Soft light blending.

Replace 

Replaces the base color.

EfficientMask 

Efficient masking method.

Bypass 

Passes through without blending.

Definition at line 33 of file Material.h.

Constructor & Destructor Documentation

◆ ~Material()

virtual ~Material ( )
virtualdefault

Virtual destructor for proper cleanup in derived classes.

Member Function Documentation

◆ GetRGB()

virtual RGBColor GetRGB ( const Vector3D position,
const Vector3D normal,
const Vector3D uvw 
)
pure virtual

Pure virtual function to calculate color based on surface parameters.

Parameters
positionThe position in 3D space.
normalThe normal vector at the position.
uvwThe UVW texture coordinates.
Returns
The computed color as RGBColor.

Implemented in AudioReactiveGradient, FlowNoise, HorizontalRainbow, Oscilloscope, RainbowNoise, RainbowNoise2, RainbowSpiral, SpectrumAnalyzer, TVStatic, CombineMaterial< materialCount >, CombineMaterial< 2 >, CombineMaterial< 3 >, CombineMaterial< 4 >, CombineMaterial< 5 >, CombineMaterial< 6 >, CombineMaterial< 8 >, Clock, TextEngine< lineCount, characterWidth >, TextEngine< 3, 12 >, TextEngine< menuRows, menuLength *menuCountEng >, DepthMaterial, GradientMaterial< colorCount >, GradientMaterial< 10 >, GradientMaterial< 2 >, GradientMaterial< 3 >, GradientMaterial< 4 >, GradientMaterial< 5 >, GradientMaterial< 6 >, GradientMaterial< colors >, Image, LightMaterial< lightCount >, LightMaterial< 6 >, NormalMaterial, SimpleMaterial, SimplexNoise< colors >, SimplexNoise< 2 >, SimplexNoise< 4 >, SimplexNoise< 5 >, SpiralMaterial, StripeMaterial, UVMap, VectorField2D, MaterialAnimator< materialCount >, MaterialAnimator< 10 >, MaterialAnimator< 15 >, MaterialAnimator< 2 >, MaterialAnimator< 20 >, MaterialAnimator< 4 >, MaterialAnimator< 5 >, MaterialAnimator< 7 >, and MaterialMask.

Referenced by Rasterizer::CheckRasterPixel(), Rasterizer::CheckRasterPixelAccel(), AudioReactiveGradient::GetRGB(), Oscilloscope::GetRGB(), SpectrumAnalyzer::GetRGB(), MaterialMask::GetRGB(), and Rasterizer::Rasterize().


The documentation for this class was generated from the following file: