#include <marblematerial.h>
Inheritance diagram for MarbleMaterial:
Public Member Functions | |
void | choose_materials (double noise_amount, Material **one, Material **two) const |
Choose which set of materials to use for a give noise value. | |
virtual Magick::Color | get_color (const Point3D &intersesction_point) const |
Get color from point. | |
virtual double | get_diffuse (const Point3D &intersesction_point) const |
Get the diffuse coefficient of the material at the given point. | |
virtual double | get_opacity (const Point3D &intersesction_point) const |
Get opacity of object at the point. | |
virtual double | get_reflection (const Point3D &intersesction_point) const |
Get reflection coefficient for the given point. | |
virtual double | get_reflectivity (const Point3D &intersesction_point) const |
Get reflectivity for the given point. | |
virtual double | get_refraction_index (const Point3D &intersesction_point) const |
double | interpolate_value (double noise_amount, double one, double two) const |
Perform interpolation of two values based on the noise value. | |
virtual bool | is_light (const Point3D &intersesction_point) const |
Return if material emits light. Always returns false. | |
MarbleMaterial (Material *one_a, Material *one_b, Material *two_a, Material *two_b, double break_point, double noise_scale) | |
Create a noise-based material from two materials. | |
virtual void | set_diffuse (double diffuse) |
No operation. Value of diffuse is ignored. | |
virtual void | set_is_light (bool v) |
No operation. Value of v is ignored. | |
virtual void | set_opacity (double opacity) |
No operation. See other set methods. | |
virtual | ~MarbleMaterial () |
Protected Attributes | |
double | m_break_point |
Material * | m_material_one_a |
First material element of composite. | |
Material * | m_material_one_b |
Second material element of composite. | |
double | m_material_one_scale |
Amount to scale first material set by. | |
Material * | m_material_two_a |
Third material element of composite. | |
Material * | m_material_two_b |
Fourth material element of composite. | |
double | m_material_two_scale |
Amount to scale second material set by. | |
Noise | m_noise |
Static noise instance. | |
double | m_noise_scale |
Static Protected Attributes | |
static StaticInit | m_init |
Dummy variable to force static initialization. | |
Classes | |
class | StaticInit |
Helper class to provide static initialization. More... |
This material supports the following properties:
material1a (Required) First component of first marble material material1b (Required) Second component of first marble material material2a (Required) First component of second marble material material2b (Required) Second component of second marble material break_point (Required) Noise value where material breaks from first marble material into second noise_scale (Required) How much to scale noise by. Larger values give grainier marbles.
Definition at line 26 of file marblematerial.h.
MarbleMaterial::MarbleMaterial | ( | Material * | one_a, | |
Material * | one_b, | |||
Material * | two_a, | |||
Material * | two_b, | |||
double | break_point, | |||
double | noise_scale | |||
) | [inline] |
Create a noise-based material from two materials.
Definition at line 74 of file marblematerial.h.
References m_break_point, m_material_one_scale, and m_material_two_scale.
virtual MarbleMaterial::~MarbleMaterial | ( | ) | [inline, virtual] |
Definition at line 92 of file marblematerial.h.
void MarbleMaterial::choose_materials | ( | double | noise_amount, | |
Material ** | one, | |||
Material ** | two | |||
) | const |
Choose which set of materials to use for a give noise value.
Definition at line 14 of file marblematerial.cpp.
References m_break_point, m_material_one_a, m_material_one_b, m_material_two_a, and m_material_two_b.
Referenced by get_color(), get_diffuse(), get_opacity(), get_reflection(), get_reflectivity(), and get_refraction_index().
Here is the caller graph for this function:
Color MarbleMaterial::get_color | ( | const Point3D & | intersesction_point | ) | const [virtual] |
Get color from point.
Implements Material.
Definition at line 46 of file marblematerial.cpp.
References choose_materials(), Material::get_color(), Scene::get_color(), Scene::get_instance(), Noise::get_noise(), m_break_point, m_material_one_scale, m_material_two_scale, m_noise, and m_noise_scale.
Here is the call graph for this function:
double MarbleMaterial::get_diffuse | ( | const Point3D & | intersesction_point | ) | const [virtual] |
Get the diffuse coefficient of the material at the given point.
Implements Material.
Definition at line 102 of file marblematerial.cpp.
References choose_materials(), Material::get_diffuse(), Noise::get_noise(), interpolate_value(), m_noise, and m_noise_scale.
Here is the call graph for this function:
double MarbleMaterial::get_opacity | ( | const Point3D & | intersesction_point | ) | const [virtual] |
Get opacity of object at the point.
Implements Material.
Definition at line 144 of file marblematerial.cpp.
References choose_materials(), Noise::get_noise(), Material::get_opacity(), interpolate_value(), m_noise, and m_noise_scale.
Here is the call graph for this function:
double MarbleMaterial::get_reflection | ( | const Point3D & | intersesction_point | ) | const [virtual] |
Get reflection coefficient for the given point.
Implements Material.
Definition at line 115 of file marblematerial.cpp.
References choose_materials(), Noise::get_noise(), Material::get_reflection(), interpolate_value(), m_noise, and m_noise_scale.
Here is the call graph for this function:
double MarbleMaterial::get_reflectivity | ( | const Point3D & | intersesction_point | ) | const [virtual] |
Get reflectivity for the given point.
Implements Material.
Definition at line 124 of file marblematerial.cpp.
References choose_materials(), Noise::get_noise(), Material::get_reflectivity(), interpolate_value(), m_noise, and m_noise_scale.
Here is the call graph for this function:
double MarbleMaterial::get_refraction_index | ( | const Point3D & | intersesction_point | ) | const [virtual] |
Get the refraction index at the point. This may produce some bizarre images if the refraction indexes vary among the materials. It will certainly be incorrect for a noise material as varying refraction within the object will not be honored. Only the location on the surface will be considered.
Implements Material.
Definition at line 133 of file marblematerial.cpp.
References choose_materials(), Noise::get_noise(), Material::get_refraction_index(), interpolate_value(), m_noise, and m_noise_scale.
Here is the call graph for this function:
double MarbleMaterial::interpolate_value | ( | double | noise_amount, | |
double | one, | |||
double | two | |||
) | const |
Perform interpolation of two values based on the noise value.
Definition at line 31 of file marblematerial.cpp.
References m_break_point, m_material_one_scale, and m_material_two_scale.
Referenced by get_diffuse(), get_opacity(), get_reflection(), get_reflectivity(), and get_refraction_index().
Here is the caller graph for this function:
bool MarbleMaterial::is_light | ( | const Point3D & | intersesction_point | ) | const [virtual] |
Return if material emits light. Always returns false.
Implements Material.
Definition at line 93 of file marblematerial.cpp.
void MarbleMaterial::set_diffuse | ( | double | diffuse | ) | [virtual] |
No operation. Value of diffuse is ignored.
Implements Material.
Definition at line 111 of file marblematerial.cpp.
void MarbleMaterial::set_is_light | ( | bool | v | ) | [virtual] |
No operation. Value of v is ignored.
Implements Material.
Definition at line 98 of file marblematerial.cpp.
void MarbleMaterial::set_opacity | ( | double | opacity | ) | [virtual] |
No operation. See other set methods.
Implements Material.
Definition at line 153 of file marblematerial.cpp.
double MarbleMaterial::m_break_point [protected] |
Point in noise calculation where material 'breaks' into second set of materials
Definition at line 60 of file marblematerial.h.
Referenced by choose_materials(), get_color(), interpolate_value(), and MarbleMaterial().
MarbleMaterial::StaticInit MarbleMaterial::m_init [static, protected] |
Material* MarbleMaterial::m_material_one_a [protected] |
First material element of composite.
Definition at line 49 of file marblematerial.h.
Referenced by choose_materials().
Material* MarbleMaterial::m_material_one_b [protected] |
Second material element of composite.
Definition at line 51 of file marblematerial.h.
Referenced by choose_materials().
double MarbleMaterial::m_material_one_scale [protected] |
Amount to scale first material set by.
Definition at line 63 of file marblematerial.h.
Referenced by get_color(), interpolate_value(), and MarbleMaterial().
Material* MarbleMaterial::m_material_two_a [protected] |
Third material element of composite.
Definition at line 54 of file marblematerial.h.
Referenced by choose_materials().
Material* MarbleMaterial::m_material_two_b [protected] |
Fourth material element of composite.
Definition at line 56 of file marblematerial.h.
Referenced by choose_materials().
double MarbleMaterial::m_material_two_scale [protected] |
Amount to scale second material set by.
Definition at line 66 of file marblematerial.h.
Referenced by get_color(), interpolate_value(), and MarbleMaterial().
Noise MarbleMaterial::m_noise [protected] |
Static noise instance.
Definition at line 43 of file marblematerial.h.
Referenced by get_color(), get_diffuse(), get_opacity(), get_reflection(), get_reflectivity(), and get_refraction_index().
double MarbleMaterial::m_noise_scale [protected] |
Amount to scale noise by. Larger values create much grainier marbles.
Definition at line 70 of file marblematerial.h.
Referenced by get_color(), get_diffuse(), get_opacity(), get_reflection(), get_reflectivity(), and get_refraction_index().