Rhino C++ API  8.13
Classes | Public Types | Public Member Functions | Friends | List of all members
ON_PhysicallyBasedMaterial Class Reference

#include <opennurbs_material.h>

Classes

class  ParametersNames
 

Public Types

enum  BRDFs : int { BRDFs::GGX = 0, BRDFs::Ward = 1 }
 Interface. More...
 

Public Member Functions

 ON_PhysicallyBasedMaterial (const ON_Material &src)
 
 ON_PhysicallyBasedMaterial (const ON_PhysicallyBasedMaterial &src)
 
virtual ~ON_PhysicallyBasedMaterial ()
 
virtual int AddTexture (const ON_Texture &tx)
 
virtual int AddTexture (const wchar_t *filename, ON_Texture::TYPE type)
 
double Alpha (void) const
 Controls Alpha transparency - 1.0 is fully opaque, 0.0 is non-visible. Use opacity for refraction - this overrides all other shading. More...
 
virtual double Anisotropic (void) const
 Degree of anisotropy. This controls the aspect ratio of the specular highlight. (0 = isotropic, 1 = maximally anisotropic) More...
 
virtual double AnisotropicRotation (void) const
 Rotates the direction of anisotropy, with 1.0 going full circle. More...
 
virtual ON_4fColor BaseColor (void) const
 
virtual BRDFs BRDF (void) const
 
virtual double Clearcoat (void) const
 A second, special-purpose specular lobe - Extra white specular layer on top of others. This is useful for materials like car paint and the like. More...
 
virtual double ClearcoatRoughness (void) const
 Controls clearcoat glossiness (0 = a “satin” appearance, 1 = a “gloss” appearance) More...
 
virtual int DeleteTexture (const wchar_t *filename, ON_Texture::TYPE type)
 
virtual ON_4fColor Emission (void) const
 Controls emission - uses base color. More...
 
virtual int FindTexture (const wchar_t *filename, ON_Texture::TYPE type, int i0=-1) const
 Texture access functions - exactly the same as ON_Material. Provided for ease of use. More...
 
virtual bool IsValid (class ON_TextLog *text_log=nullptr) const
 
virtual ON_MaterialMaterial (void)
 Access the referenced ON_Material. More...
 
virtual const ON_MaterialMaterial (void) const
 
virtual double Metallic (void) const
 
virtual double Opacity (void) const
 Mix between fully opaque surface at zero and fully glass like transmission at one. More...
 
virtual double OpacityIOR (void) const
 Index of refraction for transmission. More...
 
virtual double OpacityRoughness (void) const
 Controls roughness used for transmitted light. More...
 
virtual double ReflectiveIOR (void) const
 Reflective Ior - see specular amount above. Linked to Specular property. More...
 
virtual double Roughness (void) const
 Surface roughness, controls both diffuse and specular response. More...
 
void SetAlpha (double)
 
virtual void SetAnisotropic (double)
 
virtual void SetAnisotropicRotation (double)
 
virtual void SetBaseColor (const ON_4fColor &)
 
virtual void SetBRDF (const BRDFs &)
 
virtual void SetClearcoat (double)
 
virtual void SetClearcoatRoughness (double)
 
virtual void SetEmission (ON_4fColor)
 
virtual void SetMetallic (double)
 
virtual void SetOpacity (double)
 
virtual void SetOpacityIOR (double)
 
virtual void SetOpacityRoughness (double)
 
virtual void SetReflectiveIOR (double)
 
virtual void SetRoughness (double)
 
virtual void SetSheen (double)
 
virtual void SetSheenTint (double)
 
virtual void SetSpecular (double)
 
virtual void SetSpecularTint (double)
 
virtual void SetSubsurface (double)
 
virtual void SetSubsurfaceScatteringColor (const ON_4fColor &)
 
virtual void SetSubsurfaceScatteringRadius (double)
 
void SetUseBaseColorTextureAlphaForObjectAlphaTransparencyTexture (bool)
 
