t
|
The base material class. More...
#include <Material.hpp>
Public Member Functions | |
virtual Vector4 | vertexShader (const Uniforms &uniforms, const Attributes &attributes)=0 |
The vertex shader of this material, which will be run for every vertex of the mesh's geometry. | |
virtual Color | fragmentShader (const Uniforms &uniforms, const Varyings &varyings, const std::vector< std::reference_wrapper< Light > > &lights)=0 |
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 | |
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. | |
The base material class.
A material defines the look of a 3D object. It is one of the 2 components of a 3D mesh.
This class must not be instantiated directly. Instead, you can create your own material by deriving from this class and implement your own vertexShader
and fragmentShader
.
|
pure virtual |
The fragment shader of this material, which will be run for every fragment that the mesh covers on the screen to determine its color.
uniforms | The uniforms. |
varyings | The varyings. |
lights | The list of lights in the scene. |
Implemented in t::BlinnPhong, t::NormalColor, and t::SolidColor.
|
pure virtual |
The vertex shader of this material, which will be run for every vertex of the mesh's geometry.
uniforms | The uniforms. |
attributes | The attributes of the vertex. |
Implemented in t::BlinnPhong, t::NormalColor, and t::SolidColor.
CullMode t::Material::cullMode |
The face to cull (not draw) in the render.
bool t::Material::depthTest = true |
Whether or not to perform the depth test.
The depth test tests if a part of an object is behind another object, and thus avoid drawing that part.