Phongo Clap RT
1.0
Simple Raytracing Renderer
|
#include <Material.h>
Public Member Functions | |
Material () | |
Material constructor. More... | |
Material (ngl::Colour _c) | |
Material constructor passing a colour, this will not be a checker material. More... | |
Material (ngl::Colour _c1, ngl::Colour _c2) | |
Material constructor passing two colours will enable the checker shading. More... | |
bool | isReflective () |
Returns whether the material is reflective or not. More... | |
bool | isRefractive () |
Returns whether the material is reflective or not. More... | |
void | setHardness (float _highlight_size) |
Sets the specular modulator for the specular contribution in the Phong shader. More... | |
void | setReflection (float _refl_intensity, float _diffuse_intensity) |
Sets the reflection parameters. More... | |
void | setRefraction (float _ior, float _transparency, float _diffuse_intensity) |
Sets the refraction settings. More... | |
float | getReflIntensity () |
Returns amount of reflection. More... | |
float | getIOR () |
Returns index of refraction. More... | |
float | getTransparency () |
Returns transparency. More... | |
float | getDiffuseIntensity () |
Returns amount of diffuse contribution. More... | |
ngl::Colour | objColour () |
Returns the object colour. More... | |
ngl::Colour | objColour (ngl::Vec3 &_isect) |
However I implemented this overloaded function that grabs an intersection, this is used for the checker materials, normally used on planes. Don't set up a checker on a Sphere. More... | |
Public Attributes | |
bool | m_isReflective = false |
Tells whether the object is reflective. More... | |
bool | m_isRefractive = false |
Specifies whether object is transparent. More... | |
float | m_diffuse_intensity |
Diffuse intensity, self-explanatory. More... | |
float | m_refl_intensity |
Amount of reflection. More... | |
float | m_ior |
Index of refraction. More... | |
float | m_transparency |
Amount of refraction, in other words 'transparency'. More... | |
float | m_spec_hardness = 40 |
This will drive the spreadness of the specular highlights. More... | |
ngl::Colour | m_colour1 |
Colour of the object. More... | |
ngl::Colour | m_colour2 |
For checker materials we will have colour1 and colour2, for plain ones just colour1. More... | |
bool | m_isChecker |
Specifies whether it is checker or not. More... | |
Definition at line 12 of file Material.h.
Material::Material | ( | ) |
Material::Material | ( | ngl::Colour | _c | ) |
Material constructor passing a colour, this will not be a checker material.
[in] | Colour | of the object. |
Definition at line 9 of file Material.cpp.
References m_colour1, and m_isChecker.
Material::Material | ( | ngl::Colour | _c1, |
ngl::Colour | _c2 | ||
) |
Material constructor passing two colours will enable the checker shading.
[in] | _c | Colours to be applied to checkerboard. |
Definition at line 15 of file Material.cpp.
References m_colour1, m_colour2, and m_isChecker.
float Material::getDiffuseIntensity | ( | ) |
Returns amount of diffuse contribution.
Definition at line 67 of file Material.cpp.
References m_diffuse_intensity.
float Material::getIOR | ( | ) |
Returns index of refraction.
Definition at line 57 of file Material.cpp.
References m_ior.
float Material::getReflIntensity | ( | ) |
Returns amount of reflection.
Definition at line 52 of file Material.cpp.
References m_refl_intensity.
float Material::getTransparency | ( | ) |
Returns transparency.
Definition at line 62 of file Material.cpp.
References m_transparency.
bool Material::isReflective | ( | ) |
Returns whether the material is reflective or not.
Definition at line 22 of file Material.cpp.
References m_isReflective.
bool Material::isRefractive | ( | ) |
Returns whether the material is reflective or not.
Definition at line 27 of file Material.cpp.
References m_isRefractive.
ngl::Colour Material::objColour | ( | ) |
Returns the object colour.
Definition at line 72 of file Material.cpp.
References m_colour1.
ngl::Colour Material::objColour | ( | ngl::Vec3 & | _isect | ) |
However I implemented this overloaded function that grabs an intersection, this is used for the checker materials, normally used on planes. Don't set up a checker on a Sphere.
[in] | _isect | The world position of an intersection. |
Definition at line 77 of file Material.cpp.
References m_colour1, m_colour2, and m_isChecker.
void Material::setHardness | ( | float | _highlight_size | ) |
Sets the specular modulator for the specular contribution in the Phong shader.
Definition at line 32 of file Material.cpp.
References m_spec_hardness.
void Material::setReflection | ( | float | _refl_intensity, |
float | _diffuse_intensity | ||
) |
Sets the reflection parameters.
[in] | _refl_intensity | (percentage, from 0 to 100) Reflectiveness of the object. |
[in] | _diffuse_intensity | (percentage, from 0 to 100) This value equals to 100 - _refl_intensity . |
Definition at line 37 of file Material.cpp.
References m_diffuse_intensity, m_isReflective, and m_refl_intensity.
void Material::setRefraction | ( | float | _ior, |
float | _transparency, | ||
float | _diffuse_intensity | ||
) |
Sets the refraction settings.
[in] | _ior | Inex of refraction. You can look them up in a table or in the internet. |
[in] | _transparency | (percentage, from 0 to 100) How refractive the material is. |
[in] | _diffuse_intensity | (percentage, from 0 to 100) This value equals to 100 - _transparency . |
Definition at line 44 of file Material.cpp.
References m_diffuse_intensity, m_ior, m_isRefractive, and m_transparency.
ngl::Colour Material::m_colour1 |
Colour of the object.
Definition at line 121 of file Material.h.
ngl::Colour Material::m_colour2 |
For checker materials we will have colour1 and colour2, for plain ones just colour1.
Definition at line 125 of file Material.h.
float Material::m_diffuse_intensity |
Diffuse intensity, self-explanatory.
Definition at line 100 of file Material.h.
float Material::m_ior |
Index of refraction.
Definition at line 108 of file Material.h.
bool Material::m_isChecker |
Specifies whether it is checker or not.
Definition at line 129 of file Material.h.
bool Material::m_isReflective = false |
Tells whether the object is reflective.
Definition at line 92 of file Material.h.
bool Material::m_isRefractive = false |
Specifies whether object is transparent.
Definition at line 96 of file Material.h.
float Material::m_refl_intensity |
Amount of reflection.
Definition at line 104 of file Material.h.
float Material::m_spec_hardness = 40 |
This will drive the spreadness of the specular highlights.
Definition at line 116 of file Material.h.
float Material::m_transparency |
Amount of refraction, in other words 'transparency'.
Definition at line 112 of file Material.h.