virtual double Sheen (void) const
 
virtual double SheenTint (void) const
 Amount to tint sheen towards base color. More...
 
virtual double Specular (void) const
 
virtual double SpecularTint (void) const
 
virtual double Subsurface (void) const
 
virtual ON_4fColor SubsurfaceScatteringColor (void) const
 Color for full subsurface transport if implemented. More...
 
virtual double SubsurfaceScatteringRadius (void) const
 Radius for full subsurface transport if implemented. More...
 
virtual void SynchronizeLegacyMaterial (void)
 Call this function to set the ON_Material up to represent the PBR material as well as possible. More...
 
virtual void ToLegacy (void)
 Expert function to remove all PBR data from a material. More...
 
bool UseBaseColorTextureAlphaForObjectAlphaTransparencyTexture () const
 

Friends

bool ON_PhysicallyBasedMaterial_Supported (const ON_PhysicallyBasedMaterial &material)
 

Detailed Description

Class ON_PhysicallyBasedMaterial

Member Enumeration Documentation

◆ BRDFs

Interface.

Reflectance model to use. Default is GGX. Renderers do not need to support a specific model, but certain material definitions may specify in the hope that a renderer will support. GGX support is built into Rhino (Cycles, display)

Enumerator
GGX 

http://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf

Ward 

https://pdfs.semanticscholar.org/330e/59117d7da6c794750730a15f9a178391b9fe.pdf

Constructor & Destructor Documentation

◆ ON_PhysicallyBasedMaterial() [1/2]

ON_PhysicallyBasedMaterial::ON_PhysicallyBasedMaterial ( const ON_Material src)

◆ ON_PhysicallyBasedMaterial() [2/2]

ON_PhysicallyBasedMaterial::ON_PhysicallyBasedMaterial ( const ON_PhysicallyBasedMaterial src)

◆ ~ON_PhysicallyBasedMaterial()

virtual ON_PhysicallyBasedMaterial::~ON_PhysicallyBasedMaterial ( )
virtual

Member Function Documentation

◆ AddTexture() [1/2]

virtual int ON_PhysicallyBasedMaterial::AddTexture ( const ON_Texture tx)
virtual

◆ AddTexture() [2/2]

virtual int ON_PhysicallyBasedMaterial::AddTexture ( const wchar_t *  filename,
ON_Texture::TYPE  type 
)
virtual

◆ Alpha()

double ON_PhysicallyBasedMaterial::Alpha ( void  ) const

Controls Alpha transparency - 1.0 is fully opaque, 0.0 is non-visible. Use opacity for refraction - this overrides all other shading.

virtual

◆ Anisotropic()

virtual double ON_PhysicallyBasedMaterial::Anisotropic ( void  ) const
virtual

Degree of anisotropy. This controls the aspect ratio of the specular highlight. (0 = isotropic, 1 = maximally anisotropic)

◆ AnisotropicRotation()

virtual double ON_PhysicallyBasedMaterial::AnisotropicRotation ( void  ) const
virtual

Rotates the direction of anisotropy, with 1.0 going full circle.

◆ BaseColor()

virtual ON_4fColor ON_PhysicallyBasedMaterial::BaseColor ( void  ) const
virtual

◆ BRDF()

virtual BRDFs ON_PhysicallyBasedMaterial::BRDF ( void  ) const
virtual

◆ Clearcoat()

virtual double ON_PhysicallyBasedMaterial::Clearcoat ( void  ) const
virtual

A second, special-purpose specular lobe - Extra white specular layer on top of others. This is useful for materials like car paint and the like.

◆ ClearcoatRoughness()

virtual double ON_PhysicallyBasedMaterial::ClearcoatRoughness ( void  ) const
virtual

Controls clearcoat glossiness (0 = a “satin” appearance, 1 = a “gloss” appearance)

◆ DeleteTexture()

virtual int ON_PhysicallyBasedMaterial::DeleteTexture ( const wchar_t *  filename,
ON_Texture::TYPE  type 
)
virtual

