KiCad PCB EDA Suite
|
Blinn Phong based material https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model. More...
#include <material.h>
Public Member Functions | |
BLINN_PHONG_MATERIAL () | |
BLINN_PHONG_MATERIAL (const SFVEC3F &aAmbient, const SFVEC3F &aEmissive, const SFVEC3F &aSpecular, float aShinness, float aTransparency, float aReflection) | |
SFVEC3F | Shade (const RAY &aRay, const HITINFO &aHitInfo, float NdotL, const SFVEC3F &aDiffuseObjColor, const SFVEC3F &aDirToLight, const SFVEC3F &aLightColor, float aShadowAttenuationFactor) const override |
Shade an intersection point. | |
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 |
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 |
Blinn Phong based material https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model.
Definition at line 378 of file material.h.
|
inline |
Definition at line 381 of file material.h.
|
inline |
Definition at line 383 of file material.h.
|
inherited |
Definition at line 89 of file material.cpp.
References MATERIAL_GENERATOR::Generate(), and MATERIAL::m_generator.
Referenced by CYLINDER::Intersect(), DUMMY_BLOCK::Intersect(), LAYER_ITEM::Intersect(), XY_PLANE::Intersect(), ROUND_SEGMENT::Intersect(), and TRIANGLE::Intersect().
|
inlineinherited |
Definition at line 275 of file material.h.
References MATERIAL::m_absorbance.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 268 of file material.h.
References MATERIAL::m_ambientColor.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 309 of file material.h.
References MATERIAL::m_castShadows.
Referenced by BVH_PBRT::IntersectP().
|
inlineinherited |
Definition at line 269 of file material.h.
References MATERIAL::m_emissiveColor.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 333 of file material.h.
References MATERIAL::m_generator.
|
inlineinherited |
Definition at line 274 of file material.h.
References MATERIAL::m_reflection.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 277 of file material.h.
References MATERIAL::m_reflectionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 278 of file material.h.
References MATERIAL::m_reflectionRecursionCount.
|
inlineinherited |
Definition at line 272 of file material.h.
References MATERIAL::m_reflectivity.
|
inlineinherited |
Definition at line 276 of file material.h.
References MATERIAL::m_refractionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 279 of file material.h.
References MATERIAL::m_refractionRecursionCount.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 270 of file material.h.
References MATERIAL::m_specularColor.
Referenced by RENDER_3D_RAYTRACE_BASE::shadeHit().
|
inlineinherited |
Definition at line 273 of file material.h.
References MATERIAL::m_transparency.
Referenced by RENDER_3D_RAYTRACE_BASE::addModels(), and OBJECT_3D::SetMaterial().
|
inlineinherited |
Definition at line 281 of file material.h.
References MATERIAL::m_absorbance.
|
inlineinherited |
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 MATERIAL::m_castShadows.
|
inlinestaticinherited |
Definition at line 247 of file material.h.
References MATERIAL::m_defaultReflectionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inlinestaticinherited |
Definition at line 257 of file material.h.
References MATERIAL::m_defaultFeflectionRecursionCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inlinestaticinherited |
Definition at line 242 of file material.h.
References MATERIAL::m_defaultRefractionRayCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inlinestaticinherited |
Definition at line 252 of file material.h.
References MATERIAL::m_defaultRefractionRecursionCount.
Referenced by RENDER_3D_RAYTRACE_BASE::setupMaterials().
|
inlineinherited |
Definition at line 328 of file material.h.
References MATERIAL::m_generator.
Referenced by RENDER_3D_RAYTRACE_BASE::getModelMaterial().
|
inlineinherited |
Definition at line 287 of file material.h.
References MATERIAL::m_reflectionRayCount.
|
inlineinherited |
Definition at line 292 of file material.h.
References MATERIAL::m_reflectionRecursionCount.
|
inlineinherited |
Definition at line 282 of file material.h.
References MATERIAL::m_refractionRayCount.
|
inlineinherited |
Definition at line 297 of file material.h.
References MATERIAL::m_refractionRecursionCount.
|
overridevirtual |
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 |
Implements MATERIAL.
Definition at line 100 of file material.cpp.
References H, MATERIAL::m_ambientColor, RAY::m_Dir, HITINFO::m_HitNormal, MATERIAL::m_reflectivity, MATERIAL::m_specularColor, and SPECULAR_FACTOR.
|
protectedinherited |
absorbance factor for the transparent material.
Definition at line 350 of file material.h.
Referenced by MATERIAL::GetAbsorvance(), MATERIAL::MATERIAL(), and MATERIAL::SetAbsorvance().
|
protectedinherited |
Definition at line 338 of file material.h.
Referenced by MATERIAL::GetAmbientColor(), MATERIAL::MATERIAL(), and Shade().
|
protectedinherited |
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 MATERIAL::GetCastShadows(), MATERIAL::MATERIAL(), and MATERIAL::SetCastShadows().
|
staticprivateinherited |
Definition at line 372 of file material.h.
Referenced by MATERIAL::MATERIAL(), and MATERIAL::SetDefaultReflectionRecursionCount().
|
staticprivateinherited |
Definition at line 370 of file material.h.
Referenced by MATERIAL::MATERIAL(), and MATERIAL::SetDefaultReflectionRayCount().
|
staticprivateinherited |
Definition at line 369 of file material.h.
Referenced by MATERIAL::MATERIAL(), and MATERIAL::SetDefaultRefractionRayCount().
|
staticprivateinherited |
Definition at line 371 of file material.h.
Referenced by MATERIAL::MATERIAL(), and MATERIAL::SetDefaultRefractionRecursionCount().
|
protectedinherited |
Definition at line 344 of file material.h.
Referenced by MATERIAL::GetEmissiveColor(), and MATERIAL::MATERIAL().
|
protectedinherited |
Definition at line 366 of file material.h.
Referenced by MATERIAL::Generate(), MATERIAL::GetGenerator(), MATERIAL::MATERIAL(), and MATERIAL::SetGenerator().
|
protectedinherited |
1.0 completely reflective, 0.0 no reflective.
Definition at line 351 of file material.h.
Referenced by MATERIAL::GetReflection(), and MATERIAL::MATERIAL().
|
protectedinherited |
Number of levels it allows for refraction recursiveness.
Definition at line 358 of file material.h.
Referenced by MATERIAL::GetReflectionRayCount(), MATERIAL::MATERIAL(), and MATERIAL::SetReflectionRayCount().
|
protectedinherited |
Definition at line 364 of file material.h.
Referenced by MATERIAL::GetReflectionRecursionCount(), MATERIAL::MATERIAL(), and MATERIAL::SetReflectionRecursionCount().
|
protectedinherited |
1.0 is completely transparent, 0.0 completely opaque.
Definition at line 346 of file material.h.
Referenced by MATERIAL::GetReflectivity(), MATERIAL::MATERIAL(), and Shade().
|
protectedinherited |
Number of rays that will be interpolated for this material if it is reflective.
Definition at line 355 of file material.h.
Referenced by MATERIAL::GetRefractionRayCount(), MATERIAL::MATERIAL(), and MATERIAL::SetRefractionRayCount().
|
protectedinherited |
Number of levels it allows for reflection recursiveness.
Definition at line 361 of file material.h.
Referenced by MATERIAL::GetRefractionRecursionCount(), MATERIAL::MATERIAL(), and MATERIAL::SetRefractionRecursionCount().
|
protectedinherited |
Definition at line 345 of file material.h.
Referenced by MATERIAL::GetSpecularColor(), MATERIAL::MATERIAL(), and Shade().
|
protectedinherited |
Definition at line 349 of file material.h.
Referenced by MATERIAL::GetTransparency(), and MATERIAL::MATERIAL().