ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
LightMaterial< lightCount > Class Template Reference

A material class that incorporates multiple light sources for rendering. More...

#include <LightMaterial.h>

Inheritance diagram for LightMaterial< lightCount >:
Collaboration diagram for LightMaterial< lightCount >:

Public Member Functions

 LightMaterial ()
 Constructs a LightMaterial object with the specified number of lights.
 
LightGetLights ()
 Retrieves the array of lights.
 
uint8_t GetLightCount ()
 Retrieves the number of lights in the material.
 
RGBColor GetRGB (const Vector3D &position, const Vector3D &normal, const Vector3D &uvw) override
 Calculates the RGB color at a specific position using the light sources.
 
- Public Member Functions inherited from Material
virtual ~Material ()=default
 Virtual destructor for proper cleanup in derived classes.
 

Private Attributes

Light lights [lightCount]
 Array of lights used for lighting calculations.
 

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

template<size_t lightCount>
class LightMaterial< lightCount >

A material class that incorporates multiple light sources for rendering.

This template-based material class allows for dynamic lighting by utilizing a fixed number of light sources. The lighting calculations take into account position, normal, and texture coordinates to determine the final color output.

Template Parameters
lightCountThe number of lights included in the material.

Definition at line 29 of file LightMaterial.h.

Constructor & Destructor Documentation

◆ LightMaterial()

template<size_t lightCount>
LightMaterial ( )

Constructs a LightMaterial object with the specified number of lights.

Member Function Documentation

◆ GetLightCount()

template<size_t lightCount>
uint8_t GetLightCount ( )

Retrieves the number of lights in the material.

Returns
The number of lights (lightCount).

◆ GetLights()

template<size_t lightCount>
Light * GetLights ( )

Retrieves the array of lights.

Returns
Pointer to the array of Light objects.

Referenced by Boot::Boot(), and Boot::Update().

◆ GetRGB()

template<size_t lightCount>
RGBColor GetRGB ( const Vector3D position,
const Vector3D normal,
const Vector3D uvw 
)
overridevirtual

Calculates the RGB color at a specific position using the light sources.

Parameters
position3D position in the scene.
normalNormal vector at the position.
uvwTexture coordinates at the position.
Returns
The calculated RGB color.

Implements Material.

Member Data Documentation

◆ lights

template<size_t lightCount>
Light lights[lightCount]
private

Array of lights used for lighting calculations.

Definition at line 31 of file LightMaterial.h.


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