◆ Emission()

virtual ON_4fColor ON_PhysicallyBasedMaterial::Emission ( void  ) const
virtual

Controls emission - uses base color.

◆ FindTexture()

virtual int ON_PhysicallyBasedMaterial::FindTexture ( const wchar_t *  filename,
ON_Texture::TYPE  type,
int  i0 = -1 
) const
virtual

Texture access functions - exactly the same as ON_Material. Provided for ease of use.

◆ IsValid()

virtual bool ON_PhysicallyBasedMaterial::IsValid ( class ON_TextLog text_log = nullptr) const
virtual

◆ Material() [1/2]

virtual ON_Material& ON_PhysicallyBasedMaterial::Material ( void  )
virtual

Access the referenced ON_Material.

◆ Material() [2/2]

virtual const ON_Material& ON_PhysicallyBasedMaterial::Material ( void  ) const
virtual

◆ Metallic()

virtual double ON_PhysicallyBasedMaterial::Metallic ( void  ) const
virtual

The metallic-ness (0 = dielectric, 1 = metallic). This is a linear blend between two different models.The metallic model has no diffuse component and also has a tinted incident specular, equal to the base color

◆ Opacity()

virtual double ON_PhysicallyBasedMaterial::Opacity ( void  ) const
virtual

Mix between fully opaque surface at zero and fully glass like transmission at one.

◆ OpacityIOR()

virtual double ON_PhysicallyBasedMaterial::OpacityIOR ( void  ) const
virtual

Index of refraction for transmission.

◆ OpacityRoughness()

virtual double ON_PhysicallyBasedMaterial::OpacityRoughness ( void  ) const
virtual

Controls roughness used for transmitted light.

◆ ReflectiveIOR()

virtual double ON_PhysicallyBasedMaterial::ReflectiveIOR ( void  ) const
virtual

Reflective Ior - see specular amount above. Linked to Specular property.

◆ Roughness()

virtual double ON_PhysicallyBasedMaterial::Roughness ( void  ) const
virtual

Surface roughness, controls both diffuse and specular response.

◆ SetAlpha()

void ON_PhysicallyBasedMaterial::SetAlpha ( double  )

virtual

◆ SetAnisotropic()

virtual void ON_PhysicallyBasedMaterial::SetAnisotropic ( double  )
virtual

◆ SetAnisotropicRotation()

virtual void ON_PhysicallyBasedMaterial::SetAnisotropicRotation ( double  )
virtual

◆ SetBaseColor()

virtual void ON_PhysicallyBasedMaterial::SetBaseColor ( const ON_4fColor )
virtual

◆ SetBRDF()

virtual void ON_PhysicallyBasedMaterial::SetBRDF ( const BRDFs )
virtual

◆ SetClearcoat()

virtual void ON_PhysicallyBasedMaterial::SetClearcoat ( double  )
virtual

◆ SetClearcoatRoughness()

virtual void ON_PhysicallyBasedMaterial::SetClearcoatRoughness ( double  )
virtual

◆ SetEmission()

virtual void ON_PhysicallyBasedMaterial::SetEmission ( ON_4fColor  )
virtual

◆ SetMetallic()

virtual void ON_PhysicallyBasedMaterial::SetMetallic ( double  )
virtual

◆ SetOpacity()

virtual void ON_PhysicallyBasedMaterial::SetOpacity ( double  )
virtual

◆ SetOpacityIOR()

virtual void ON_PhysicallyBasedMaterial::SetOpacityIOR ( double  )
virtual

◆ SetOpacityRoughness()

virtual void ON_PhysicallyBasedMaterial::SetOpacityRoughness ( double  )
virtual

◆ SetReflectiveIOR()

virtual void ON_PhysicallyBasedMaterial::SetReflectiveIOR ( double  )
virtual

◆ SetRoughness()

virtual void ON_PhysicallyBasedMaterial::SetRoughness ( double  )
virtual

◆ SetSheen()

