KiCad PCB EDA Suite
|
Base material class that can be used to derive other material implementations. More...
#include <material.h>
Public Member Functions | |
MATERIAL () | |
MATERIAL (const SFVEC3F &aAmbient, const SFVEC3F &aEmissive, const SFVEC3F &aSpecular, float aShinness, float aTransparency, float aReflection) | |
virtual | ~MATERIAL () |
const SFVEC3F & | GetAmbientColor () const |
const SFVEC3F & | GetEmissiveColor () const |
const SFVEC3F & | GetSpecularColor () const |
float | GetReflectivity () const |
float | GetTransparency () const |
float | GetReflection () const |
float | GetAbsorvance () const |
unsigned int | GetRefractionRayCount () const |
unsigned int | GetReflectionRayCount () const |
unsigned int | GetReflectionRecursionCount () const |
unsigned int | GetRefractionRecursionCount () const |
void | SetAbsorvance (float aAbsorvanceFactor) |
void | SetRefractionRayCount (unsigned int aCount) |
void | SetReflectionRayCount (unsigned int aCount) |
void | SetReflectionRecursionCount (unsigned int aCount) |
void | SetRefractionRecursionCount (unsigned int aCount) |
void | SetCastShadows (bool aCastShadows) |
Set if the material can receive shadows. | |
bool | GetCastShadows () const |
virtual SFVEC3F | Shade (const RAY &aRay, const HITINFO &aHitInfo, float NdotL, const SFVEC3F &aDiffuseObjColor, const SFVEC3F &aDirToLight, const SFVEC3F &aLightColor, float aShadowAttenuationFactor) const =0 |
Shade an intersection point. | |
void | SetGenerator (const MATERIAL_GENERATOR *aGenerator) |
const MATERIAL_GENERATOR * | GetGenerator () const |
void | Generate (SFVEC3F &aNormal, const RAY &aRay, const HITINFO &aHitInfo) const |
Static Public Member Functions | |
static void | SetDefaultRefractionRayCount (unsigned int aCount) |
static void | SetDefaultReflectionRayCount (unsigned int aCount) |
static void | SetDefaultRefractionRecursionCount (unsigned int aCount) |
static void | SetDefaultReflectionRecursionCount (unsigned int aCount) |
Protected Attributes | |
SFVEC3F | m_ambientColor |
SFVEC3F | m_emissiveColor |
SFVEC3F | m_specularColor |
float | m_reflectivity |
1.0 is completely transparent, 0.0 completely opaque. | |
float | m_transparency |
float | m_absorbance |
absorbance factor for the transparent material. | |
float | m_reflection |
1.0 completely reflective, 0.0 no reflective. | |
bool | m_castShadows |
true if this object will block the light. | |
unsigned int | m_refractionRayCount |
Number of rays that will be interpolated for this material if it is reflective. | |
unsigned int | m_reflectionRayCount |
Number of levels it allows for refraction recursiveness. | |
unsigned int | m_refractionRecursionCount |
Number of levels it allows for reflection recursiveness. | |
unsigned int | m_reflectionRecursionCount |
const MATERIAL_GENERATOR * | m_generator |
Static Private Attributes | |
static int | m_defaultRefractionRayCount = 4 |
static int | m_defaultReflectionRayCount = 3 |
static int | m_defaultRefractionRecursionCount = 2 |
static int | m_defaultFeflectionRecursionCount = 3 |
Base material class that can be used to derive other material implementations.
Definition at line 239 of file material.h.
MATERIAL::MATERIAL | ( | ) |
Definition at line 40 of file material.cpp.
References m_absorbance, m_ambientColor, m_castShadows, m_defaultFeflectionRecursionCount, m_defaultReflectionRayCount, m_defaultRefractionRayCount, m_defaultRefractionRecursionCount, m_emissiveColor, m_generator, m_reflection, m_reflectionRayCount, m_reflectionRecursionCount, m_reflectivity, m_refractionRayCount, m_refractionRecursionCount, m_specularColor, and m_transparency.
MATERIAL::MATERIAL | ( | const SFVEC3F & | aAmbient, |
const SFVEC3F & | aEmissive, | ||
const SFVEC3F & | aSpecular, | ||
float | aShinness, | ||
float | aTransparency, | ||
float | aReflection | ||
) |
Definition at line 59 of file material.cpp.
References AMBIENT_FACTOR, m_absorbance, m_ambientColor, m_castShadows, m_defaultFeflectionRecursionCount, m_defaultReflectionRayCount, m_defaultRefractionRayCount, m_defaultRefractionRecursionCount, m_emissiveColor, m_generator, m_reflection, m_reflectionRayCount, m_reflectionRecursionCount, m_reflectivity, m_refractionRayCount, m_refractionRecursionCount, m_specularColor, and m_transparency.
|
inlinevirtual |
Definition at line 266 of file material.h.
Definition at line 89 of file material.cpp.
References MATERIAL_GENERATOR::Generate(), and m_generator.
Referenced by CYLINDER::Intersect(), DUMMY_BLOCK::Intersect(), LAYER_ITEM::Intersect(), XY_PLANE::Intersect(), ROUND_SEGMENT::Intersect(), and TRIANGLE::Intersect().
|
inline |
Definition at line 275 of file material.h.
References m_absorbance.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 268 of file material.h.
References m_ambientColor.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 309 of file material.h.
References m_castShadows.
Referenced by BVH_PBRT::IntersectP().
|
inline |
Definition at line 269 of file material.h.
References m_emissiveColor.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 333 of file material.h.
References m_generator.
|
inline |
Definition at line 274 of file material.h.
References m_reflection.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 277 of file material.h.
References m_reflectionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 278 of file material.h.
References m_reflectionRecursionCount.
|
inline |
Definition at line 272 of file material.h.
References m_reflectivity.
|
inline |
Definition at line 276 of file material.h.
References m_refractionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 279 of file material.h.
References m_refractionRecursionCount.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 270 of file material.h.
References m_specularColor.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inline |
Definition at line 273 of file material.h.
References m_transparency.
Referenced by RENDER_3D_RAYTRACE_BASE::addModels(), and OBJECT_3D::SetMaterial().
|
inline |
Definition at line 281 of file material.h.
References m_absorbance.
|
inline |
Set if the material can receive shadows.
aCastShadows | true yes it can, false not it cannot |
Definition at line 307 of file material.h.
References m_castShadows.
|
inlinestatic |
Definition at line 247 of file material.h.
References m_defaultReflectionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inlinestatic |
Definition at line 257 of file material.h.
References m_defaultFeflectionRecursionCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inlinestatic |
Definition at line 242 of file material.h.
References m_defaultRefractionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inlinestatic |
Definition at line 252 of file material.h.
References m_defaultRefractionRecursionCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inline |
Definition at line 328 of file material.h.
References m_generator.
Referenced by RENDER_3D_RAYTRACE_BASE::getModelMaterial().
|
inline |
Definition at line 287 of file material.h.
References m_reflectionRayCount.
|
inline |
Definition at line 292 of file material.h.
References m_reflectionRecursionCount.
|
inline |
Definition at line 282 of file material.h.
References m_refractionRayCount.
|
inline |
Definition at line 297 of file material.h.
References m_refractionRecursionCount.
|
pure virtual |
Shade an intersection point.
aRay | the camera ray that hits the object |
aHitInfo | the hit information |
NdotL | the dot product between Normal and Light |
aDiffuseObjColor | diffuse object color |
aDirToLight | a vector of the incident light direction |
aLightColor | the light color |
aShadowAttenuationFactor | 0.0f total in shadow, 1.0f completely not in shadow |
Implemented in BLINN_PHONG_MATERIAL.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
protected |
absorbance factor for the transparent material.
Definition at line 350 of file material.h.
Referenced by GetAbsorvance(), MATERIAL(), and SetAbsorvance().
|
protected |
Definition at line 338 of file material.h.
Referenced by GetAmbientColor(), MATERIAL(), and BLINN_PHONG_MATERIAL::Shade().
|
protected |
true if this object will block the light.
Number of rays that will be interpolated for this material if it is transparent.
Definition at line 352 of file material.h.
Referenced by GetCastShadows(), MATERIAL(), and SetCastShadows().
|
staticprivate |
Definition at line 372 of file material.h.
Referenced by MATERIAL(), and SetDefaultReflectionRecursionCount().
|
staticprivate |
Definition at line 370 of file material.h.
Referenced by MATERIAL(), and SetDefaultReflectionRayCount().
|
staticprivate |
Definition at line 369 of file material.h.
Referenced by MATERIAL(), and SetDefaultRefractionRayCount().
|
staticprivate |
Definition at line 371 of file material.h.
Referenced by MATERIAL(), and SetDefaultRefractionRecursionCount().
|
protected |
Definition at line 344 of file material.h.
Referenced by GetEmissiveColor(), and MATERIAL().
|
protected |
Definition at line 366 of file material.h.
Referenced by Generate(), GetGenerator(), MATERIAL(), and SetGenerator().
|
protected |
1.0 completely reflective, 0.0 no reflective.
Definition at line 351 of file material.h.
Referenced by GetReflection(), and MATERIAL().
|
protected |
Number of levels it allows for refraction recursiveness.
Definition at line 358 of file material.h.
Referenced by GetReflectionRayCount(), MATERIAL(), and SetReflectionRayCount().
|
protected |
Definition at line 364 of file material.h.
Referenced by GetReflectionRecursionCount(), MATERIAL(), and SetReflectionRecursionCount().
|
protected |
1.0 is completely transparent, 0.0 completely opaque.
Definition at line 346 of file material.h.
Referenced by GetReflectivity(), MATERIAL(), and BLINN_PHONG_MATERIAL::Shade().
|
protected |
Number of rays that will be interpolated for this material if it is reflective.
Definition at line 355 of file material.h.
Referenced by GetRefractionRayCount(), MATERIAL(), and SetRefractionRayCount().
|
protected |
Number of levels it allows for reflection recursiveness.
Definition at line 361 of file material.h.
Referenced by GetRefractionRecursionCount(), MATERIAL(), and SetRefractionRecursionCount().
|
protected |
Definition at line 345 of file material.h.
Referenced by GetSpecularColor(), MATERIAL(), and BLINN_PHONG_MATERIAL::Shade().
|
protected |
Definition at line 349 of file material.h.
Referenced by GetTransparency(), and MATERIAL().