5 #include <ngl/Colour.h>
84 int index_x = (int)(floor(_isect.m_x)) % 2;
85 int index_z = (int)(floor(_isect.m_z)) % 2;
87 if (((
bool)index_x && (bool)index_z) || ((bool)index_x == 0 && (
bool)index_z == 0))
Material()
Material constructor.
bool m_isRefractive
Specifies whether object is transparent.
float m_ior
Index of refraction.
This will be used to return the colour when queried from the Shape derived classes.
void setHardness(float _highlight_size)
Sets the specular modulator for the specular contribution in the Phong shader.
float getIOR()
Returns index of refraction.
float m_refl_intensity
Amount of reflection.
float getDiffuseIntensity()
Returns amount of diffuse contribution.
float m_transparency
Amount of refraction, in other words 'transparency'.
float m_spec_hardness
This will drive the spreadness of the specular highlights.
bool m_isReflective
Tells whether the object is reflective.
float getTransparency()
Returns transparency.
ngl::Colour m_colour1
Colour of the object.
float m_diffuse_intensity
Diffuse intensity, self-explanatory.
bool isRefractive()
Returns whether the material is reflective or not.
float getReflIntensity()
Returns amount of reflection.
void setReflection(float _refl_intensity, float _diffuse_intensity)
Sets the reflection parameters.
void setRefraction(float _ior, float _transparency, float _diffuse_intensity)
Sets the refraction settings.
ngl::Colour m_colour2
For checker materials we will have colour1 and colour2, for plain ones just colour1.
bool isReflective()
Returns whether the material is reflective or not.
ngl::Colour objColour()
Returns the object colour.
bool m_isChecker
Specifies whether it is checker or not.