virtual void ON_PhysicallyBasedMaterial::SetSheen ( double  )
virtual

◆ SetSheenTint()

virtual void ON_PhysicallyBasedMaterial::SetSheenTint ( double  )
virtual

◆ SetSpecular()

virtual void ON_PhysicallyBasedMaterial::SetSpecular ( double  )
virtual

◆ SetSpecularTint()

virtual void ON_PhysicallyBasedMaterial::SetSpecularTint ( double  )
virtual

◆ SetSubsurface()

virtual void ON_PhysicallyBasedMaterial::SetSubsurface ( double  )
virtual

◆ SetSubsurfaceScatteringColor()

virtual void ON_PhysicallyBasedMaterial::SetSubsurfaceScatteringColor ( const ON_4fColor )
virtual

◆ SetSubsurfaceScatteringRadius()

virtual void ON_PhysicallyBasedMaterial::SetSubsurfaceScatteringRadius ( double  )
virtual

◆ SetUseBaseColorTextureAlphaForObjectAlphaTransparencyTexture()

void ON_PhysicallyBasedMaterial::SetUseBaseColorTextureAlphaForObjectAlphaTransparencyTexture ( bool  )

◆ Sheen()

virtual double ON_PhysicallyBasedMaterial::Sheen ( void  ) const
virtual

An additional grazing component, primarily intended for cloth. Amount of soft velvet like reflection near edges, for simulating materials such as cloth.

◆ SheenTint()

virtual double ON_PhysicallyBasedMaterial::SheenTint ( void  ) const
virtual

Amount to tint sheen towards base color.

◆ Specular()

virtual double ON_PhysicallyBasedMaterial::Specular ( void  ) const
virtual

Incident specular amount. Linked to Ior property below. specular=((ior−1)/(ior+1))2/0.08

◆ SpecularTint()

virtual double ON_PhysicallyBasedMaterial::SpecularTint ( void  ) const
virtual

A concession for artistic control that tints incident specular towards the base color. Grazing specular is still achromatic. Tints the facing specular reflection using the base color, while glancing reflection remains white. Normal dielectrics have colorless reflection, so this parameter is not technically physically correct and is provided for faking the appearance of materials with complex surface structure.

◆ Subsurface()

virtual double ON_PhysicallyBasedMaterial::Subsurface ( void  ) const
virtual

Controls diffuse shape using a subsurface approximation. If full subsurface transport is implemented, acts as a mix between diffuse and SSS

◆ SubsurfaceScatteringColor()

virtual ON_4fColor ON_PhysicallyBasedMaterial::SubsurfaceScatteringColor ( void  ) const
virtual

Color for full subsurface transport if implemented.

◆ SubsurfaceScatteringRadius()

virtual double ON_PhysicallyBasedMaterial::SubsurfaceScatteringRadius ( void  ) const
virtual

Radius for full subsurface transport if implemented.

◆ SynchronizeLegacyMaterial()

virtual void ON_PhysicallyBasedMaterial::SynchronizeLegacyMaterial ( void  )
virtual

Call this function to set the ON_Material up to represent the PBR material as well as possible.

◆ ToLegacy()

virtual void ON_PhysicallyBasedMaterial::ToLegacy ( void  )
virtual

Expert function to remove all PBR data from a material.

◆ UseBaseColorTextureAlphaForObjectAlphaTransparencyTexture()

bool ON_PhysicallyBasedMaterial::UseBaseColorTextureAlphaForObjectAlphaTransparencyTexture ( ) const

These function just route through to ON_Material - PBR materials need to support the same functionality.

If UseBaseColorTextureAlphaForObjectAlphaTransparencyTexture returns true, the alpha channel of the texture in m_textures with m_type=pbr_base_color is used in addition to any textures with m_type=pbr_alpha_texture.

Friends And Related Function Documentation

◆ ON_PhysicallyBasedMaterial_Supported

bool ON_PhysicallyBasedMaterial_Supported ( const ON_PhysicallyBasedMaterial material)
friend