t
Loading...
Searching...
No Matches
t::BlinnPhong Class Reference

A shiny material that uses the Blinn-Phong reflection model. More...

#include <BlinnPhong.hpp>

Inheritance diagram for t::BlinnPhong:
t::Material

Public Member Functions

 BlinnPhong (Color _diffuseColor, Color _specularColor, double _shininess)
 Creates a new shiny material with the specified diffuse color, specular color, and shininess.
 
Vector4 vertexShader (const Uniforms &uniforms, const Attributes &attributes) override
 The vertex shader of this material, which will be run for every vertex of the mesh's geometry.
 
Color fragmentShader (const Uniforms &uniforms, const Varyings &varyings, const std::vector< std::reference_wrapper< Light > > &lights) override
 The fragment shader of this material, which will be run for every fragment that the mesh covers on the screen to determine its color.
 

Public Attributes

Color diffuseColor
 The base color of this material.
 
Color specularColor
 The color of the specular highlight.
 
double shininess
 The shininess constant of this material.
 
- Public Attributes inherited from t::Material
CullMode cullMode
 The face to cull (not draw) in the render.
 
bool depthTest = true
 Whether or not to perform the depth test.
 
bool depthWrite = true
 Whether or not to write the depth of the object to the depth texture.
 

Detailed Description

A shiny material that uses the Blinn-Phong reflection model.

Constructor & Destructor Documentation

◆ BlinnPhong()

t::BlinnPhong::BlinnPhong ( Color _diffuseColor,
Color _specularColor,
double _shininess )
inline

Creates a new shiny material with the specified diffuse color, specular color, and shininess.

Parameters
_diffuseColorThe base color of the new material.
_specularColorThe color of the specular highlight.
_shininessThe shininess constant of the new material. Higher values are for smoother and more mirror-like surfaces.

Member Function Documentation

◆ fragmentShader()

Color t::BlinnPhong::fragmentShader ( const Uniforms & uniforms,
const Varyings & varyings,
const std::vector< std::reference_wrapper< Light > > & lights )
inlineoverridevirtual

The fragment shader of this material, which will be run for every fragment that the mesh covers on the screen to determine its color.

Parameters
uniformsThe uniforms.
varyingsThe varyings.
lightsThe list of lights in the scene.
Returns
The color of the fragment this shader is invoked on.
See also
Fragment

Implements t::Material.

◆ vertexShader()

Vector4 t::BlinnPhong::vertexShader ( const Uniforms & uniforms,
const Attributes & attributes )
inlineoverridevirtual

The vertex shader of this material, which will be run for every vertex of the mesh's geometry.

Parameters
uniformsThe uniforms.
attributesThe attributes of the vertex.
Returns
The transformed vertex's position in homogeneous coordinates, usually in normalized device coordinates (NDC).

Implements t::Material.


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