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

A material that visualizes surface normals as RGB colors. More...

#include <NormalMaterial.h>

Inheritance diagram for NormalMaterial:
Collaboration diagram for NormalMaterial:

Public Member Functions

 NormalMaterial ()
 Constructs a NormalMaterial object.
 
RGBColor GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
 Calculates the RGB color based on the surface normal vector.
 
- Public Member Functions inherited from Material
virtual ~Material ()=default
 Virtual destructor for proper cleanup in derived classes.
 

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...
 

Detailed Description

A material that visualizes surface normals as RGB colors.

This class maps the components of a normal vector (x, y, z) directly to the RGB color channels, providing an intuitive representation of surface orientations.

Definition at line 25 of file NormalMaterial.h.

Constructor & Destructor Documentation

◆ NormalMaterial()

Constructs a NormalMaterial object.

Definition at line 3 of file NormalMaterial.cpp.

Member Function Documentation

◆ GetRGB()

RGBColor GetRGB ( const Vector3D position,
const Vector3D normal,
const Vector3D uvw 
)
overridevirtual

Calculates the RGB color based on the surface normal vector.

Parameters
position3D position in the scene (not used for this material).
normalNormal vector at the position, used for RGB mapping.
uvwTexture coordinates at the position (not used for this material).
Returns
The RGB color corresponding to the normal vector.

Implements Material.

Definition at line 5 of file NormalMaterial.cpp.

References Vector3D::UnitSphere().


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