264 float aShinness,
float aTransparency,
float aReflection );
326 float aShadowAttenuationFactor )
const = 0;
384 const SFVEC3F& aSpecular,
float aShinness,
float aTransparency,
385 float aReflection ) :
386 MATERIAL( aAmbient, aEmissive, aSpecular, aShinness, aTransparency, aReflection ) {}
391 const SFVEC3F& aLightColor,
float aShadowAttenuationFactor )
const override;
This source code comes from the project: https://github.com/sol-prog/Perlin_Noise.
Blinn Phong based material https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model.
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.
SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const override
Generate a 3D vector based on the ray and hit information depending on the implementation.
Procedural generation of the copper normals.
SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const override
Generate a 3D vector based on the ray and hit information depending on the implementation.
const MATERIAL_GENERATOR * m_board_normal_generator
A base class that can be used to derive procedurally generated materials.
virtual SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const =0
Generate a 3D vector based on the ray and hit information depending on the implementation.
virtual ~MATERIAL_GENERATOR()
Base material class that can be used to derive other material implementations.
float GetReflectivity() const
float GetAbsorvance() const
const MATERIAL_GENERATOR * GetGenerator() const
void SetReflectionRayCount(unsigned int aCount)
unsigned int m_refractionRayCount
Number of rays that will be interpolated for this material if it is reflective.
unsigned int m_refractionRecursionCount
Number of levels it allows for reflection recursiveness.
static void SetDefaultReflectionRayCount(unsigned int aCount)
void SetRefractionRecursionCount(unsigned int aCount)
static void SetDefaultRefractionRayCount(unsigned int aCount)
float m_absorbance
absorbance factor for the transparent material.
unsigned int m_reflectionRayCount
Number of levels it allows for refraction recursiveness.
unsigned int m_reflectionRecursionCount
bool GetCastShadows() const
static int m_defaultReflectionRayCount
static int m_defaultRefractionRayCount
static void SetDefaultRefractionRecursionCount(unsigned int aCount)
void SetCastShadows(bool aCastShadows)
Set if the material can receive shadows.
void SetGenerator(const MATERIAL_GENERATOR *aGenerator)
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.
const SFVEC3F & GetAmbientColor() const
unsigned int GetReflectionRecursionCount() const
static int m_defaultRefractionRecursionCount
float GetTransparency() const
unsigned int GetRefractionRayCount() const
bool m_castShadows
true if this object will block the light.
unsigned int GetRefractionRecursionCount() const
void Generate(SFVEC3F &aNormal, const RAY &aRay, const HITINFO &aHitInfo) const
float m_reflection
1.0 completely reflective, 0.0 no reflective.
const MATERIAL_GENERATOR * m_generator
const SFVEC3F & GetSpecularColor() const
void SetReflectionRecursionCount(unsigned int aCount)
static void SetDefaultReflectionRecursionCount(unsigned int aCount)
float m_reflectivity
1.0 is completely transparent, 0.0 completely opaque.
static int m_defaultFeflectionRecursionCount
void SetRefractionRayCount(unsigned int aCount)
const SFVEC3F & GetEmissiveColor() const
void SetAbsorvance(float aAbsorvanceFactor)
float GetReflection() const
unsigned int GetReflectionRayCount() const
Procedural generation of the plastic normals.
SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const override
Generate a 3D vector based on the ray and hit information depending on the implementation.
virtual ~PLASTIC_NORMAL()
Procedural generation of the shiny plastic normals.
SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const override
Generate a 3D vector based on the ray and hit information depending on the implementation.
virtual ~PLASTIC_SHINE_NORMAL()
virtual ~PLATED_COPPER_NORMAL()
PLATED_COPPER_NORMAL(float aScale)
SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const override
Generate a 3D vector based on the ray and hit information depending on the implementation.
virtual ~SILK_SCREEN_NORMAL()
SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const override
Generate a 3D vector based on the ray and hit information depending on the implementation.
Procedural generation of the solder mask.
const MATERIAL_GENERATOR * m_copper_normal_generator
virtual ~SOLDER_MASK_NORMAL()
SFVEC3F Generate(const RAY &aRay, const HITINFO &aHitInfo) const override
Generate a 3D vector based on the ray and hit information depending on the implementation.
Stores the hit information of a ray with a point on the surface of a object.